.

Nginx Error & Access Logs – VPS ADMIN #9

English   English (change)
Be Sociable, Share!

In Case You Weren’t Sure Where They Live

nginx error logs image

Let’s take a quick look at our Nginx server and site error & access logs, and where to find them.

You have one pair of Nginx logs server-wide and another for each site, unless you omitted them. The error logs do just that, log any errors. The access logs show what web elements have been resolved by IP address and when.

Those who followed Serve Multiple Sites & Blogs with Virtual Hosts mapped out the location of the logs in each site or blogs virtual host file or, if you bundled each site’s configuration in your nginx.conf file, the locations to the files are given there.

Here’s a reminder anyhow.

[sniplet guvSellBox]
[sniplet vpsIndexSell]

Nginx Web Server Error & Access Log Locations

To list them:-

[text]ls -l /usr/local/nginx/logs[/text]

Or to open them:-

[text]sudo nano /usr/local/nginx/logs/error.log[/text]

.. substituting error.log for access.log as appropriate.

Or if you installed Nginx using the package manager, rather than compiling from source as is recommended in the VPS Bible, they’re here:-

[text]sudo nano /etc/nginx/logs[/text]

Web Site Error & Access Log Locations

[text]sudo nano /home/public_html/someSite.com/log/access.log[/text]

And the error page:-

[text]sudo nano /home/public_html/someSite.com/log/error.log[/text]

My Error or Access Log is a Blank File/Won’t Open.

In the case of the error log, hopefully it is indeed empty. With the access log, maybe it’s just too darn big and is taking a long time to open. If you really want to look at it, be patient. Else delete it and add a new, empty one:-

[text]sudo rm /home/public_html/someSite.com/log/access.log && sudo nano /home/public_html/someSite.com/log/access.log[/text]

.. saving the empty file.

[sniplet vpsIndex]

Be Sociable, Share!

Related posts:

  1. Maintain Unmanaged VPS – Part 1: Add Web Sites Nginx Cheatsheet
  2. Maintain Unmanaged VPS – Part 2: Adding Sub-Sites with Nginx
  3. Maintain Unmanaged VPS – Part 5: Get phpMyAdmin Working with Nginx
  4. Maintain Unmanaged VPS – Part 13: Restrict Access to Nginx Web Files with Auth_Basic
  5. Set Up Unmanaged VPS (4 Newbies) – Part 13: Serve Multiple Sites & Blogs with Virtual Hosts

.