Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
794
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.46 KB | None | 0 0
  1. <VirtualHost *:443>
  2.  
  3. <VirtualHost *:80>
  4. # Admin email, Server Name (domain name), and any aliases
  5. ServerAdmin email@gmail.com
  6. ServerName domain.com
  7. ServerAlias www.domain.com
  8.  
  9. # Index file and Document Root (where the public files are located)
  10. DirectoryIndex index.html index.php
  11. DocumentRoot /var/www/html/domain.com/public_html
  12. Redirect permanent / https://www.domain.com
  13.  
  14. <Directory "/var/www/html/domain.com/public_html">
  15. Options FollowSymLinks
  16. AllowOverride All
  17. Order allow,deny
  18. Allow from all
  19. </Directory>
  20.  
  21. # Log file locations
  22. LogLevel warn
  23. #ErrorLog /var/www/html/domain.com/log/error.log
  24. #CustomLog /var/www/html/domain.com/log/access.log combined
  25. </VirtualHost>
  26.  
  27. <IfModule mod_ssl.c>
  28. <VirtualHost *:443>
  29. ServerAdmin email@gmail.com
  30. ServerName domain.com
  31. ServerAlias www.domain.com
  32.  
  33. DocumentRoot /var/www/html/domain.com/public_html
  34. <Directory "/var/www/html/domain.com/public_html">
  35. #Options Indexes FollowSymLinks MultiViews
  36. Options FollowSymLinks
  37. AllowOverride All
  38. Order allow,deny
  39. Allow from all
  40. </Directory>
  41.  
  42. ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  43. <Directory "/usr/lib/cgi-bin">
  44. AllowOverride None
  45. Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  46. Order allow,deny
  47. Allow from all
  48. </Directory>
  49.  
  50. ErrorLog ${APACHE_LOG_DIR}/error.log
  51.  
  52. # Possible values include: debug, info, notice, warn, error, crit,
  53. # alert, emerg.
  54. LogLevel warn
  55.  
  56. CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
  57.  
  58. Alias /doc/ "/usr/share/doc/"
  59. <Directory "/usr/share/doc/">
  60. Options Indexes MultiViews FollowSymLinks
  61. AllowOverride None
  62. Order deny,allow
  63. Deny from all
  64. Allow from 127.0.0.0/255.0.0.0 ::1/128
  65. </Directory>
  66.  
  67. # SSL Engine Switch:
  68. # Enable/Disable SSL for this virtual host.
  69. SSLEngine on
  70.  
  71. # A self-signed (snakeoil) certificate can be created by installing
  72. # the ssl-cert package. See
  73. # /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
  74. # If both key and certificate are stored in the same file, only the
  75. # SSLCertificateFile directive is needed.
  76. SSLCertificateFile /etc/apache2/ssl/www_domain_com/www_domain_com.crt
  77. SSLCertificateKeyFile /etc/apache2/ssl/www_domain_com/server.key
  78.  
  79. # Server Certificate Chain:
  80. # Point SSLCertificateChainFile at a file containing the
  81. # concatenation of PEM encoded CA certificates which form the
  82. # certificate chain for the server certificate. Alternatively
  83. # the referenced file can be the same as SSLCertificateFile
  84. # when the CA certificates are directly appended to the server
  85. # certificate for convinience.
  86. SSLCertificateChainFile /etc/apache2/ssl/www_domain_com/www_domain_com.ca-bundle
  87.  
  88. #...
  89.  
  90. </VirtualHost>
  91. </IfModule>
  92.  
  93. <VirtualHost *:80>
  94. # Admin email, Server Name (domain name), and any aliases
  95. ServerAdmin email@gmail.com
  96. ServerName domain2.com
  97. ServerAlias www.domain2.com
  98.  
  99. # Index file and Document Root (where the public files are located)
  100. DirectoryIndex index.php index.html
  101. DocumentRoot /var/www/html/domain2.com/public_html/public
  102. # Redirect permanent / https://www.domain2.com
  103.  
  104. # Log file locations
  105. LogLevel warn
  106. ErrorLog /var/www/html/domain2.com/log/error.log
  107. CustomLog /var/www/html/domain2.com/log/access.log combined
  108.  
  109. SetEnv CI_ENV production
  110. SetEnv CI_BASE_URL http://www.domain2.com/
  111.  
  112. <Directory "/var/www/html/domain2.com/public_html/public">
  113. AuthType Basic
  114. AuthName "Restricted Content"
  115. AuthUserFile /var/www/html/domain2.com/public_html/public/.htpasswd
  116. Require valid-user
  117.  
  118. Options Indexes FollowSymLinks MultiViews
  119. AllowOverride All
  120. Order allow,deny
  121. allow from all
  122. </Directory>
  123. </VirtualHost>
  124.  
  125. <IfModule mod_ssl.c>
  126. <VirtualHost *:443>
  127. ServerAdmin email@gmail.com
  128. ServerName domain2.com
  129. ServerAlias www.domain2.com
  130. DocumentRoot /var/www/html/domain2.com/public_html/public
  131.  
  132. <Directory "/var/www/html/domain2.com/public_html/public">
  133. #Options Indexes FollowSymLinks MultiViews
  134. Options FollowSymLinks
  135. AllowOverride All
  136. Order allow,deny
  137. Allow from all
  138. </Directory>
  139.  
  140. ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  141.  
  142. <Directory "/usr/lib/cgi-bin">
  143. AllowOverride None
  144. Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  145. Order allow,deny
  146. Allow from all
  147. </Directory>
  148.  
  149. ErrorLog ${APACHE_LOG_DIR}/error.log
  150.  
  151. # Possible values include: debug, info, notice, warn, error, crit,
  152. # alert, emerg.
  153. LogLevel warn
  154.  
  155. CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
  156. Alias /doc/ "/usr/share/doc/"
  157.  
  158. <Directory "/usr/share/doc/">
  159. Options Indexes MultiViews FollowSymLinks
  160. AllowOverride None
  161. Order deny,allow
  162. Deny from all
  163. Allow from 127.0.0.0/255.0.0.0 ::1/128
  164. </Directory>
  165.  
  166. # SSL Engine Switch:
  167. # Enable/Disable SSL for this virtual host.
  168. SSLEngine on
  169.  
  170. # A self-signed (snakeoil) certificate can be created by installing
  171. # the ssl-cert package. See
  172. # /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
  173. # If both key and certificate are stored in the same file, only the
  174. # SSLCertificateFile directive is needed.
  175. SSLCertificateFile /etc/apache2/ssl/www_domain2_com/www_domain2_com.crt
  176. SSLCertificateKeyFile /etc/apache2/ssl/www_domain2_com/server.key
  177.  
  178. # Server Certificate Chain:
  179. # Point SSLCertificateChainFile at a file containing the
  180. # concatenation of PEM encoded CA certificates which form the
  181. # certificate chain for the server certificate. Alternatively
  182. # the referenced file can be the same as SSLCertificateFile
  183. # when the CA certificates are directly appended to the server
  184. # certificate for convinience.
  185. SSLCertificateChainFile /etc/apache2/ssl/www_domain2_com/www_domain2_com.ca-bundle
  186.  
  187. #...
  188.  
  189. </VirtualHost>
  190. </IfModule>
  191.  
  192. <VirtualHost *:80>
  193. ServerAdmin webmaster@localhost
  194. ServerName example.com
  195. DocumentRoot /var/www
  196.  
  197. </VirtualHost>
  198.  
  199.  
  200. <IfModule mod_ssl.c>
  201. <VirtualHost *:443>
  202.  
  203. ServerAdmin webmaster@localhost
  204. ServerName example.com
  205. DocumentRoot /var/www
  206.  
  207. # SSL Engine Switch:
  208. # Enable/Disable SSL for this virtual host.
  209. SSLEngine on
  210.  
  211. # A self-signed (snakeoil) certificate can be created by installing
  212. # the ssl-cert package. See
  213. # /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
  214. # If both key and certificate are stored in the same file, only the
  215. # SSLCertificateFile directive is needed.
  216. SSLCertificateFile /etc/apache2/ssl/example.com/apache.crt
  217. SSLCertificateKeyFile /etc/apache2/ssl/example.com/apache.key
  218. </VirtualHost>
  219.  
  220. </IfModule>
  221.  
  222. <Directory /var/www/html/example.com>
  223. AllowOverride All
  224. </Directory>
  225. ServerName example.com
  226.  
  227. /etc/apache2/sites-available/example.conf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement