Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Mar 30, 2010 7:49 am 
Offline
Junior Member

Joined: Sat Feb 27, 2010 12:43 am
Posts: 23
I am running wordpress with super cache for my site. I have just installed nginx for my server. Do I need to stop the service for apache? But when I stop the service for apache, it just shows the default nginx white page. And my website is gone. Can anyone help


Top
   
 Post subject:
PostPosted: Tue Mar 30, 2010 3:26 pm 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
Yes, best to stop apache, unless you're proxying PHP to it or running it on another port.

Have you configured nginx for your site ? It's unlikely to have picked up your existing settings automatically.


Top
   
 Post subject:
PostPosted: Tue Mar 30, 2010 11:15 pm 
Offline
Junior Member

Joined: Sat Feb 27, 2010 12:43 am
Posts: 23
K, I got my wordpress site working with nginx. I read that I need to change the nginx config files to make it working properly with wordpress super cache? Is it true? What changes do I need to make?


Top
   
 Post subject:
PostPosted: Tue Mar 30, 2010 11:29 pm 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
I've never used wordpress, but from a quick google, yes, you'll have to set up a few rewrite rules at the very least.


Top
   
 Post subject:
PostPosted: Wed Mar 31, 2010 9:14 am 
Offline
Junior Member

Joined: Sat Feb 27, 2010 12:43 am
Posts: 23
I have put in the rewrite rules for permalink for wordpress, but I kept getting 404 messages when I browse to other pages only the homepage works. Anyone can help?

Code:
server {
    listen   80;
    server_name www.topdesignblogs.com topdesignblogs.com;
    access_log /home/tony/public_html/topdesignblogs.com/logs/access.log;
    error_log /home/tony/public_html/topdesignblogs.com/logs/error.log;

    location / {
        root   /home/tony/public_html/topdesignblogs.com/public;
        index  index.php;
if (!-e $request_filename) {
  rewrite  ^(.*)$  /index.php?q=$1  last;
  break;
}
   }

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param  SCRIPT_FILENAME /home/tony/public_html/topdesignblogs.com/public$fastcgi_script_name;
      fastcgi_param  SCRIPT_NAME      $fastcgi_script_name;
      fastcgi_param  REQUEST_URI      $request_uri;
      fastcgi_param  DOCUMENT_URI     $document_uri;
      fastcgi_param  DOCUMENT_ROOT    $document_root;
      fastcgi_param  REMOTE_ADDR        $remote_addr;
      fastcgi_param  REMOTE_PORT        $remote_port;
      fastcgi_param  SERVER_ADDR        $server_addr;
      fastcgi_param  SERVER_PORT        $server_port;
      fastcgi_param  SERVER_NAME        $server_name;
      fastcgi_param  QUERY_STRING     $query_string;
      fastcgi_param  REQUEST_METHOD   $request_method;
      fastcgi_param  CONTENT_TYPE     $content_type;
      fastcgi_param  CONTENT_LENGTH   $content_length;
    }
}


Broswser Error Message:
Not Found

The requested URL /uncategorized/test/ was not found on this server.
Apache/2.2.8 (Ubuntu) mod_perl/2.0.3 Perl/v5.8.8 Server at topdesignblogs.com Port 80


Top
   
 Post subject:
PostPosted: Wed Mar 31, 2010 3:14 pm 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
How are you handling your cgi requests ? Nginx won't handle these on it's own -- you'll need to pass them on to a fastcgi server such as php-fpm, spawn-fcgi (from lighttpd) or php5-cgi.

Alternatively, you can keep apache running on a different port, and use it purely as a cgi processor.


Top
   
 Post subject:
PostPosted: Wed Mar 31, 2010 9:15 pm 
Offline
Junior Member

Joined: Sat Feb 27, 2010 12:43 am
Posts: 23
I'm handling using php5-cgi but it still doesn't work.


Top
   
 Post subject:
PostPosted: Wed Mar 31, 2010 9:51 pm 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
Are your php processes running ? Can you process php commands manually ?

Which port is the master listening on ? Does this match the port in your nginx configuration (9000) ?

Can you read a phpinfo() page ?


Top
   
 Post subject:
PostPosted: Wed Mar 31, 2010 10:14 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
illusime wrote:
The requested URL /uncategorized/test/ was not found on this server.
Apache/2.2.8 (Ubuntu) mod_perl/2.0.3 Perl/v5.8.8 Server at topdesignblogs.com Port 80


That message is coming from apache, nginx isn't serving your pages, I imagine nginx isn't even running since apache is using port 80 nginx won't be able to bind to it.

Stop apache, disable it from running at startup (or just remove it all together) then start nginx.


Top
   
 Post subject:
PostPosted: Thu Apr 01, 2010 1:04 am 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
Quote:
That message is coming from apache


Well spotted :)


Top
   
 Post subject:
PostPosted: Sun Apr 04, 2010 9:28 am 
Offline
Junior Member

Joined: Sat Feb 27, 2010 12:43 am
Posts: 23
I have managed to solve the nginx and it is running without apache. I have a problem after activating wordpress super cache.

When I look at the source code I cannot find:
"Cached page generated by WP-Super-Cache on YYYY-MM-DD HH:MM:SS".

Instead I see this:

<!-- Dynamic page generated in 2.092 seconds. -->
<!-- Live page served on 2010-04-04 08:13:15 -->

Is the wordpress super cache working? Or is it supposed to be like this with nginx?


Top
   
 Post subject:
PostPosted: Sun Apr 04, 2010 10:40 am 
Offline
Senior Member

Joined: Sat Mar 28, 2009 4:23 pm
Posts: 415
Website: http://jedsmith.org/
Location: Out of his depth and job-hopping without a clue about network security fundamentals
illusime wrote:
Is the wordpress super cache working? Or is it supposed to be like this with nginx?

Refresh. If it is still generated dynamically, your rewrite rules are wrong.

_________________
Disclaimer: I am no longer employed by Linode; opinions are my own alone.


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


Who is online

Users browsing this forum: No registered users and 0 guests


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