0

Following this tutorial and this followup I have a fresh Nginx + PHP5-FPM setup on Debian 6 (Squeeze) running on an OpenVZ VPS.

Right now the default virtual host works (Welcome to nginx! is displayed) as well as one other virtual host, on which I was able to successfully install WordPress. However, any further virtual hosts I create simply show Cannot find server in the title of my browser window and Access to this web page is currently unavailable. in the page.

Aside from actual domain names and file paths (DNS and file paths are apparently working properly with proper users and permissions) my virtual hosts use the same config. The configs are in /etc/nginx/sites-available/ with links at /etc/nginx/sites-enabled/. All other config files are copied from the linked blog posts.

The logs have no entries from these hits, so I'm unable to find anything useful there unfortunately.

This config below is used by all of my virtual hosts, including the one that works:

server {
  listen 80;
  server_name example.com;

  access_log /var/www/example.com/logs/access.log;
  error_log /var/www/example.com/logs/error.log;

  root /var/www/example.com/html/;
  include /etc/nginx/wordpress.conf;
  location /static {
    autoindex on;
  }
}

server {
  listen 80;
  server_name www.example.com;
  rewrite ^ http://example.com$request_uri?;
}
Gavin
  • 1
  • 2
  • Make sure that all the domain names can resolve to your VPS' IP address `nslookup www.example.com`. – quanta Oct 03 '11 at 02:38
  • As someone who works with domain names and DNS all day long I am ashamed to have missed the fact that I had an off by one error in my A records. And then used those same incorrect IP addresses in my hosts file for testing. – Gavin Oct 03 '11 at 23:39
  • Feel free to post your finding as an answer here. You can accept it after 48 hours from the initial question posting. We like having closure around these parts. – sysadmin1138 Oct 03 '11 at 23:55

3 Answers3

0

Is your wordpress installed in /var/www/example.com/html/? If you should change this document root to your install's location.

nicgrayson
  • 21
  • 2
0

Check for the 'Include' directive in the nginx.conf file.

include /etc/nginx/sites-enabled/*;

Then try restarting Nginx.

0

Despite how sure I was of my DNS records, the IP addresses were wrong - at a glance they looked identical. This also explains why I couldn't find any search results for the error message.

Gavin
  • 1
  • 2