Say I want to host different sites on different ports. The internal ip of the server is 192.168.1.108, the external ip is 188.8.131.52. And the ports 80, 81 and 82 of 184.108.40.206 have been forwarded by my router. Now I want to host site80, site81 and site82 in port 80, 81 and 82 individually, so if enter 220.127.116.11:82 will go to the site82.
I tried this:
Listen 80 Listen 81 ... NameVirtualHost 18.104.22.168:80 NameVirtualHost 22.214.171.124:81 ... <VirtualHost 126.96.36.199:80> ServerName site80 DocumentRoot /home/yy/Sites/site80 </VirtualHost> <VirtualHost 188.8.131.52:8080> ServerName site81 DocumentRoot /home/yy/Sites/site81 </VirtualHost> ...
But it gives error:
*Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName [Wed Jun 27 16:10:25 2012] [warn] NameVirtualHost *:80 has no VirtualHosts apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName [Wed Jun 27 16:10:25 2012] [warn] NameVirtualHost *:80 has no VirtualHosts (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Action 'start' failed. The Apache error log may have more information.
My question is, based on the above schema, how to set up apache? Detailed example is much helpful. Thanks!