View/Enable Website Logs on Linux Cloud Servers
Published: 2021-07-07
View Website Logs
BT Environment
Enter BT admin panel, click "Website" on the left-corresponding site--click "Settings"-configuration file, view the access_log line (access_log is the website access log, error_log is the website error log)

WDCP Environment
Enter wdcp and click "Site Management"-"Site List" on the left, find the site to configure, click the corresponding "Edit" button after the site, check "Enable Access Log", and the log file directory is /home/web_logs

Self-built web environment
Log in to the server remotely via ssh and run the following command
netstat -tnpl
Check the PID of the web service listening on port 80 or 443

Run the following command
ll /proc/2908/fd

/home/web_logs/xxx_access.log is the access log.
View website configuration file
Log in to the server remotely via ssh and run the following commands
netstat -tnpl # Check the PID number of the web service listening on port 80 or 443 ll /proc/pid_number/exe

You can find the current web service directory (/www/server/nginx). Enter the conf directory under the web service directory (command: cd /www/server/nginx/conf ), view the nginx.conf (command: vi nginx.conf ) file to find the path of the site configuration file.

The apache environment configuration file is httpd.conf (command: vi httpd.conf)

Enter the corresponding path directory (command: cd /www/server/panel/vhost/nginx/ ) to see the configuration files of the corresponding websites. If there are many configuration files, you can run the following command
grep 'xxx.com' *
Find the corresponding configuration file.
Enable website logs
Nginx
Use vi to edit the site configuration file and add

Save and exit, and restart the nginx service.
Apache
First, find the apache service path as described above, enter the conf directory, view the httpd.conf file, and check the logFormat format

Then use vi to edit the site configuration file and add:

Save and exit, and restart the aapche service.
