Solved

landing on the same page for diffrent domains in apache virtualhosts

Posted on 2009-05-03
3
353 Views
Last Modified: 2013-11-08
i have following configuration in my httpd server installed on centos mach locally. for testing reasons

in my /etc/hosts file i place following code
101.168.1.25  www.solutionsbeyond.local
101.168.1.25  forum.solutionsbeyond.local
101.168.1.25  forum2.solutionsbeyond.local

and in /etc/httpd/conf/httpd.conf

NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin  admin@solutionsbeyond.local
DocumentRoot  /home/httpd/sb
ServerName www.solutionsbeyond.local
DirectoryIndex index.php index.html index.htm
</VirtualHost>

<VirtualHost *:80>
ServerAdmin  admin@solutionsbeyond.local
DocumentRoot  /home/httpd/test
ServerName forum.solutionsbeyond.local
</VirtualHost>

<VirtualHost *:80>
ServerAdmin  admin@solutionsbeyond.local
DocumentRoot  /home/httpd/phpbb
ServerName forum2.solutionsbeyond.local
DirectoryIndex index.php index.html index.htm
</VirtualHost>

no i have i file index.html on each folder  with sub domain typed in it. Now the problem i am facing is that when i type www.solutionsbeyond.local i see index page displaying Welcome to www.solutionsbeyond.local.

now when i try to go to forum.solutionsbeyond.local i still get to page where it displays "welcome to www.solutionsbeyond.local but i type forum.solutiuonsbeyond.local i get the msg welcome to forum.solutionsbeyond.local what can be the resone behind it and how can i fix it more over i want apache to pick the index.php by default and for that i places

DirectoryIndex index.php index.html index.htm in the virtual directory code but i its not working how can i make it working
0
Comment
Question by:serveradmin
3 Comments
 
LVL 2

Accepted Solution

by:
keithdmitchell earned 500 total points
ID: 24296586
Since this is local, we can't see anything you've done. However are you using a windows machine? If so can you edit it's host file (c:\windows\system32\drivers\etc\hosts) and add the following entries;

101.168.1.25  www.solutionsbeyond.local
101.168.1.25  forum.solutionsbeyond.local
101.168.1.25  forum2.solutionsbeyond.local

Apache will pick whatever index page is setup in the default document listing, unless there isn't one specified or the containers are not setup correctly, in which you'll get the default global index page.

By adding the entries to your pc's hosts file, you'll be able to go directly to the sites to see if the issues is just with resolving to the sites or if apache isn't configured correctly.

Keith D Mitchell, Server Engineer, Hostmysite.com
0
 
LVL 1

Expert Comment

by:esalvador
ID: 24296995
Did you restart apache after doing the changes? (service httpd restart)
Did you change your DNS records to point to that IP address, or did you do it in your local computer hosts file?
I noticed that in:
<VirtualHost *:80>
ServerAdmin  admin@solutionsbeyond.local
DocumentRoot  /home/httpd/test
ServerName forum.solutionsbeyond.local
</VirtualHost>

There is no:
DirectoryIndex index.php index.html index.htm

entry
0
 

Author Comment

by:serveradmin
ID: 24362764
esalvador i change the entry in the local computer hosts file.

101.168.1.25 forum.solutionsbeyond.local
101.168.1.25 forum2.solutionsbeyond.local
101.168.1.25 www.solutionsbeyond.local
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

This is an issue that we can get adding / removing permissions in the vCSA 6.0. We can also have issues searching for users / groups in the AD (using your identify sources). This is how one of the ways to handle this issues and fix it.
Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
Teach the user how to configure vSphere clusters to support the VMware FT feature Open vSphere Web Client: Verify vSphere HA is enabled: Verify netowrking for vMotion and FT Logging is in place or create it: Turn On FT for a virtual machine: Verify …
This Micro Tutorial walks you through using a remote console to access a server and install ESXi 5.1. This example is showing remote access and installation using a Dell server. The hypervisor is the very first component of your virtual infrastructu…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now