Question

Apache2 sub domain created with virtualmin generating virtual server on ports 80 and 443

Should I delete the virtual host on port 80 since I never use it?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi, I believe the virtual server on port 80 contains redirection to https://subdomain.yourdomain.something. So, if you remove it (and restart apache2), you will have to put https prefix before your websie address every time you want to access your website (unless your web browser is configured to enforce https connection). Automatic redirection will be no longer performed.

Hello,

As @Yannek explained it creates a redirection from port 80 to port 443. Let me explain a little further so that’s its clear why exactly this happens.

Let’s make an example so it’s easier to explain. Imagine you have a website examplewebsite.com. When you want to load the website in your browser, you often type just the domain - examplewebsite.com. You don’t write - https://examplewebsite.com so when you load it, it loads by default with the HTTP protocol. This protocol answers on port 80. Now every application or in the webservice’s configuration has a redirection rule from HTTP to HTTPS (80 to 443).

Removing this rule will make all requests to examplewebsite.com unreachable thus removing the part where it does the redirection.

Regards, KFSys