Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Configuring multiple websites |
|
Author |
|
Matternor
Joined: 29 May 2006 Posts: 19 Location: Chicago
|
Posted: Sat 10 Jun '06 6:13 Post subject: Configuring multiple websites |
|
|
After *finally* getting Apache up and running on the machine that I want, I decided to try my hand at creating multiple websites (i.e. creating virtual hosts). After reading the manual, I have httpd.conf configured so that my server will respond to the different sites.
What my question is is what do I need to configure so that if someone accesses website A they will get website A's homepage; but if they access website B, they will get website B's homepage? I have the documentRoot directives set to each sites respective folder; "c:/program files/apache group/apache2/htdocs/A" for website A, and "c:/program files/apache group/apache2/htdocs/B" for website B.
So far all that I am accessing is the default page that I set with directoryindex.
p.s. I want to thank everyone for the great help so far. Its great to be able to log onto my website at work knowing that I have the server at home. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Sat 10 Jun '06 10:09 Post subject: |
|
|
you have to configure that in the vhost containers.
Code: |
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "c:/program files/apache group/apache2/htdocs/A"
ServerName www.example.com
# Other directives here
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/program files/apache group/apache2/htdocs/B"
ServerName www.example.org
# Other directives here
</VirtualHost>
|
|
|
Back to top |
|
Matternor
Joined: 29 May 2006 Posts: 19 Location: Chicago
|
Posted: Sat 10 Jun '06 22:04 Post subject: |
|
|
Thanks, its like I thought. What I did was configure the virtual host containers the way that I wanted them, but I wasn't accessing the pages that I wanted to access.
The reason for that I found out is that the directory index directive becomes global once I set up virtual hosts. So while everytime I tried to access a site, I was getting the global default page since Apache couldn't find anything in the virtual containers that matched what the directory index index said to look for. The solution I did was to name the default pages for each site index.html in their respective htdocs folder.
Another Problem solved. |
|
Back to top |
|
|
|
|
|
|