ionos Magento Internal Server Error

Magento

After migrating a Magento site to ionos shared hosting, internal pages of the site stopped working with “Internal Server Error”. The problem is due to .htaccess file. The error is fixed by editing pub/.htaccess file vi pub/.htaccess Find #RewriteBase /magento/ Replace with RewriteBase / Many static files were also not loading, to fix it, edit … Read more

How to debug Apache VirtualHost not working

On an Apache webserver running in Ubuntu, I added a VirtualHost entry for a domain name. But instead of showing the page, it shows the website from the default Apache VirtualHost (000-default.conf). At first, I was thinking it is because Apache was somehow not able to handle Named Virtual Hosts. So I created another domain … Read more

Apache Location

To only allow requests from a specific IP to a location, use Require ip 59.92.71.53 51.38.246.115 Require ip 59.92.71.53 51.38.246.115 Add custom headers based on location Require ip 59.92.71.53 51.38.246.115 Header edit Location ^/browse /internal/stream/browse AddOutputFilterByType INFLATE;SUBSTITUTE;DEFLATE text/html text/plain text/xml Substitute “s#\”/(fields|browse|machine|entries)#\”/internal/stream/$1#i”

Apache Proxy

To proxy requests in Apache For proxying HTTPS traffic, use If remote SSL is invalid, you can disable SSL verification You need to enable following apache modules for proxy to work The ProxyPreserveHost directive in Apache’s configuration is used in the context of a reverse proxy setup. When this directive is set to On, it … Read more

Find what MPM model Apache is using

Apache is the most popular web server, it is Open Source and modular. Multi-Processing Modules (MPM) in Apache decides how Apache listens to the network and handles the incoming requests. Apache have many MPM Modules (Multi-Processing Modules), the most popular among them are Prefork, worker, and Event. You can only activate one Apache MPM at … Read more

React/Angular Application showing 404 error on refresh

On Apache server, React Application works fine, but if you refresh a page, it shows 404 error. This is because the application use BrowserRouter. To fix the error, create a .htaccess file with following content or following code, this results in http 200 for non-existant pages. Put this on the folder where your application index.html … Read more

Restart Apache if failed

This bash script check web site every 5 minutes, restart the web server if web site is not responding. Create a file mkdir /usr/serverok vi /usr/serverok/check_httpd.sh Add #!/bin/bash # Author: Yujin Boby # Web: https://serverok.in # Email: admin@serverok.in /usr/bin/wget –tries=1 –timeout=30 -O /dev/null https://YOUR_DOMAIN.EXTN/ if [ $? -ne 0 ]; then systemctl restart httpd datetime=`date … Read more

Apache Auto Renew SSL on Password Protected site

I have a web site that is password protected using Apache basic autenticiation. I used following code in Apache config to password protect. AuthType Basic AuthName “Restricted Content” AuthUserFile /etc/apache2/demo-sok-htpaswd Require valid-user The problem is when SSL need auto renew, it need url like http://domain/.well-known/ to be accessable with out any password for domain ownership … Read more

Fix Canonical URL using .htaccess

When you host a web site, many web hosting providers allow your web site access using multiple urls like yourdomain.com, www.yourdomain.com. If you have a dedicated IP address, your web site become available on the IP address also. It is bad for SEO to have a site available in multiple URLs. If search engine index … Read more