Failed Apache2 start, no error log

Syntax errors in the config file seem to cause problems. I found what the problem was by going to the directory and excuting this from the command line. httpd -e info This gave me the error Syntax error on line 156 of D:/…/Apache Software Foundation/Apache2.2/conf/httpd.conf: Invalid command ‘PHPIniDir’, perhaps misspelled or defined by a module … Read more

“OR” Flag in .htaccess mod_rewrite

From http://httpd.apache.org/docs/current/mod/mod_rewrite.html ornext|OR (or next condition) Use this to combine rule conditions with a local OR instead of the implicit AND. Typical example: RewriteCond %{REMOTE_HOST} ^host1 [OR] RewriteCond %{REMOTE_HOST} ^host2 [OR] RewriteCond %{REMOTE_HOST} ^host3 RewriteRule …some special stuff for any of these hosts…

Apache: Restrict access to specific source IP inside virtual host

For Apache 2.4, you would use the Require IP directive. So to only allow machines from the 192.168.0.0/24 network (range 192.168.0.0 – 192.168.0.255) <VirtualHost *:80> <Location /> Require ip 192.168.0.0/24 </Location> … </VirtualHost> And if you just want the localhost machine to have access, then there’s a special Require local directive. The local provider allows … Read more

Which one to use : Expire Header, Last Modified Header or ETags

Expires and Cache-Control are “strong caching headers” Last-Modified and ETag are “weak caching headers” First the browser checks Expires/Cache-Control to determine whether or not to make a request to the servers. If it has to make a request, it will send Last-Modified/ETag in the HTTP request. If the Etag value of the document matches that, … Read more