Wrong error.log file being written to in Ubuntu

16 Views Asked by At

I have a LAMP Droplet set up on DigitalOcean using Ubuntu 22.04 and I've created a number of Virtual Hosts within the /etc/apache2/sites-available dir, each with their own .conf file and setting a specific location for that site's Error Log. I did this via PuTTY, following a guide provided by DigitalOcean themselves.

For one of the Virtual Hosts, it's saving all the errors into the main error.log and not the one I've stated in the .conf file (which does exist).

Here's what I've got in the .conf file (email and URLs are all fake in this):

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName supplier.mysite.com
    ServerAlias supplier.mysite.com
    DocumentRoot /var/www/supplier
    ErrorLog ${APACHE_LOG_DIR}/supplier/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =supplier.mysite.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

My other .conf files are set up exactly the same and they work fine.

I've tried changing the folder name and the file name in the .conf file and each time it creates the folder and file on the server for me with the relevant permissions but errors are still going into the main error.log file.

I'm a novice when it comes to anything server related like this so any help would be greatly appreciated!

0

There are 0 best solutions below