• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Forwarded to devs /var/log/apache2/other_vhosts_access.log is not showing the originating IP with Nginx enabled

mr-wolf

Silver Pleskian
Plesk Guru
TITLE:
/var/log/apache2/other_vhosts_access.log is not showing the originating IP with Nginx enabled
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE:
Plesk 17.5.3 / Ubuntu 16.0.4 LTS
PROBLEM DESCRIPTION:
Out of interest I started to look in /var/log/apache2/other_vhosts_access.log
AFAIK this is the only place to see what traffic is hitting the Plesk page for unconfigured domains (correct me if necessary)

This log did not show me the originating IP's, but Nginx's IP, which is nor useful to me.​
STEPS TO REPRODUCE:
tail /var/log/apache2/other_vhosts_access.log on an Nginx enabled server​
ACTUAL RESULT:
shows IP of server​
EXPECTED RESULT:
shows IP of the client accessing the default page​
ANY ADDITIONAL INFORMATION:
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM:
Confirm bug
 
Could you please clarify why do you want to use enabled pipelog? If you disable it - nothing will be written to /var/log/apache2/other_vhosts_access.log
 
I am merely in search of a log where I can view people accessing the server for domains that are not configured there.
They get the "default Plesk page".
AFAIK this is the only place where I can see those entries. Please correct me if I'm mistaken.

At the moment I pointed the DNS-records of a deprecated domain to a new Plesk server.
I have not configured that domain there, nor do I want to.
It is showing a lot of traffic going to that site.

I just like to know what's going on on my servers....
Logging the IP's is part of that.

I'm interested in their IP's as I might want to make a localized webserver of it.
Domains that are configured on that server can only be reached by Dutch & Belgian IP's.
 
I would also like the hostname they are accessing.
That info is superfluous in those other logs, but not in this one....
 
The 'proxy_set_header' parameter is not defined for 'X-Forwarded-For' http header in nginx config file. Possibly there is a custom template for nginx server config. Please check. The default config should have the following section:

Code:
# cat /etc/nginx/plesk.conf.d/server.conf
server {
        listen 10.52.53.84:80; <-- It means this section is for the default http port
 
        location ^~ /plesk-site-preview/ {
                proxy_pass http://127.0.0.1:8880;
                proxy_set_header Host             plesk-site-preview.local;
                proxy_set_header X-Real-IP        $remote_addr;
                proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
                proxy_cookie_domain plesk-site-preview.local $host;
                access_log off;
        }
 
        location / {
                proxy_pass http://10.52.53.84:7080;  <-- here the internal server IP and apache default port if nginx enabled(7080)
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  <--- THIS STRING must be in config.
        }
}
 
No, it can't be Nginx as all my other logs are properly working.
I just want it fixed the "Plesk way"
Otherwise I would just patch the Apache conf file.....

I have not set any custom logging.
This config should be set, so it uses the referred IP.
IMHO this should be set out-of-the-box after making Nginx the reverse proxy.

Code:
find /etc/apache2 -type f -exec grep -il other_vhosts_access.log {} \;
/etc/apache2/conf-available/other-vhosts-access-log.conf
cat /etc/apache2/conf-available/other-vhosts-access-log.conf
# Define an access log for VirtualHosts that don't define their own logfile
CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
 
I placed this in that file and now have a log with originating ip

# cat /etc/apache2/conf-available/other-vhosts-access-log.conf
Code:
# Define an access log for VirtualHosts that don't define their own logfile
CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log "%v:%p %a %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" vhost_combined

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

I still think Plesk should do this for me....
 
Back
Top