Site Tools


linux:ubuntu:apache2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:ubuntu:apache2 [2018/01/08 11:50] – created lunetikklinux:ubuntu:apache2 [2020/01/13 21:25] (current) lunetikk
Line 19: Line 19:
 <code> <code>
 apt-get install libapache2-mod-python apt-get install libapache2-mod-python
 +</code>
 +
 +PHP5
 +<code>
 +apt-get install php5 libapache2-mod-php5 php-pear php5-xcache
 </code> </code>
  
 PHP PHP
 <code> <code>
-apt-get install libapache2-mod-php5 php5 php-pear php5-xcache+apt-get install php libapache2-mod-php php-mcrypt php-mysql
 </code> </code>
  
Line 61: Line 66:
 </code> </code>
  
 +==== vHosts ====
  
-<code></code>+For SSL, add the follow to your vHost config
  
-==== vHosts ====+Redirect to %%https://%% - insert in virtualhost:80 
 +<code> 
 +        RewriteEngine   On 
 +        RewriteCond     %{HTTPS} !=on 
 +        RewriteRule     ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] 
 +</code>
  
 +Add virtualhost:433 with the same basic attributes as :80. Add the following
 +<code>
 +        SSLEngine On
 +        SSLCertificateFile /etc/letsencrypt/live/lunetikk.de/fullchain.pem
 +        SSLCertificateKeyFile /etc/letsencrypt/live/lunetikk.de/privkey.pem
 +        SSLCertificateChainFile /etc/letsencrypt/live/lunetikk.de/fullchain.pem
  
 +        #SSLProtocol TLSv1.2
 +        SSLProtocol All -SSLv2 -SSLv3 -TLSv1
 +
 +<Location />
 +        SSLRequireSSL On
 +        SSLVerifyClient optional
 +        SSLVerifyDepth 1
 +        SSLOptions +StdEnvVars +StrictRequire
 +</Location>
 +</code>
  
 Enable Site Enable Site
Line 73: Line 100:
 Disable Site Disable Site
 <code>a2dissite lunetikk.de.conf</code> <code>a2dissite lunetikk.de.conf</code>
 +
 +=== vHost example ===
 +
 +<code>
 +<VirtualHost *:80>
 +        # The ServerName directive sets the request scheme, hostname and port that
 +        # the server uses to identify itself. This is used when creating
 +        # redirection URLs. In the context of virtual hosts, the ServerName
 +        # specifies what hostname must appear in the request's Host: header to
 +        # match this virtual host. For the default virtual host (this file) this
 +        # value is not decisive as it is used as a last resort host regardless.
 +        # However, you must set it for any further virtual host explicitly.
 +        #ServerName www.example.com
 +
 +        ServerAdmin [email protected]
 +        ServerName lunetikk.de
 +        ServerAlias www.lunetikk.de lunetikk.de
 +        ServerPath /
 +
 +        DocumentRoot /var/www/lunetikk
 +
 +        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
 +        # error, crit, alert, emerg.
 +        # It is also possible to configure the loglevel for particular
 +        # modules, e.g.
 +        #LogLevel info ssl:warn
 +
 +        ErrorLog ${APACHE_LOG_DIR}/lunetikk.de_error.log
 +        CustomLog ${APACHE_LOG_DIR}/lunetikk.de_access.log combined
 +
 +        # For most configuration files from conf-available/, which are
 +        # enabled or disabled at a global level, it is possible to
 +        # include a line for only one particular virtual host. For example the
 +        # following line enables the CGI configuration for this host only
 +        # after it has been globally disabled with "a2disconf".
 +        #Include conf-available/serve-cgi-bin.conf
 +
 +        RewriteEngine   On
 +        RewriteCond     %{HTTPS} !=on
 +        RewriteRule     ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
 +
 +
 +<Location />
 +</Location>
 +
 +<Directory />
 +        Options FollowSymLinks
 +        AllowOverride none
 +        Require all granted
 +        DirectoryIndex index.html
 +</Directory>
 +
 +</VirtualHost>
 +
 +<VirtualHost *:443>
 +        ServerAdmin [email protected]
 +        ServerName lunetikk.de
 +        ServerAlias www.lunetikk.de lunetikk.de
 +
 +        ServerPath /
 +        DocumentRoot /var/www/lunetikk
 +
 +        ErrorLog ${APACHE_LOG_DIR}/lunetikk.de_error_ssl.log
 +        CustomLog ${APACHE_LOG_DIR}/lunetikk.de_access_ssl.log combined
 +
 +
 +<Directory />
 +        Options FollowSymLinks Indexes Includes ExecCGI
 +        AllowOverride none
 +        Require all granted
 +        DirectoryIndex index.html
 +</Directory>
 +
 +        SSLEngine On
 +        SSLCertificateFile /etc/letsencrypt/live/lunetikk.de/fullchain.pem
 +        SSLCertificateKeyFile /etc/letsencrypt/live/lunetikk.de/privkey.pem
 +        SSLCertificateChainFile /etc/letsencrypt/live/lunetikk.de/fullchain.pem
 +
 +        #SSLProtocol TLSv1.2
 +        SSLProtocol All -SSLv2 -SSLv3 -TLSv1
 +
 +<Location />
 +        SSLRequireSSL On
 +        SSLVerifyClient optional
 +        SSLVerifyDepth 1
 +        SSLOptions +StdEnvVars +StrictRequire
 +</Location>
 +
 +</VirtualHost>
 +</code>
linux/ubuntu/apache2.1515408608.txt.gz · Last modified: 2018/01/08 11:50 by lunetikk