Skip to content

Instantly share code, notes, and snippets.

@uchm4n
Last active January 4, 2018 14:32
Show Gist options
  • Select an option

  • Save uchm4n/2f4d6716e0b7db65dbed6c6c4d0f08f2 to your computer and use it in GitHub Desktop.

Select an option

Save uchm4n/2f4d6716e0b7db65dbed6c6c4d0f08f2 to your computer and use it in GitHub Desktop.
## Make /www directory
## Edith apache.conf
<Directory />
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Allow from all
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
###################
### Virtual Hosts ###
<VirtualHost *:80>
ServerName localhost
DocumentRoot /www/
</VirtualHost>
<VirtualHost *:80>
ServerName scrotis.test
DocumentRoot /www/scrotis
ErrorLog ${APACHE_LOG_DIR}/scrotis.test_error.log
CustomLog ${APACHE_LOG_DIR}/scrotis.test_access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerName phadmin.test
DocumentRoot /www/phadmin/
<IfModule mod_rewrite.c>
<Directory "/www/phadmin">
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule ((?s).*) public/$1 [L]
</Directory>
<Directory "/www/phadmin/public">
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L]
</Directory>
</IfModule>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
ErrorLog ${APACHE_LOG_DIR}/phadmin.test_error.log
CustomLog ${APACHE_LOG_DIR}/phadmin.test_access.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment