• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question How to combine http & https log files?

KDawson

Basic Pleskian
I want to log all access requests, whether from http (port 80) or https (port 443) to the same log file, namely

/var/www/vhosts/<mydomain.com>/statistics/logs/access_log

In other words, no separate access_ssl_log.

I have tried including a vhost.conf at the end of httpd.conf, like so:

Include "/var/www/vhosts/system/<mydomain.com>/conf/vhost.conf"

vhost.conf contains:

<IfModule mod_ssl.c>
<VirtualHost <myIP>:443 >
CustomLog /var/www/vhosts/system/<mydomain.com>/logs/access_log plesklog
</VirtualHost>
</IfModule>

After restarting Apache, https requests are still logged to access_ssl_log.

Also, I fear that the directive to include vhost.conf will get deleted the next time Plesk overwrites httpd.conf. How do I make the include permanent?
 
Thank you. But that mechanism does not seem to work. Following the instructions, I created
/usr/local/psa/admin/conf/templates/custom by cp -r from .../default. Edited one file (.../domain/
domainVirtualHost.php) and tried regenerating the config via
/usr/local/psa/admin/bin/httpdmng --reconfigure-domain <mydomain.com>. Failed: "<VirtualHost> cannot occur within <VirtualHost> section".

Backed out that one edit so that .../custom tree was identical to .../default. Rebuild failed with the same error.
 
It gets worse. Now Plesk is caching an old file (seemingly) and will not let it go.

When I log in to Plesk this message appears at the top:

"New configuration files for the Apache web server were not created due to the errors in configuration templates: AH00526: Syntax error on line 3 of /var/www/vhosts/system/<mydomain.com>/conf/vhost.conf: <VirtualHost> cannot occur within <VirtualHost> section . Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files. See the details in Configuration Troubleshooter"

First I deleted the <VirtualHost> from that vhost.conf file. Then I deleted vhost.conf. Then I removed every reference to vhost.conf from every file in the directory /var/www/vhosts/system/<mydomain.com>/conf. None of it matters. That same error persists.

I rebooted my machine. No good: that same error persists.

And no "detailed error descriptions" were ever emailed to me on the 5 or 6 occasions that error appeared.
 
You need to tell Plesk to rebuild the config for the bad vhost entry that you added now that your removed the bad code:

Code:
/usr/local/psa/admin/bin/httpdmng --reconfigure-domain <yourdomain.com>

Then restart Apache.
 
Back
Top