Solved

landing on the same page for diffrent domains in apache virtualhosts

Posted on 2009-05-03
3
364 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

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…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Teach the user how to use create log bundles for vCenter Server or ESXi hosts Open vSphere Web Client: Generate vCenter Server and ESXi host log bundle:  Open vCenter Server Appliance Web Management interface and generate log bundle: Open vCenter Se…
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…

624 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