Apache Invalid command AuthGroupFile

On Plesk server, i get following error on error_log for a site

This is because authz_groupfile apache module was not loaded. To load this, run

To verify the module is loaded, run

[…]

Read More…

Apache Limit access to a url

I want to limit access to admin login url of a web application to specified IP address. The web site had admin login in following URL https://domain.com/login To limit IP address, i edited Apache VirtualHost configuration for this web site, added

Restart apache

Or

Now only IP listed on the Allow from […]

Read More…

Ubuntu Apache Setup for WordPress

wordpress

On a Fresh Ubuntu 18.04 server, run following commands to setup Apache, PHP and MySQL needed for WordPress installation. You can go to each file and manually run the commands if you want to see what commands are executed.

At this stage, you have LAMP server setup and ready to go. To get your […]

Read More…

Cpanel ReverseProxy Traffic to Docker Container

Apache mod_proxy

On a cpanel server, i need to run a web application using docker container. Application running side docker container listening on port 8000 on localhost. For a web site to serve traffic from this docker container, we can use Apache mod_proxy, this is enabled by default on cpanel servers. https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html You can verify it at […]

Read More…

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…