Overview
This article describes how to view your Analog stats after enabling stats in your DreamHost panel.
Background
Nginx is a high performance web server used as an alternative to the popular Apache web server. WordPress works great on Nginx machines, however, you must adjust certain files to enable site statistics to work as they would on an Apache server.
How to enable WordPress stats
You can enable WordPress stats on either an Apache or Nginx server.
Apache
Site statistics are not initially available when running WordPress. When WordPress is running on an Apache server, you can use an .htaccess file to allow the /stats subdirectory to serve your site statistics. See this article for details.
Nginx
After making any adjustments to a .conf file, you must restart your VPS or reload your Dedicated Server.
When using Nginx, your .htaccess file does not function. You must add code to another file in order to view your stats. Your Nginx WordPress site includes two directories, which are described in the following sections.
In the following examples, the username is your Shell user and example.com is your website.
Your web directory (aka document root)
The root directory is where all of your website's files are located:
/home/username/example.com
Your nginx/example.com directory
The Nginx directory only contains configuration files for your site:
/home/username/nginx/example.com
Within the /home/username/nginx/example.com directory, create a file titled wordpress.conf and then add the following rule at the very beginning of this wordpress.conf file:
### stats if ($request_uri ~* ^/(stats|failed_auth\.html).*$) { break; }
When you visit example.com/stats, a login prompt displays allowing you to log in and view your site statistics. See the Nginx configuration file locations article for further details.
Enabling stats and permalinks
WordPress uses permalinks to make the URLs easier to read. When running Nginx, add the following two sections to enable both the site statistics and permalinks functionality:
### stats if ($request_uri ~* ^/(stats|doc|failed_auth\.html).*$) { break; } ### permalinks if (!-e $request_filename) { rewrite ^.*$ /index.php last; }
If your stats are not accessible
If you've enabled a stats user on the Site Statistics page but find that the stats are still not accessible, please contact DreamHost support.