NameVirtualHost * ServerAdmin webmaster@localhost # Add a servername. If you have a registered domain name, use it. # If not, use your machine's hostname. ServerName foo.com # 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 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)://(www.)?foo.com|localhost(:(80|443))?/)" local_ref=1 # Add file extension patterns to protect against hotlinking seperated by '|'. # Do not add spaces between patterns and '|'. Order allow,deny Allow from env=local_ref DocumentRoot /var/www Options FollowSymLinks AllowOverride None 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/ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all # Create a directory block for you uploads directory. this is assuming # you move /uploads to /var/www # 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 chgrp /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 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/" Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128