Solved

landing on the same page for diffrent domains in apache virtualhosts

Posted on 2009-05-03
3
361 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

Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When converting a physical machine to a virtual machine using VMware vCenter Converter Standalone or vCenter Converter Enterprise, if an adapter type is not selected during the initial customization the resulting virtual machine may contain an IDE d…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Teach the user how to install log collectors and how to configure ESXi 5.5 for remote logging Open console session and mount vCenter Server installer: Install vSphere Core Dump Collector: Install vSphere Syslog Collector: Open vSphere Client: Config…
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…

763 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