Advertisement
Guest User

Untitled

a guest
Sep 6th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.16 KB | None | 0 0
  1. root@WEB1:/etc/apache2/sites-available# ls -l
  2. total 32
  3. -rw-r--r-- 1 root root 1332 Jun 7 17:10 000-default.conf
  4. -rw-r--r-- 1 root root 6338 Aug 31 19:11 default-ssl.conf
  5. -rw-r--r-- 1 root root 985 Sep 6 13:56 dev.domain1.com.conf
  6. -rw-r--r-- 1 root root 1241 Sep 6 13:57 domain1.com.conf
  7. -rw-r--r-- 1 root root 1484 Sep 6 13:58 domain2.com.conf
  8. -rw-r--r-- 1 root root 92 Jul 5 15:55 domain2.com.htpasswd
  9. -rw-r--r-- 1 root root 1045 Sep 6 13:59 sub1.domain1.com.conf
  10.  
  11. root@WEB1:/etc/apache2/sites-enabled# ls -l
  12. total 4
  13. lrwxrwxrwx 1 root root 52 Sep 6 14:51 dev.domain1.com.conf -> ../sites-available/dev.domain1.com.conf
  14. lrwxrwxrwx 1 root root 58 Aug 31 19:28 domain1.com.conf -> /etc/apache2/sites-available/domain1.com.conf
  15. lrwxrwxrwx 1 root root 52 Aug 31 19:26 domain2.com.conf -> /etc/apache2/sites-available/domain2.com.conf
  16. lrwxrwxrwx 1 root root 69 Aug 31 21:19 sub1.domain1.com.conf -> /etc/apache2/sites-available/sub1.domain1.com.conf
  17.  
  18.  
  19.  
  20. root@WEB1:/etc/apache2/sites-available# cat *
  21. <VirtualHost *:80>
  22. # The ServerName directive sets the request scheme, hostname and port that
  23. # the server uses to identify itself. This is used when creating
  24. # redirection URLs. In the context of virtual hosts, the ServerName
  25. # specifies what hostname must appear in the request's Host: header to
  26. # match this virtual host. For the default virtual host (this file) this
  27. # value is not decisive as it is used as a last resort host regardless.
  28. # However, you must set it for any further virtual host explicitly.
  29. #ServerName www.example.com
  30.  
  31. ServerAdmin webmaster@localhost
  32. DocumentRoot /var/www/html
  33.  
  34. # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
  35. # error, crit, alert, emerg.
  36. # It is also possible to configure the loglevel for particular
  37. # modules, e.g.
  38. #LogLevel info ssl:warn
  39.  
  40. ErrorLog ${APACHE_LOG_DIR}/error.log
  41. CustomLog ${APACHE_LOG_DIR}/access.log combined
  42.  
  43. # For most configuration files from conf-available/, which are
  44. # enabled or disabled at a global level, it is possible to
  45. # include a line for only one particular virtual host. For example the
  46. # following line enables the CGI configuration for this host only
  47. # after it has been globally disabled with "a2disconf".
  48. #Include conf-available/serve-cgi-bin.conf
  49. </VirtualHost>
  50.  
  51. # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  52. <IfModule mod_ssl.c>
  53. <VirtualHost _default_:443>
  54. ServerAdmin webmaster@localhost
  55.  
  56. DocumentRoot /var/www/html
  57.  
  58. # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
  59. # error, crit, alert, emerg.
  60. # It is also possible to configure the loglevel for particular
  61. # modules, e.g.
  62. #LogLevel info ssl:warn
  63.  
  64. ErrorLog ${APACHE_LOG_DIR}/error.log
  65. CustomLog ${APACHE_LOG_DIR}/access.log combined
  66.  
  67. # For most configuration files from conf-available/, which are
  68. # enabled or disabled at a global level, it is possible to
  69. # include a line for only one particular virtual host. For example the
  70. # following line enables the CGI configuration for this host only
  71. # after it has been globally disabled with "a2disconf".
  72. #Include conf-available/serve-cgi-bin.conf
  73.  
  74. # SSL Engine Switch:
  75. # Enable/Disable SSL for this virtual host.
  76. SSLEngine on
  77.  
  78. # A self-signed (snakeoil) certificate can be created by installing
  79. # the ssl-cert package. See
  80. # /usr/share/doc/apache2/README.Debian.gz for more info.
  81. # If both key and certificate are stored in the same file, only the
  82. # SSLCertificateFile directive is needed.
  83. SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
  84. SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
  85.  
  86. # Server Certificate Chain:
  87. # Point SSLCertificateChainFile at a file containing the
  88. # concatenation of PEM encoded CA certificates which form the
  89. # certificate chain for the server certificate. Alternatively
  90. # the referenced file can be the same as SSLCertificateFile
  91. # when the CA certificates are directly appended to the server
  92. # certificate for convinience.
  93. #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
  94.  
  95. # Certificate Authority (CA):
  96. # Set the CA certificate verification path where to find CA
  97. # certificates for client authentication or alternatively one
  98. # huge file containing all of them (file must be PEM encoded)
  99. # Note: Inside SSLCACertificatePath you need hash symlinks
  100. # to point to the certificate files. Use the provided
  101. # Makefile to update the hash symlinks after changes.
  102. #SSLCACertificatePath /etc/ssl/certs/
  103. #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
  104.  
  105. # Certificate Revocation Lists (CRL):
  106. # Set the CA revocation path where to find CA CRLs for client
  107. # authentication or alternatively one huge file containing all
  108. # of them (file must be PEM encoded)
  109. # Note: Inside SSLCARevocationPath you need hash symlinks
  110. # to point to the certificate files. Use the provided
  111. # Makefile to update the hash symlinks after changes.
  112. #SSLCARevocationPath /etc/apache2/ssl.crl/
  113. #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
  114.  
  115. # Client Authentication (Type):
  116. # Client certificate verification type and depth. Types are
  117. # none, optional, require and optional_no_ca. Depth is a
  118. # number which specifies how deeply to verify the certificate
  119. # issuer chain before deciding the certificate is not valid.
  120. #SSLVerifyClient require
  121. #SSLVerifyDepth 10
  122.  
  123. # SSL Engine Options:
  124. # Set various options for the SSL engine.
  125. # o FakeBasicAuth:
  126. # Translate the client X.509 into a Basic Authorisation. This means that
  127. # the standard Auth/DBMAuth methods can be used for access control. The
  128. # user name is the `one line' version of the client's X.509 certificate.
  129. # Note that no password is obtained from the user. Every entry in the user
  130. # file needs this password: `xxj31ZMTZzkVA'.
  131. # o ExportCertData:
  132. # This exports two additional environment variables: SSL_CLIENT_CERT and
  133. # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
  134. # server (always existing) and the client (only existing when client
  135. # authentication is used). This can be used to import the certificates
  136. # into CGI scripts.
  137. # o StdEnvVars:
  138. # This exports the standard SSL/TLS related `SSL_*' environment variables.
  139. # Per default this exportation is switched off for performance reasons,
  140. # because the extraction step is an expensive operation and is usually
  141. # useless for serving static content. So one usually enables the
  142. # exportation for CGI and SSI requests only.
  143. # o OptRenegotiate:
  144. # This enables optimized SSL connection renegotiation handling when SSL
  145. # directives are used in per-directory context.
  146. #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
  147. <FilesMatch "\.(cgi|shtml|phtml|php)$">
  148. SSLOptions +StdEnvVars
  149. </FilesMatch>
  150. <Directory /usr/lib/cgi-bin>
  151. SSLOptions +StdEnvVars
  152. </Directory>
  153.  
  154. # SSL Protocol Adjustments:
  155. # The safe and default but still SSL/TLS standard compliant shutdown
  156. # approach is that mod_ssl sends the close notify alert but doesn't wait for
  157. # the close notify alert from client. When you need a different shutdown
  158. # approach you can use one of the following variables:
  159. # o ssl-unclean-shutdown:
  160. # This forces an unclean shutdown when the connection is closed, i.e. no
  161. # SSL close notify alert is send or allowed to received. This violates
  162. # the SSL/TLS standard but is needed for some brain-dead browsers. Use
  163. # this when you receive I/O errors because of the standard approach where
  164. # mod_ssl sends the close notify alert.
  165. # o ssl-accurate-shutdown:
  166. # This forces an accurate shutdown when the connection is closed, i.e. a
  167. # SSL close notify alert is send and mod_ssl waits for the close notify
  168. # alert of the client. This is 100% SSL/TLS standard compliant, but in
  169. # practice often causes hanging connections with brain-dead browsers. Use
  170. # this only for browsers where you know that their SSL implementation
  171. # works correctly.
  172. # Notice: Most problems of broken clients are also related to the HTTP
  173. # keep-alive facility, so you usually additionally want to disable
  174. # keep-alive for those clients, too. Use variable "nokeepalive" for this.
  175. # Similarly, one has to force some clients to use HTTP/1.0 to workaround
  176. # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
  177. # "force-response-1.0" for this.
  178. # BrowserMatch "MSIE [2-6]" \
  179. # nokeepalive ssl-unclean-shutdown \
  180. # downgrade-1.0 force-response-1.0
  181.  
  182. </VirtualHost>
  183. </IfModule>
  184.  
  185. # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  186. <VirtualHost *:80>
  187. ServerName dev.domain1.com
  188. ServerAdmin system@domain1.com
  189. DocumentRoot "/var/www/vhosts/dev.domain1.com/htdocs"
  190. <Directory "/var/www/vhosts/dev.domain1.com/htdocs">
  191. Options -Indexes +FollowSymLinks
  192. AllowOverride All
  193. </Directory>
  194. </VirtualHost>
  195.  
  196. <VirtualHost *:443>
  197. ServerName dev.domain1.com
  198. ServerAdmin system@domain1.com
  199. DocumentRoot "/var/www/vhosts/dev.domain1.com/htdocs"
  200. <Directory "/var/www/vhosts/dev.domain1.com/htdocs">
  201. Options -Indexes +FollowSymLinks
  202. AllowOverride All
  203. </Directory>
  204.  
  205. SSLEngine on
  206. ServerSignature Off
  207. SSLCertificateFile /etc/apache2/ssl/domain1.com.crt
  208. SSLCertificateKeyFile /etc/apache2/ssl/domain1.com.key
  209. SSLCertificateChainFile /etc/apache2/ssl/domain1.com-intermediate.crt
  210. </VirtualHost>
  211. <VirtualHost *:80>
  212. ServerName domain1.com
  213. ServerAlias www.domain1.com, login.domain1.com
  214. ServerAdmin system@domain1.com
  215. DocumentRoot "/var/www/vhosts/domain1.com/htdocs"
  216. <Directory "/var/www/vhosts/domain1.com/htdocs">
  217. Options -Indexes +FollowSymLinks
  218. AllowOverride All
  219. Require all granted
  220. </Directory>
  221. </VirtualHost>
  222.  
  223.  
  224. <VirtualHost *:443>
  225. ServerName domain1.com
  226. ServerAlias www.domain1.com, login.domain1.com
  227. ServerAdmin system@domain1.com
  228. DocumentRoot "/var/www/vhosts/domain1.com/htdocs"
  229. <Directory "/var/www/vhosts/domain1.com/htdocs">
  230. Options -Indexes +FollowSymLinks
  231. AllowOverride All
  232. Require all granted
  233. </Directory>
  234. SSLEngine on
  235. ServerSignature Off
  236. SSLCertificateFile /etc/apache2/ssl/domain1.com.crt
  237. SSLCertificateKeyFile /etc/apache2/ssl/domain1.com.key
  238. SSLCertificateChainFile /etc/apache2/ssl/domain1.com-intermediate.crt
  239. </VirtualHost>
  240.  
  241. # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  242. <VirtualHost *:80>
  243. ServerName domain2.com
  244. ServerAlias www.domain2.com, login.domain2.com
  245. ServerAdmin system@domain1.com
  246. DocumentRoot "/var/www/vhosts/domain2.com/htdocs"
  247. <Directory "/var/www/vhosts/domain2.com/htdocs">
  248. Options -Indexes +FollowSymLinks
  249. AllowOverride All
  250. AuthType Basic
  251. AuthName "Authentication Required"
  252. AuthUserFile "/etc/apache2/sites-available/domain2.com.htpasswd"
  253. Require valid-user
  254. </Directory>
  255.  
  256. </VirtualHost>
  257.  
  258. <VirtualHost _default_:443>
  259. ServerName domain2.com
  260. ServerAlias www.domain2.com #login.domain2.com
  261. ServerAdmin system@domain1.com
  262. DocumentRoot "/var/www/vhosts/domain2.com/htdocs"
  263. <Directory "/var/www/vhosts/domain2.com/htdocs">
  264. Options -Indexes +FollowSymLinks
  265. AllowOverride All
  266. AuthType Basic
  267. AuthName "Authentication Required"
  268. AuthUserFile "/etc/apache2/sites-available/domain2.com.htpasswd"
  269. Require valid-user
  270. </Directory>
  271.  
  272. SSLEngine on
  273. SSLCertificateFile /etc/apache2/ssl/domain2.com.crt
  274. SSLCertificateKeyFile /etc/apache2/ssl/domain2.com.key
  275. SSLCertificateChainFile /etc/apache2/ssl/domain2.com-intermediate.crt
  276.  
  277. <FilesMatch "\.(cgi|shtml|phtml|php)$">
  278. SSLOptions +StdEnvVars
  279. </FilesMatch>
  280. </VirtualHost>
  281.  
  282. <VirtualHost *:80>
  283. ServerName sub1.domain1.com
  284. ServerAdmin system@domain1.com
  285. DocumentRoot "/var/www/vhosts/sub1.domain1.com"
  286. <Directory "/var/www/vhosts/sub1.domain1.com">
  287. Options -Indexes +FollowSymLinks
  288. AllowOverride All
  289. </Directory>
  290. </VirtualHost>
  291.  
  292. <VirtualHost *:443>
  293. ServerName sub1.domain1.com
  294. ServerAdmin system@domain1.com
  295. DocumentRoot "/var/www/vhosts/sub1.domain1.com"
  296. <Directory "/var/www/vhosts/sub1.domain1.com">
  297. Options -Indexes +FollowSymLinks
  298. AllowOverride All
  299. </Directory>
  300.  
  301. SSLEngine on
  302. ServerSignature Off
  303. SSLCertificateFile /etc/apache2/ssl/domain1.com.crt
  304. SSLCertificateKeyFile /etc/apache2/ssl/domain1.com.key
  305. SSLCertificateChainFile /etc/apache2/ssl/domain1.com-intermediate.crt
  306. </VirtualHost>
  307.  
  308. # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement