Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Mar 31, 2012 6:46 am 
Offline
Junior Member

Joined: Mon Mar 26, 2012 5:50 am
Posts: 22
Hi,
I'm no command line or *nix expert, but not a complete noob either.

I setup a new Linode using Ubuntu 11.10, followed the guides for setting up a LEMP server and Wordpress. It seemed to work okay and I could log into WP admin, etc. so I know that the nginx, mysql and php must have been working at one point.

I rebooted the server to be sure everything still worked and now browsing to the site returns server not found page and it acts totally dead. The browser returns a server not found immediately with no delay at all.

I would appreciate any pointers of things to look at. So far I have done this:

* I did a ps aux | egrep '(PID|nginx)' and can see my processes are alive so they started up as they should. Same for mysql.
* I tried just browsing to the readme.html that wordpress installs as a test for nginx without php and mysql, didn't work.
* I checked the DNS Manager and all seems okay.
* I checked my iptables and not completely sure how to decipher it, but it matches the example referenced from the Linode wiki and port 80 is enabled
* I checked my nginx conf files and they still reflect the same contents as the guide had (that had worked before)

Is there some sort of guide for diagnosing problems like this?

Thanks for any advice!
Brett


Top
   
 Post subject:
PostPosted: Sat Mar 31, 2012 7:01 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Post your nginx configuration, domain and ip address so we can look it over.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject: Configuration files
PostPosted: Sat Mar 31, 2012 7:20 am 
Offline
Junior Member

Joined: Mon Mar 26, 2012 5:50 am
Posts: 22
Hi,
Thanks for your post. Sorry I didn't post the conf files first, I thought if I could find a guide I wouldn't need to trouble people with my particular configuration. Thanks for taking a look.

173.230.149.5

http://realizedventures.com

From /etc/nginx/nginx.conf

Code:
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml $

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}


And from /etc/nginx/sites-enabled/realizedventures.com

Code:
server {
    listen   80;
    server_name www.realizedventures.com realizedventures.com;
    access_log /srv/www/realizedventures.com/logs/access.log;
    error_log /srv/www/realizedventures.com/logs/error.log;
    root   /srv/www/realizedventures.com/public_html;

    location / {
        index  index.html index.htm index.php;
    }

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        try_files $uri = 404;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /srv/www/realizedventures.com/public_html$fastcgi_script_name;
    }
}


Thanks again for any help.

Cheers,
Brett


Top
   
 Post subject:
PostPosted: Sat Mar 31, 2012 7:31 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
DNS looks fine, your network settings are fine (ssh is working), so either nginx isn't working right (config looks fine) or your firewall is blocking it.

Run [code]iptables -L -v -n[code] show?

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Sat Mar 31, 2012 7:36 am 
Offline
Junior Member

Joined: Mon Mar 26, 2012 5:50 am
Posts: 22
Thanks for your post!

Here's the output of iptables

Code:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
    0     0 REJECT     all  --  lo     *       0.0.0.0/0            127.0.0.0/8         reject-with icmp-port-unreachable
  951 74853 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
   17  1088 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80
    4   256 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:443
    4   256 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
    1    84 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 8
   29  1640 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 5/min burst 5 LOG flags 0 level 7 prefix `iptables denied: '
  684 43560 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
  699 73492 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           



Thanks again :)


Top
   
 Post subject:
PostPosted: Sat Mar 31, 2012 7:40 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Not that then you're default policy is to accept traffic so iptables isn't doing much.

What happens when you run
Code:
nginx -t && service nginx restart
if that doesn't work try
Code:
nginx -t && /etc/init.d/nginx restart
or
Code:
nginx -t && restart nginx
(I can't remember how ubuntu 11.10 is set up to start nginx)

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Sat Mar 31, 2012 7:46 am 
Offline
Junior Member

Joined: Mon Mar 26, 2012 5:50 am
Posts: 22
I wasn't sure about the iptables. My goal was to lock down everything except 80, 443, SFTP and SSH. I probably did something wrong though. I'll look into that once this is all fixed.

Code:
root@sadhana:/home# nginx -t && service nginx restart
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful


Continued thanks!


Top
   
 Post subject:
PostPosted: Sat Mar 31, 2012 7:49 am 
Offline
Junior Member

Joined: Mon Mar 26, 2012 5:50 am
Posts: 22
I ran ps aux | egrep '(PID|nginx)' and it looks like nginx isn't running? isn't the things listed below the fast-cgi processes?

Code:
root@sadhana:/home# ps aux | egrep '(PID|nginx)'
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
nginx     2277  0.0  1.0  61128  5516 ?        Ss   04:01   0:00 /usr/bin/php5-cgi
nginx     2344  0.0  0.3  61128  1988 ?        S    04:01   0:00 /usr/bin/php5-cgi
nginx     2345  0.0  0.3  61128  1988 ?        S    04:01   0:00 /usr/bin/php5-cgi
nginx     2346  0.0  0.3  61128  1988 ?        S    04:01   0:00 /usr/bin/php5-cgi
nginx     2347  0.0  0.3  61128  1988 ?        S    04:01   0:00 /usr/bin/php5-cgi
nginx     2348  0.0  0.3  61128  1988 ?        S    04:01   0:00 /usr/bin/php5-cgi
nginx     2349  0.0  0.3  61128  1988 ?        S    04:01   0:00 /usr/bin/php5-cgi
root      2611  0.0  0.1   4196   760 pts/0    S+   04:47   0:00 egrep --color=auto (PID|nginx)


Top
   
 Post subject:
PostPosted: Sat Mar 31, 2012 7:53 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Yep looks like it's not running, simply run
Code:
nginx
and see if it starts up

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Sat Mar 31, 2012 7:57 am 
Offline
Junior Member

Joined: Mon Mar 26, 2012 5:50 am
Posts: 22
Woohoo!

So it looks like it's not starting up on boot. It has a file in init.d and update-rc as I followed the guides. But how can I check/verify these? Obviously something must be wrong there.

Thanks!


Top
   
 Post subject:
PostPosted: Sat Mar 31, 2012 7:57 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
How did you install nginx? via apt-get? a ppa? or from source?

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Sat Mar 31, 2012 8:00 am 
Offline
Junior Member

Joined: Mon Mar 26, 2012 5:50 am
Posts: 22
Via apt-get as per the guide.


Top
   
 Post subject:
PostPosted: Sat Mar 31, 2012 8:04 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Hrm should work then, connect to lish via terminal and run the log view command see: http://library.linode.com/troubleshooti ... node-shell it'll show the boot process see if nginx is mentioned there.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Sat Mar 31, 2012 8:10 am 
Offline
Junior Member

Joined: Mon Mar 26, 2012 5:50 am
Posts: 22
I thought I might be missing the /usr/sbin/update-rc.d -f nginx defaults as it's at the end of the source install section and I thought I might have skipped it.

If I run it, I get:

Code:
root@sadhana:/etc/init.d# /usr/sbin/update-rc.d -f nginx defaults
 System start/stop links for /etc/init.d/nginx already exist.


So it looks like it's already there. I'll try the Lish suggestion and post what I find.


Top
   
 Post subject:
PostPosted: Sat Mar 31, 2012 8:10 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
If you installed via apt-get you shouldn't have to touch any startup files or anything except what's in /etc/nginx/

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group