Advertisement
Guest User

Untitled

a guest
Nov 20th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.52 KB | None | 0 0
  1. <VirtualHost *:80>
  2. SuexecUserGroup "#1008" "#1008"
  3. ServerName drupal.domain.local
  4. ServerAlias www.drupal.domain.local
  5. ServerAlias webmail.drupal.domain.local
  6. ServerAlias admin.drupal.domain.local
  7. DocumentRoot /home/drupal/public_html
  8. ErrorLog /var/log/virtualmin/drupal.domain.local_error_log
  9. CustomLog /var/log/virtualmin/drupal.domain.local_access_log combined
  10. ScriptAlias /cgi-bin/ /home/drupal/cgi-bin/
  11. ScriptAlias /awstats/ /home/drupal/cgi-bin/
  12. DirectoryIndex index.html index.htm index.php index.php4 index.php5
  13. <Directory /home/drupal/public_html>
  14. Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
  15. allow from all
  16. AllowOverride All
  17. #Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
  18. Require all granted
  19. AddHandler fcgid-script .php
  20. AddHandler fcgid-script .php5
  21. FCGIWrapper /home/drupal/fcgi-bin/php5.fcgi .php
  22. FCGIWrapper /home/drupal/fcgi-bin/php5.fcgi .php5
  23. </Directory>
  24. <Directory /home/drupal/cgi-bin>
  25. allow from all
  26. AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
  27. </Directory>
  28. RewriteEngine on
  29. RewriteCond %{HTTP_HOST} =webmail.drupal.domain.local
  30. RewriteRule ^(.*) https://drupal.domain.local:20000/ [R]
  31. RewriteCond %{HTTP_HOST} =admin.drupal.domain.local
  32. RewriteRule ^(.*) https://drupal.domain.local:10000/ [R]
  33. RemoveHandler .php
  34. RemoveHandler .php5
  35. php_admin_value engine Off
  36. IPCCommTimeout 7200
  37. FcgidMaxRequestLen 2073741824
  38. <Files awstats.pl>
  39. AuthName "drupal.domain.local statistics"
  40. AuthType Basic
  41. AuthUserFile /home/drupal/.awstats-htpasswd
  42. require valid-user
  43. </Files>
  44. </VirtualHost>
  45. <VirtualHost *:443>
  46. SuexecUserGroup "#1008" "#1008"
  47. ServerName drupal.domain.local
  48. ServerAlias www.drupal.domain.local
  49. ServerAlias webmail.drupal.domain.local
  50. ServerAlias admin.drupal.domain.local
  51. DocumentRoot /home/drupal/public_html
  52. ErrorLog /var/log/virtualmin/drupal.domain.local_error_log
  53. CustomLog /var/log/virtualmin/drupal.domain.local_access_log combined
  54. ScriptAlias /cgi-bin/ /home/drupal/cgi-bin/
  55. ScriptAlias /awstats/ /home/drupal/cgi-bin/
  56. DirectoryIndex index.html index.htm index.php index.php4 index.php5
  57. <Directory /home/drupal/public_html>
  58. Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
  59. allow from all
  60. AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
  61. Require all granted
  62. AddHandler fcgid-script .php
  63. AddHandler fcgid-script .php5
  64. FCGIWrapper /home/drupal/fcgi-bin/php5.fcgi .php
  65. FCGIWrapper /home/drupal/fcgi-bin/php5.fcgi .php5
  66. </Directory>
  67. <Directory /home/drupal/cgi-bin>
  68. allow from all
  69. AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
  70. </Directory>
  71. RewriteEngine on
  72. RewriteCond %{HTTP_HOST} =webmail.drupal.domain.local
  73. RewriteRule ^(.*) https://drupal.domain.local:20000/ [R]
  74. RewriteCond %{HTTP_HOST} =admin.drupal.domain.local
  75. RewriteRule ^(.*) https://drupal.domain.local:10000/ [R]
  76. RemoveHandler .php
  77. RemoveHandler .php5
  78. php_admin_value engine Off
  79. IPCCommTimeout 31
  80. FcgidMaxRequestLen 1073741824
  81. SSLEngine on
  82. SSLCertificateFile /home/drupal/ssl.cert
  83. SSLCertificateKeyFile /home/drupal/ssl.key
  84. <Files awstats.pl>
  85. AuthName "drupal.domin.local statistics"
  86. AuthType Basic
  87. AuthUserFile /home/drupal/.awstats-htpasswd
  88. require valid-user
  89. </Files>
  90. </VirtualHost>
  91.  
  92. #
  93. # Apache/PHP/Drupal settings:
  94. #
  95. # Protect files and directories from prying eyes.
  96. <FilesMatch ".(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(.php)?|xtmpl)(~|.sw[op]|.bak|.orig|.save)?$|^(..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|.php(~|.sw[op]|.bak|.orig.save)$">
  97. Order allow,deny
  98. </FilesMatch>
  99.  
  100.  
  101. # Don't show directory listings for URLs which map to a directory.
  102. # Options -Indexes
  103.  
  104.  
  105. # Follow symbolic links in this directory.
  106. # Options +FollowSymLinks
  107.  
  108.  
  109. # Make Drupal handle any 404 errors.
  110. ErrorDocument 404 /index.php
  111.  
  112.  
  113. # Set the default handler.
  114. DirectoryIndex index.php index.html index.htm
  115.  
  116.  
  117. # Override PHP settings that cannot be changed at runtime. See
  118. # sites/default/default.settings.php and drupal_environment_initialize() in
  119. # includes/bootstrap.inc for settings that can be changed at runtime.
  120.  
  121.  
  122. # PHP 5, Apache 1 and 2.
  123. <IfModule mod_php5.c>
  124. php_flag magic_quotes_gpc off
  125. php_flag magic_quotes_sybase off
  126. php_flag register_globals off
  127. php_flag session.auto_start off
  128. php_value mbstring.http_input pass
  129. php_value mbstring.http_output pass
  130. php_flag mbstring.encoding_translation off
  131. </IfModule>
  132.  
  133.  
  134. # Requires mod_expires to be enabled.
  135. <IfModule mod_expires.c>
  136. # Enable expirations.
  137. ExpiresActive On
  138.  
  139.  
  140. # Cache all files for 2 weeks after access (A).
  141. ExpiresDefault A1209600
  142.  
  143.  
  144. <FilesMatch .php$>
  145. # Do not allow PHP scripts to be cached unless they explicitly send cache
  146. # headers themselves. Otherwise all scripts would have to overwrite the
  147. # headers set by mod_expires if they want another caching behavior. This may
  148. # fail if an error occurs early in the bootstrap process, and it may cause
  149. # problems if a non-Drupal PHP file is installed in a subdirectory.
  150. ExpiresActive Off
  151. </FilesMatch>
  152. </IfModule>
  153.  
  154.  
  155. # Various rewrite rules.
  156. <IfModule
  157.  
  158. mod_rewrite.c>
  159. RewriteEngine on
  160.  
  161.  
  162. # Set "protossl" to "s" if we were accessed via https://. This is used later
  163. # if you enable "www." stripping or enforcement, in order to ensure that
  164. # you don't bounce between http and https.
  165. RewriteRule ^ - [E=protossl]
  166. RewriteCond %{HTTPS} on
  167. RewriteRule ^ - [E=protossl:s]
  168.  
  169.  
  170. # Make sure Authorization HTTP header is available to PHP
  171. # even when running as CGI or FastCGI.
  172. RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  173.  
  174.  
  175. # Block access to "hidden" directories whose names begin with a period. This
  176. # includes directories used by version control systems such as Subversion or
  177. # Git to store control files. Files whose names begin with a period, as well
  178. # as the control files used by CVS, are protected by the FilesMatch directive
  179. # above.
  180. #
  181. # NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is
  182. # not possible to block access to entire directories from .htaccess, because
  183. # <DirectoryMatch> is not allowed here.
  184. #
  185. # If you do not have mod_rewrite installed, you should remove these
  186. # directories from your webroot or otherwise protect them from being
  187. # downloaded.
  188. RewriteRule "(^|/)." - [F]
  189.  
  190.  
  191. # If your site can be accessed both with and without the 'www.' prefix, you
  192. # can use one of the following settings to redirect users to your preferred
  193. # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  194. #
  195. # To redirect all users to access the site WITH the 'www.' prefix,
  196. # (http://example.com/... will be redirected to http://www.example.com/...)
  197. # uncomment the following:
  198. # RewriteCond %{HTTP_HOST} .
  199. # RewriteCond %{HTTP_HOST} !^www. [NC]
  200. # RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  201. #
  202. # To redirect all users to access the site WITHOUT the 'www.' prefix,
  203. # (http://www.example.com/... will be redirected to http://example.com/...)
  204. # uncomment the following:
  205. # RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
  206. # RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]
  207.  
  208.  
  209. # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  210. # VirtualDocumentRoot and the rewrite rules are not working properly.
  211. # For example if your site is at http://example.com/drupal uncomment and
  212. # modify the following line:
  213. # RewriteBase /drupal
  214. #
  215. # If your site is running in a VirtualDocumentRoot at http://example.com/,
  216. # uncomment the following line:
  217. RewriteBase /
  218.  
  219.  
  220. # Pass all requests not referring directly to files in the filesystem to
  221. # index.php. Clean URLs are handled in drupal_environment_initialize().
  222. RewriteCond %{REQUEST_FILENAME} !-f
  223. RewriteCond %{REQUEST_FILENAME} !-d
  224. RewriteCond %{REQUEST_URI} !=/favicon.ico
  225. RewriteRule ^ index.php [L]
  226.  
  227.  
  228. # Rules to correctly serve gzip compressed CSS and JS files.
  229. # Requires both mod_rewrite and mod_headers to be enabled.
  230. <IfModule mod_headers.c>
  231. # Serve gzip compressed CSS files if they exist and the client accepts gzip.
  232. RewriteCond %{HTTP:Accept-encoding} gzip
  233. RewriteCond %{REQUEST_FILENAME}.gz -s
  234. RewriteRule ^(.*).css $1.css.gz [QSA]
  235.  
  236.  
  237. # Serve gzip compressed JS files if they exist and the client accepts gzip.
  238. RewriteCond %{HTTP:Accept-encoding} gzip
  239. RewriteCond %{REQUEST_FILENAME}.gz -s
  240. RewriteRule ^(.*).js $1.js.gz [QSA]
  241.  
  242.  
  243. # Serve correct content types, and prevent mod_deflate double gzip.
  244. RewriteRule .css.gz$ - [T=text/css,E=no-gzip:1]
  245. RewriteRule .js.gz$ - [T=text/javascript,E=no-gzip:1]
  246.  
  247.  
  248. <FilesMatch "(.js.gz|.css.gz)$">
  249. # Serve correct encoding type.
  250. Header set Content-Encoding gzip
  251. # Force proxies to cache gzipped & non-gzipped css/js files separately.
  252. Header append Vary Accept-Encoding
  253. </FilesMatch>
  254. </IfModule>
  255. </IfModule>
  256.  
  257. <IfModule mod_userdir.c>
  258. UserDir public_html
  259. UserDir disabled root
  260. <Directory /home/*/public_html>
  261. AllowOverride All
  262. #AllowOverride FileInfo AuthConfig Limit Indexes
  263. Options Indexes
  264. #Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
  265. <Limit GET POST OPTIONS>
  266. Require all granted
  267. </Limit>
  268. <LimitExcept GET POST OPTIONS>
  269. Require all denied
  270. </LimitExcept>
  271. </Directory>
  272. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement