Recently one of my new private projects I’ve decided to change the public HTML folder path in my virtual host file, however, no matter how many times i’ve made the changes, refresh and perform any technical change or command I couldn’t see the changes apply. My default path was “/var/www/html/” and I’ve decided to make another sub folder (my mistake, but no worries we’ll fix that) but the changes to the domain virtual host path, just didn’t apply and i kept receiving the older index.html file no matter what.
First things first, don’t forget to restart your apache2 server with the following command.
service apache2 reload
if above command doesn’t apply your changes, it’s likely that you apply those changes in your http virtual host domain and forget to apply those changes inside your SSL configuration as well.
Within your SSH try to search for your domain SSL configuration in the following path:
vim /etc/apache2/sites-available/<your domain>-le-ssl.conf
Apply your changes in your ssl configuration as well. if that doesn’t help, don’t forget to restart your apache2 service. if that doesn’t help, let’s continue
The next solution consider the implementation of apcahe2, Where we host virtual host files inside “sites-available” folder and they are symbolic from another folder which called “sites-enabled”. this folder, is the actual folder that expose virtual host configuration to the public. Meaning that if you configuration something inside sites-available and they are not symbolic linked inside “sites-enabled” it means your configuration won’t work!
There are two reasons for that, you or someone else deleted or changed the symbolic link or you haven’t executed a2ensite command on your virtual host files, Try the following command on your domain inside sites-available to expose your virtual host files:
sudo a2ensite your_domain_1.conf
if noting works, i’d recommend you to test the configuration of your virtual host file with the following command:
sudo apache2ctl configtest
It will try to test your configuration and look for syntax errors.
Lior Amsalem embarked on his software engineering journey in the early 2000s, Diving into Pascal with a keen interest in creating, developing, and working on new technologies. Transitioning from his early teenage years as a freelancer, Lior dedicated countless hours to expanding his knowledge within the software engineering domain. He immersed himself in learning new development languages and technologies such as JavaScript, React, backend, frontend, devops, nextjs, nodejs, mongodb, mysql and all together end to end development, while also gaining insights into business development and idea implementation.
Through his blog, Lior aims to share his interests and entrepreneurial journey, driven by a desire for independence and freedom from traditional 9-5 work constraints.
Leave a Reply