Apache

From John Freier
Revision as of 15:12, 1 June 2011 by Jfreier (Talk | contribs)

Jump to: navigation, search

Virtual Host This is how you setup apache for Virual Hosts. example if you have more domain names and only one server. The serverAlias is used in case people don't put in the "www" before the URL.

<VirtualHost *:80>
        DocumentRoot /home/{user}/public_html
        ServerName www.{domainname}.com
        ServerAlias {domainname}.com
</VirtualHost>


Virtual Host ProxyPass This will pass any http request along. It helps when you want to pass a connection to another server, example apache -> tomcat:8080.

<VirtualHost *:80>
        ProxyPreserveHost On
        ProxyPass / http://localhost:8080/
        ProxyPassReverse / http://localhost:8080/
        ServerName www.{domainname}.com
        ServerAlias {domainname}.com
</VirtualHost>