Difference between revisions of "Apache"
Jump to navigation
Jump to search
(Created page with '=Example Vhost Configurations= ==Generic http== <pre> <VirtualHost *:80> ServerName foo.com ServerAlias *.foo.com DocumentRoot "/www/files/foo" ErrorLog /www/…') |
m (→Generic SSL) |
||
Line 31: | Line 31: | ||
SSLCipherSuite SSLv3:+HIGH:+MEDIUM | SSLCipherSuite SSLv3:+HIGH:+MEDIUM | ||
#Network Solutions is where i get my ssl certs, they require chaining | #Network Solutions is where i get my ssl certs, they require chaining | ||
− | SSLCertificateFile /usr/local/apache2/ssl.certs/ | + | SSLCertificateFile /usr/local/apache2/ssl.certs/secure.foo.com.crt |
− | SSLCertificateChainFile /usr/local/apache2/ssl.certs/ | + | SSLCertificateChainFile /usr/local/apache2/ssl.certs/secure.foo.com.NetworkSolutions_CA.crt |
− | SSLCertificateKeyFile /usr/local/apache2/conf/ssl.certs/ | + | SSLCertificateKeyFile /usr/local/apache2/conf/ssl.certs/secure.foo.com.key |
<FilesMatch "\.(cgi|shtml|phtml|php3?)$"> | <FilesMatch "\.(cgi|shtml|phtml|php3?)$"> | ||
Line 48: | Line 48: | ||
</VirtualHost> | </VirtualHost> | ||
</pre> | </pre> | ||
+ | |||
=Redirects= | =Redirects= | ||
==http to https== | ==http to https== |
Revision as of 10:04, 14 April 2011
Example Vhost Configurations
Generic http
<VirtualHost *:80> ServerName foo.com ServerAlias *.foo.com DocumentRoot "/www/files/foo" ErrorLog /www/logs/foo.com.error_log CustomLog /www/logs/foo.com.access_log combined </VirtualHost>
Note, I usually put the following in httpd.conf to keep the individual virtualhosts un-cluttered, since all my sites have the parent same doc root:
ServerAdmin me@me.com <Directory "/www/files"> Options FollowSymLinks MultiViews Order allow,deny Allow from all </Directory>
Generic SSL
<VirtualHost 10.0.0.65:443> ServerName secure.foo.com DocumentRoot "/www/files/foo" ErrorLog /www/logs/secure.foo.com.error_log CustomLog /www/logs/secure.foo.com.access_log combined SSLEngine on SSLProtocol all -SSLv2 SSLCipherSuite SSLv3:+HIGH:+MEDIUM #Network Solutions is where i get my ssl certs, they require chaining SSLCertificateFile /usr/local/apache2/ssl.certs/secure.foo.com.crt SSLCertificateChainFile /usr/local/apache2/ssl.certs/secure.foo.com.NetworkSolutions_CA.crt SSLCertificateKeyFile /usr/local/apache2/conf/ssl.certs/secure.foo.com.key <FilesMatch "\.(cgi|shtml|phtml|php3?)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory "/www/files/foo"> SSLOptions +StdEnvVars Options FollowSymLinks MultiViews AllowOverride None Order allow,deny Allow from all </Directory> SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade </VirtualHost>
Redirects
http to https
<VirtualHost *:80> ServerName secure.foo.com RewriteEngine On RewriteRule (.*) https://my.cycletrader.com/$1 </VirtualHost>