Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 1.90 KB | None | 0 0
  1. <VirtualHost *:80>
  2.         ServerAdmin admin@server.local
  3.         ServerName  server.local
  4.         ServerAlias *.server.local
  5.         DocumentRoot "/virtualhosts"
  6.         <Directory /virtualhosts>
  7.                 Options Indexes FollowSymLinks MultiViews
  8.                 AllowOverride All
  9.                 Order allow,deny
  10.                 allow from all
  11.         </Directory>
  12.  
  13.         RewriteEngine on
  14.         # Apache icons
  15.         RewriteRule ^/icons(.*) /usr/share/apache2/icons$1 [L]
  16.  
  17.         # Base directory, shouldn't be used by anything really
  18.         RewriteCond   %{HTTP_HOST}                 ^(www\.|)server\.local$
  19.         RewriteRule   ^(.+)                        %{HTTP_HOST}$1          [C]
  20.         RewriteRule   ^(www\.|)\.server\.local(.*) /virtualhosts/www/$2 [E=APPLICATION_ENVIRONMENT:development,L]
  21.  
  22.  
  23.         # If given one arg, assume development
  24.         RewriteCond   %{HTTP_HOST}                 ^[^.]+\.server\.local$
  25.         RewriteRule   ^(.+)                        %{HTTP_HOST}$1          [C]
  26.         RewriteRule   ^([^.]+)\.server\.local(.*) /virtualhosts/$1/www/$2 [E=APPLICATION_ENVIRONMENT:development,E=PROJECT:$1,L]
  27.  
  28.         # If given two args, use the given runlevel
  29.         RewriteCond   %{HTTP_HOST}                 ^[^.]+\.[^.]+\.server\.local$
  30.         RewriteRule   ^(.+)                        %{HTTP_HOST}$1          [C]
  31.         RewriteRule   ^(development|production)\.([^.]+)\.server\.local(.*) /virtualhosts/$2/www/$3 [E=APPLICATION_ENVIRONMENT:$1,E=PROJECT=$2,L]
  32.  
  33.         # Send the rest to an access forbidden page
  34.         RewriteRule . - [F,L]
  35.         ErrorDocument 403 "Access Forbidden"
  36.  
  37.         ErrorLog /virtualhosts/logs/error.log
  38.  
  39.         # Possible values include: debug, info, notice, warn, error, crit,
  40.         # alert, emerg.
  41.         LogLevel debug
  42.         RewriteEngine On
  43.         CustomLog /virtualhosts/logs/access.log combined
  44. </VirtualHost>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement