- To view Apache log files on a dedicated server or VPS.
- If you're experiencing web server difficulties, or you just want to see what Apache is doing, log files should be your first stop.
- Apache records information about all visitors to your site, as well as any problems the server encounters.
- To do this, Apache uses two types of log files: access logs and error logs.
- Apache uses the access log files to record information about every visitor to your site.
- You can see which files visitors view, how the web server responds to requests, and other information such as the web browsers visitors use.
Managed dedicated servers and VPS
- If you have a managed Flex Dedicated Server or VPS, you can view the raw Apache access logs in cPanel.
Semi-managed dedicated servers and VPS
- If you have a semi-managed Flex Dedicated Server or VPS, you have root access.
- This means you can manipulate and process the Apache access log files any way you want.
- For example, you can log in to your server using SSH and type the following command to view the last 100 lines in the access log:
- If your server is running Debian or Ubuntu, type the following command instead:
- To search for a particular term in the access log, use the grep command.
- For example, to search for all HTTP GET requests in the access log, type the following command:
- If your server is running Debian or Ubuntu, type the following command instead:
- The error log is where Apache records information about any errors or anomalies it encounters.
- Many of the “errors” Apache records are typically minor, such as a visitor requesting a file that doesn't exist.
- Apache also uses the error logs to record warnings that can indicate a potential problem with a particular event or configuration.
Managed dedicated servers and VPS
- If you have a managed Flex Dedicated Server or VPS, you can view the Apache error logs in cPanel.
Semi-managed dedicated servers and VPS
- If you have a semi-managed Flex Dedicated Server or VPS, you have root access.
- This means you can manipulate and process the Apache error log files any way you want.
- For example, you can log in to your server using SSH and type the following command to view the last 100 lines in the error log:
- If your server is running Debian or Ubuntu, type the following command instead:
- To search for a particular term in the error log, use the grep command.
- For example, to do a case-insensitive search for all occurrences of the word invalid in the error log, type the following command:
- If your server is running Debian or Ubuntu, type the following command instead: