Difference between revisions of "Apache"
From John Freier
(Created page with ''''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 …') |
|||
Line 1: | Line 1: | ||
+ | '''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''' | '''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. | This will pass any http request along. It helps when you want to pass a connection to another server, example apache -> tomcat:8080. | ||
Line 6: | Line 16: | ||
ProxyPass / http://localhost:8080/ | ProxyPass / http://localhost:8080/ | ||
ProxyPassReverse / http://localhost:8080/ | ProxyPassReverse / http://localhost:8080/ | ||
− | ServerName www. | + | ServerName www.{domainname}.com |
− | ServerAlias | + | ServerAlias {domainname}.com |
</VirtualHost> | </VirtualHost> |
Revision as of 14:12, 1 June 2011
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>