NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost
# Add a servername. If you have a registered domain name, use it.
# If not, use your machine's hostname or IP address.
ServerName 72.38.xxx.116
# Set a server alias for www. www.foo.com needs to be in DNS.
# Contact your registrar for adding a CNAME entry or an A entry for
# www.foo.com. Uncomment the line below when you get a domain name.
#ServerAlias www.foo.com
# Set the files match and setenv to disable hotlinking for the
# average joe schmoe.
# The regex for your referer value should match your ServerName and ServerAlias
# values. Add localhost for local testing.
SetEnvIfNoCase Referer "^((http|https)://(72.38.xxx.116|192.168.0.176|localhost)(:(80|443))?/)" local_ref=1
# Add file extension patterns to protect against hotlinking seperated by '|'.
# Do not add spaces between patterns and '|'.
<FilesMatch "\.(jpg|jpeg|bmp|png|tiff|gif|ico|ipb|pdf|jpg|jpeg|djvu|zip|rar|tar|)$">
Order allow,deny
Allow from env=local_ref
</FilesMatch>
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# Uncomment this directive is you want to see apache2's
# default start page (in /apache2-default) when you go to /
#RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
# Create a directory block for you uploads directory. this is assuming
# you move /uploads to /var/www
<Directory /var/www/forums/uploads>
# Set php directives.
# In case you have uploads disabled by default.
php_admin_flag file_uploads 1
# Set the Max file size for upload. Change the value to suit your needs.
# Default in php.ini should be 2M (2 Megabytes).
php_admin_flag upload_max_filesize 8M
# Allowed options for this directory. This setting could be
# redundant and unecessary if you want to try changing this directory's
# permissions and owner. For example:
# You can chmod /var/www/upload to 700 and chown /var/www/upload to www-data
# and since php should run as the user apache is running as,
# your php script should be able to write to the directory, but everyone
# else will not be able to access the directory whatsoever.
# But if you want to go simple just chmod 777 /var/www/upload and
# forget about the above method.
Options -FollowSymLinks -Indexes
AllowOverride None
Order deny,allow
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>