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: Apache only recognize one domain... |
|
Author |
|
javier_ns
Joined: 01 Apr 2012 Posts: 1 Location: Colombia
|
Posted: Sat 14 Apr '12 5:54 Post subject: Apache only recognize one domain... |
|
|
Hi.!! I had created some webpages for a couple of friends, and I decided to get a dedicated (A fortatrust promotion $10) so I can manage them myself..
The server came with CentOS 6, apache and Mysql preinstalled, so I just had to install webmin, the ftp users, and the virtualhost as follow:
NameVirtualHost 190.130.XXX.XXX
<VirtualHost *>
DocumentRoot "/home/webpage1/web"
ServerName www.webpage1.com
ServerAlias *.webpage1.com
<Directory "/home/webpage1/web">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
<VirtualHost *>
DocumentRoot "/home/webpage2/htdocs"
ServerName www.webpage2.com
ServerAlias *.webpage2.com
<Directory "/home/ webpage2/htdocs">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
<VirtualHost *>
DocumentRoot "/home/webpage3/web"
ServerName www.webpage3.com
ServerAlias *.webpage3.com
<Directory "/home/webpage3/web">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
After that, I restart the apache.. then, in Godaddy, I forwarded the domains to my server IP, but It doesnt matter wich of the 3 web addresses I type, it always take me to the webpage1, so I got a couple of questions:
Do I need to set up something more, for apache to handle the virtualhosts..?
Ist better to forward the domains or to redirect to a NS address..?
In order to create a NS address in my server, I need to install BIND or it can be done in other way?
Thanks in advance for all your help..!! |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Sat 14 Apr '12 20:37 Post subject: |
|
|
Try:
NameVirtualHost *
And also you have to define as first a so called default vhost:
<VirtualHost *>
ServerName Default (what ever)
DocumentRoot C:/Apache2x/htdocs (what ever and put there a HTML page)
</VirtualHost>
...
...
<VirtualHost *>
...
...
It will be the one to answer anything pointing to your IP that does not match any configured ServerName on the server.
Steffen |
|
Back to top |
|
|
|
|
|
|