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 behing proxy server it shows IP of 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 command

Now create file

Add

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

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

htpasswd apachectl Apache SSL Apache PHP-FPM Run .htm files as PHP in Apache Apache Disable PHP for a web site Apache Benchmark Ubuntu Apache Setup for WordPress Apache Limit access to a url Nginx vs Apache Apache Performance Tuning Apache LogFormat show full domain name Change Apache User in Ubuntu Apache disable directory index Apache […]

Read More…

htaccess

Redirect OLD site to NEW using htaccess Limit Access Using htaccess Apache Limit access to a url Disable PHP on a folder How to protect .git folder using htaccess Redirect site from www to non-www Password Protect Site using htaccess Redirect domain to SSL (HTTPS)

Or

Redirect a Page to another

You […]

Read More…