Advertisement
Mr_media

vhost setting ssl

Nov 18th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.24 KB | None | 0 0
  1. in apache2 sites enabled:
  2.  
  3. root@myserver:~# ls -al /etc/apache2/sites-enabled
  4. totaal 20
  5. drwxr-xr-x 2 root root 4096 nov 16 13:18 .
  6. drwxr-xr-x 8 root root 4096 nov 16 16:40 ..
  7. -rw-r--r-- 1 root root 967 nov 16 13:18 443-MenesMooiste-vhost.conf
  8. -rw-r--r-- 1 root root 481 nov 15 11:05 MenesMooiste-vhost.conf
  9. -rw-r--r-- 1 root root 1237 nov 15 11:08 MenesServer-default.conf
  10.  
  11. in the MenesServer-default.conf file I have:
  12.  
  13. <VirtualHost *:80>
  14. ServerAdmin webmaster@localhost
  15.  
  16. DocumentRoot /var/www/
  17. <Directory />
  18. Options +FollowSymLinks +MultiViews
  19. AllowOverride all
  20. </Directory>
  21. <Directory /var/www/>
  22. Options +Indexes +FollowSymLinks +MultiViews
  23. AllowOverride all
  24. #Order allow,deny
  25. #allow from all
  26. Require all granted
  27. </Directory>
  28.  
  29. #### error-log instellingen
  30.  
  31. ErrorLog /var/log/apache2/error.log
  32. # Possible values include: debug, info, notice, warn, error, crit,
  33. # alert, emerg.
  34. LogLevel warn
  35. CustomLog /var/log/apache2/access.log combined
  36. ServerSignature On
  37. Alias /doc/ "/usr/share/doc/"
  38. <Directory "/usr/share/doc/">
  39. Options +Indexes +MultiViews +FollowSymLinks
  40. AllowOverride all
  41. Order deny,allow
  42. Deny from all
  43. Allow from 127.0.0.0/255.0.0.0 ::1/128
  44. </Directory>
  45. </VirtualHost>
  46.  
  47. in the MenesMooiste-vhost.conf I have:
  48.  
  49. <VirtualHost *:80>
  50. DocumentRoot "/var/www/www.menesmooiste.nl/www/html"
  51. ServerName www.menesmooiste.nl
  52. ServerAlias menesmooiste.nl www.menesmooiste.nl
  53. <Directory "/var/www/www.menesmooiste.nl/www/html">
  54. Options -Indexes +FollowSymLinks +MultiViews
  55. AllowOverride all
  56. </Directory>
  57. </VirtualHost>
  58.  
  59. in the 443-MenesMooiste-vhost.conf I have:
  60.  
  61. <VirtualHost *:443>
  62. DocumentRoot "/var/www/www.menesmooiste.nl/www/html"
  63. ServerName www.menesmooiste.nl
  64. ServerAlias menesmooiste.nl www.menesmooiste.nl
  65. #instellingen voor ssl (secure toegang)
  66. SSLEngine on
  67. SSLCertificateFile /etc/letsencrypt/live/www.menesmooiste.nl/fullchain.pem
  68. SSLCertificateKeyFile /etc/letsencrypt/live/www.menesmooiste.nl/privkey.pem
  69. <Directory "/var/www/www.menesmooiste.nl/www/html">
  70. Options -Indexes +FollowSymLinks +MultiViews
  71. AllowOverride all
  72. </Directory>
  73. </VirtualHost>
  74.  
  75. The apache2/sites-available/default-ssl.conf the default one from the install nothing changed there
  76.  
  77. <IfModule mod_ssl.c>
  78. <VirtualHost _default_:443>
  79. ServerAdmin webmaster@localhost
  80.  
  81. DocumentRoot /var/www/html
  82.  
  83. # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
  84. # error, crit, alert, emerg.
  85. # It is also possible to configure the loglevel for particular
  86. # modules, e.g.
  87. #LogLevel info ssl:warn
  88.  
  89. ErrorLog ${APACHE_LOG_DIR}/error.log
  90. CustomLog ${APACHE_LOG_DIR}/access.log combined
  91.  
  92. # For most configuration files from conf-available/, which are
  93. # enabled or disabled at a global level, it is possible to
  94. # include a line for only one particular virtual host. For example the
  95. # following line enables the CGI configuration for this host only
  96. # after it has been globally disabled with "a2disconf".
  97. #Include conf-available/serve-cgi-bin.conf
  98.  
  99. # SSL Engine Switch:
  100. # Enable/Disable SSL for this virtual host.
  101. SSLEngine on
  102.  
  103. # A self-signed (snakeoil) certificate can be created by installing
  104. # the ssl-cert package. See
  105. # /usr/share/doc/apache2/README.Debian.gz for more info.
  106. # If both key and certificate are stored in the same file, only the
  107. # SSLCertificateFile directive is needed.
  108. SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
  109. SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
  110. # Server Certificate Chain:
  111. # Point SSLCertificateChainFile at a file containing the
  112. # concatenation of PEM encoded CA certificates which form the
  113. # after it has been globally disabled with "a2disconf".
  114. #Include conf-available/serve-cgi-bin.conf
  115.  
  116. # SSL Engine Switch:
  117. # Enable/Disable SSL for this virtual host.
  118. SSLEngine on
  119.  
  120. # A self-signed (snakeoil) certificate can be created by installing
  121. # the ssl-cert package. See
  122. # /usr/share/doc/apache2/README.Debian.gz for more info.
  123. # If both key and certificate are stored in the same file, only the
  124. # SSLCertificateFile directive is needed.
  125. SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
  126. SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
  127.  
  128. # Server Certificate Chain:
  129. # Point SSLCertificateChainFile at a file containing the
  130. # concatenation of PEM encoded CA certificates which form the
  131. # certificate chain for the server certificate. Alternatively
  132. # the referenced file can be the same as SSLCertificateFile
  133. # when the CA certificates are directly appended to the server
  134. # certificate for convinience.
  135. #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
  136.  
  137. # Certificate Authority (CA):
  138. # Set the CA certificate verification path where to find CA
  139. # certificates for client authentication or alternatively one
  140. # huge file containing all of them (file must be PEM encoded)
  141. # Note: Inside SSLCACertificatePath you need hash symlinks
  142. # to point to the certificate files. Use the provided
  143. # Makefile to update the hash symlinks after changes.
  144. #SSLCACertificatePath /etc/ssl/certs/
  145. #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
  146.  
  147. # Certificate Revocation Lists (CRL):
  148. # Set the CA revocation path where to find CA CRLs for client
  149. # authentication or alternatively one huge file containing all
  150. #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
  151. <FilesMatch "\.(cgi|shtml|phtml|php)$">
  152. SSLOptions +StdEnvVars
  153. </FilesMatch>
  154. <Directory /usr/lib/cgi-bin>
  155. SSLOptions +StdEnvVars
  156. </Directory>
  157.  
  158. # "force-response-1.0" for this.
  159. BrowserMatch "MSIE [2-6]" \
  160. nokeepalive ssl-unclean-shutdown \
  161. downgrade-1.0 force-response-1.0
  162. # MSIE 7 and newer should be able to use keepalive
  163. BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
  164.  
  165. </VirtualHost>
  166. </IfModule>
  167.  
  168. # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement