Skip to content

Instantly share code, notes, and snippets.

@Hypro999
Last active January 16, 2020 09:28
Show Gist options
  • Save Hypro999/a653e5a392b72e809ad2bef3bee5da8c to your computer and use it in GitHub Desktop.
Save Hypro999/a653e5a392b72e809ad2bef3bee5da8c to your computer and use it in GitHub Desktop.
A sample virutalhost configuration file in Apache2.
<VirtualHost 127.0.1.2:80>
ServerName testme.net
ServerAlias www.testme.net
DocumentRoot /home/hemanth/Code/PHP/testme.net
ErrorLog /home/hemanth/Code/PHP/testme.net/logs/error.log
<Directory "/home/hemanth/Code/PHP/testme.net">
Require all granted
</Directory>
<Directory "/home/hemanth/Code/PHP/testme.net/logs">
Require all denied
</Directory>
<Directory "/home/hemanth/Code/PHP/testme.net/scripts">
Require all denied
</Directory>
# Don't let attackers/users know that this folder even exists.
RedirectMatch 404 /scripts(/|$)
<Directory "/home/hemanth/Code/PHP/testme.net/notes">
Options Indexes
Require all granted
</Directory>
<Directory "/home/hemanth/Code/PHP/testme.net/lib">
Require all denied
</Directory>
# Don't let attackers/users know that this folder even exists.
RedirectMatch 404 /lib(/|$)
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment