I have a Linode server that I run for more than 30 websites on it! Today I wanted to add another website and I created a new .conf
file in sites-available
folder in Apache2 folder.
After enabling it and restarting my Apache, it seems like that it doesn't work at all. when going to the newly configured domain it loads one of my previously enabled website instead of the new one.
I usually copy one of my old .conf
files to create a new one. But in case here's my .conf
file:
# domain: bilitsaz.ir
# public: /var/www/bilitsaz.ir/public_html/
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin info@bilitsaz.ir
ServerName www.bilitsaz.ir
ServerAlias bilitsaz.ir
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/bilitsaz.ir/public_html
# Log file locations
LogLevel warn
ErrorLog /var/www/bilitsaz.ir/logs/error.log
CustomLog /var/www/bilitsaz.ir/logs/access.log combined
</VirtualHost>
I checked the documentRoot and it all seems correct. I wonder if you guys can help me out, thanks.
UPDATE:
apachectl -t
responds with: syntax OK
and the log for that website with apachectl -S
is: port 80 namevhost www.bilitsaz.ir (/etc/apache2/sites-enabled/bilitsaz.ir.conf:4) alias bilitsaz.ir
UPDATE 2:
Ok I enabled HTTPS using Let's Encrypt for the website and it loads just fine, but for some reasons I need the website to be plain HTTP, I wonder why the server does not load any new HTTP virtual host anymore