Home > Article > Operation and Maintenance > Where is the apache error log in linux
In Linux, the default location of the apache error log is "/var/log/apache2/error.log"; to find the customized error log location, you can use a text editor to open "/etc/apache2 /apache2.conf" file, and look for the line starting with ErrorLog, and change the line to specify the location of the custom Apache error log file.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
On Debian-based Linux, the default location of the system-wide apache error log is /var/log/apache2/error.log
Customized Error Log
To find out the custom location of the Apache error log, open /etc/httpd/conf/httpd.conf with a text editor and look for ServerRoot, This parameter shows the top level of the Apache web server directory tree where log files and configuration are located. For example:
ServerRoot "/etc/httpd"
Now, look for the line starting with ErrorLog, which indicates where the Apache web server writes the error log. Note that the location specified is relative to the ServerRoot value. For example:
ErrorLog "log/error_log"
Combine the above two instructions to get the complete error log path. By default, the path is /etc/httpd/logs/errorlog. In a fresh installation of Apache, this is a symbolic link to /var/log/httpd/errorlog.
In actual situations, ErrorLog may point to any location in your Linux system.
Extended knowledge
When we install and start Apache, Apache will automatically generate two log files. These two log files are the access log access_log (access.log on Windows) and the error log error_log (error.log on Windows). If you use SSL service, there may also be three log files: ssl_access_log, ssl_error_log and ssl_request_log.
The path of the log file varies depending on the installation method. It is generally in the logs subdirectory of the Apache installation directory. The path of the log file can be found in the Apache configuration file according to the actual installation situation.
Recommended learning: Linux video tutorial
The above is the detailed content of Where is the apache error log in linux. For more information, please follow other related articles on the PHP Chinese website!