Solved

landing on the same page for diffrent domains in apache virtualhosts

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Suggested Solutions

In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
This Micro Tutorial steps you through the configuration steps to configure your ESXi host Management Network settings and test the management network, ensure the host is recognized by the DNS Server, configure a new password, and the troubleshooting…
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…

911 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

21 Experts available now in Live!

Get 1:1 Help Now