Sunday, April 24, 2011

Installing and configuring the Apache 2.2.x web server on FreeBSD




http://www.freebsdmadeeasy.com/tutorials/web-server/configure-apache-web-server-on-freebsd.php


Accessing Virtual Hosting without the Hostname

Since virtual hosts work strictly by the hostname they are not usable when you are behind a firewall or router and the machines behind it have local ips such as 192.168.0. Everytime you try to access the virtual host you will simply be taken to the router and given an error. To fix this we will need to open up more ports for Apache to listen on so that we can access the sites directly through these instead of virtual hosts. Since the machine is behind the firewall and getting ports getting a limited number of ports forwarded to it these will not be accessible to the outside world unless you have them forwarded to it.
Apache specifies which ports it listens on with the LISTEN lines in the httpd.conf file. The default is to only listen on 80, but we need it to listen on extra ports so more LISTEN lines need to be added. If we had 3 virtual hosts that we wanted to access by ports 6000, 6001, and 6002 the httpd.conf file would look like this



No comments:

Post a Comment