Apache Benchmark

ab is a tool for benchmarking web servers. It is designed to give you an impression of how your web server installation performs. This especially shows you how many requests per second your web server is capable of serving. http://httpd.apache.org/docs/2.4/programs/ab.html To benchmark a web site, use ab command provided by Apache.

This will start […]

Read More…

Limit Access Using htaccess

To limit access to a folder using .htaccess, create .htacess file with following content.

YOUR_IP_HERE = Replace it with your actual IP. You can white list IP range by entering CIDR notation for the IP range. Here is .htacess i use on one of my web sites admin folder.

If your server is […]

Read More…

Show X-Forwarded-For IP in Apache

When apache is running behind the proxy server it shows the IP of the proxy server as visitor IP. To fix this, you need to enable Apache module remoteip. https://httpd.apache.org/docs/2.4/mod/mod_remoteip.html On Ubuntu/Debian, this can be enabled with the command

Now create file

Add

IP_OF_YOUR_PROXY_SERVER_HERE = repace with your proxy server. This can […]

Read More…

Run .htm files as PHP in Apache

On Ubuntu, to execute .htm files as PHP, create file

Add following content

This is similar code from your PHP configuration. In this case, it is from /etc/apache2/mods-available/php5.6.conf Now restart apache

Apache | PHP […]

Read More…

Apache Invalid command Header

On a new Debian server with Apache, web site give 500 internal server error. On checking error log, i found [Thu Jan 04 06:44:42.483932 2018] [core:alert] [pid 27583] [client 112.133.248.19:63020] /home/user/public_html/.htaccess: Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration The error is due to Apache headers module […]

Read More…

Apache Permission Denied

On a newly installed Apache server, when I visit the website, I get permission denied error. On Apache error log (/var/log/httpd/error_log), i found

I tried changing the folder permission to 755, but it did not fix it. The problem was caused by SELinux. Solution I disabled SELinux.

To make it permanent, edit file […]

Read More…