LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Httpd.conf (https://www.linuxquestions.org/questions/linux-general-1/httpd-conf-42366/)

smtoughill 01-21-2003 10:33 PM

Httpd.conf
 
I am having problems setting up my server box. I can not get it to goto different index

i want www.mydomain.net to goto one index and info.mydomain.net to goto another how can i get the directives to do that

steven

crabboy 01-21-2003 11:05 PM

you need to setup virtual hosts in the httpd.conf file. There should be an example in the file provided by apache. It could look something like this:

Code:

<VirtualHost 10.0.0.199>
    ServerAdmin  dude@host.com
    DocumentRoot /home/dude/www/testpage
    ServerName test.host.com
</VirtualHost>

<VirtualHost 10.0.0.199>
    ServerAdmin  dude@host.com
    DocumentRoot /tmp/download
    ServerName download.host.com
</VirtualHost>

If you machine is not behind a firewall you may have to put your internet IP there.

smtoughill 01-27-2003 12:52 PM

Thats exactly what i have and no matter what it always goes to the www. it will not goto smt. or info.
also i get this message too.[root@south conf]# /etc/rc.d/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [Mon Jan 27 09:45:09 2003] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Mon Jan 27 09:45:09 2003] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Mon Jan 27 09:45:09 2003] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[ OK ]

nxny 01-27-2003 12:57 PM

Obviously there is a problem with your conf file.
Use
NameVirtualHost *
Restart httpd.

If that doesnt work, post your VirtualHosts settings.

smtoughill 01-28-2003 04:52 AM

yep that was it! when I came into work today I asked one of the linux guys and in about 1 min he found and corrected the problem. Man it's great when resources pull together. Thanx all now for the next step adding some content and the other web site.

cmfarley19 01-28-2003 05:33 AM

Give this a shot...
NamevirtualHost *

<VirtualHost *>
ServerAdmin dude@host.com
#This is the path to your server pages
DocumentRoot /home/dude/www/htdocs1
ServerName www.mydomain.net
</VirtualHost>

<VirtualHost *>
ServerAdmin dude@host.com
#This is the path to your server pages
DocumentRoot /home/dude/www/htdocs2
ServerName info.mydomain.net
</VirtualHost>


All times are GMT -5. The time now is 11:00 AM.