Litmus:InstallFAQ:example apache config

From MozillaWiki
Jump to: navigation, search
NameVirtualHost *:443
NameVirtualHost *:80

<VirtualHost *:80>
  ServerName litmus.mozilla.org
  DocumentRoot /opt/webtools/litmus
  AddDefaultCharset UTF-8

  RewriteEngine On
  RewriteCond %{SERVER_PORT} !^443$
  RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R]

</VirtualHost>

<VirtualHost *:443>
  ServerName litmus.mozilla.org
  DocumentRoot /opt/webtools/litmus
  AddDefaultCharset UTF-8

  ErrorLog logs/ssl_error_log
  TransferLog logs/ssl_access_log
  LogLevel warn

  SSLEngine on
  SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
  SSLCertificateFile /etc/httpd/conf/ssl/litmus.crt
  SSLCertificateKeyFile /etc/httpd/conf/ssl/litmus.key

  SetEnvIf User-Agent ".*MSIE.*" \
           nokeepalive ssl-unclean-shutdown \
           downgrade-1.0 force-response-1.0

  <Location />
        AddHandler perl-script .cgi .pl
        PerlHandler ModPerl::Registry
  </Location>

  PerlModule Apache2::compat
  PerlOptions +GlobalRequest
  <Perl>
    use utf8;
    use Apache2::compat;
    use lib '/opt/webtools/litmus';
    use Apache::DBI;
    use CGI;
    CGI->compile(qw(header param cookie));
    use DBI;
    DBI->install_driver("mysql");
    use Template;
    use HTML::StripScripts;
    use Text::Markdown;
  </Perl>

  <Directory /opt/webtools/litmus>
    Options Indexes FollowSymLinks ExecCGI
    DirectoryIndex index.html index.cgi
    AllowOverride All
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript application/x-javascript application/javascript text/css
    ExpiresActive On
    ExpiresDefault Now
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType text/css "access plus 1 day"
    FileETag none
  </Directory>

  <Files ~ "\.(cgi|pl|shtml|phtml|php3?)$">
    SSLOptions +StdEnvVars
  </Files>

</VirtualHost>