Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
03-20-2012, 03:51 PM #1
- Join Date
- Dec 2011
- Thanked 1 Time in 1 Post
Apache serves page fine on port 80, but will not with VirtualHost on port 81
I have a fedora server and Windows XP machine behind a router on my home network. I'm using this set up to learn to build a server.
I want to use Apache to run 2 servers. The first uses the main config file, httpd.conf, and runs on port 80. This server works fine. It servers up the index file just fine.
I want to use a <VirtualHost 192.168.0.2:81> directive for the second server, so I can have it listen on port 81. So far it has not worked. The error log I put in the Virtual Host did not show any errors as far as I could tell.
Both servers listen on 192.168.0.2 Port 81 is open in iptables The main server, httpd.conf port 80, responds to all requests for the index file listed in it's "DirectoryIndex" directive. The virtual host does not serve the file listed in it's "DirectoryIndex" File. The same file that is served on port 80 (httpd.conf) is not served on port 81 (virtualhost>. I can call the main server by domain name or ip. Both work I call the virtual host by 192.168.0.2:81 , because I have no ServerName Directive on this port.
User Apache Group Apache Listen 80 ServerName host.domain.com Use Canonical Name On DocumentRoot "/var/www/html" <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory "/var/www/html"> Options Indexes FollowSymLinks AllowOverride None Order allow, deny Allow from all </Directory> DirectoryIndex registration.html (this file served fine)
The Virtual Host
<VirtualHost 192.168.0.2:81> DocumentRoot /var/www/html (DocumentRoot in httpd.conf had quotes around it. I put them around this line as well. It didn't fix it.) DirectoryIndex registration.html (this same file not served when placed here) (This file is not served. This same file in httpd.conf directory index is served fine) </VirtualHost
Does anyone know what I'm missing? Thank you
UPDATE: Apache will not start when Listen directive in httpd.conf set to port 80.
Last edited by milesdriven; 03-20-2012 at 05:09 PM.