#1  
Old 23rd April 2012, 13:25
cyprus cyprus is offline
Member
 
Join Date: Oct 2011
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default Wordpress Multisite get an 502

Hello last week I got ISPConfig to run after 2 weeks of hard work.
I resolved each task to get ISPcontig running on my server but the main point why I even thought about to switch my configuration is still not accomplished.

Before I start to describe the Problem here is my server config.
Debian Squeeze, Nginx , php-fpm, Postfix / Dovecot ,MySQL 5.5

Most stuff is fine ISPconfig seems to work like it should be. Postfix / Dovecot works as well.

I´ve uploaded a Flash Site to one of my webs and it works

I tried to move one of my Wordpress ms installation from an Apache environment, and this fails.
I know I can´t use the Apache .htaccess rules anymore and have to tell nginx what to do. I took the Nginx Config from the wordpress.org codex.
http://codex.wordpress.org/Nginx

The configuration is clear in most cases but there is one point which is not clear
Quote:
# Upstream to abstract backend connection(s) for PHP.
upstream php {
server unix:/tmp/php-fpm.sock;
# server 127.0.0.1:9000;
}
I implemented it as described but if I call a site I get an 502 Error.
Quote:
Folgender Fehler ist aufgetreten:

Dieser Server hat eine ungültige Antwort von einem Upstream-Server erhalten, auf den zugegriffen wurde, um die Anforderung zu erfüllen.
I get an invalid request from the Upstream Server.
And now I´m a littlebit lost. And need your inspiration to solve the problem.

Thank you in advance.
Cyprus
Reply With Quote
Sponsored Links
  #2  
Old 23rd April 2012, 13:35
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,060
Thanks: 826
Thanked 5,395 Times in 4,239 Posts
Default

The nginx configuration for php is done by ispconfig, so you should not duplicate this with your manual configuration or nginx will fail. The guide you followed is for a complete nginx configuration for servers without a controlpanel thats uses different paths etc., if you use a controlpanel like ispconfig, then dont touch nginx.conf file or site configuration file. Instaed you just add the wordpress rules in the custom nginx directives field in ispconfig.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 23rd April 2012, 14:07
cyprus cyprus is offline
Member
 
Join Date: Oct 2011
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Instaed you just add the wordpress rules in the custom nginx directives field in ispconfig.
I read about such field but where should this be?

Thank you for your reply
Reply With Quote
  #4  
Old 23rd April 2012, 14:13
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,060
Thanks: 826
Thanked 5,395 Times in 4,239 Posts
Default

Options tab of the website settings.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 23rd April 2012, 14:42
cyprus cyprus is offline
Member
 
Join Date: Oct 2011
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay thank you I found it.

But there are a few questions remaining.
1) Do you recommend to turn " Use Socket for PHP-FPM" on?
2) Do you agree that I only have to drop the rewrite rules for Nginx into the Nginx topic

Quote:
# This order might seem weird - this is attempted to match last if rules below fail.
# http://wiki.nginx.org/HttpCoreModule
location / {
try_files $uri $uri/ /index.php?$args;
}

# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

# Directives to send expires headers and turn off 404 error logging.
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 24h;
log_not_found off;
}

# Pass uploaded files to wp-includes/ms-files.php.
rewrite /files/$ /index.php last;

# For multisite: Use a caching plugin that creates symlinks to the correct subdirectory structure to get some performance gains.
set $cachetest "$document_root/wp-content/cache/ms-filemap/${host}${uri}";
if ($uri ~ /$) {
set $cachetest "";
}
if (-f $cachetest) {
# Rewrites the URI and stops rewrite processing so it doesn't start over and attempt to pass it to the next rule.
rewrite ^ /wp-content/cache/ms-filemap/${host}${uri} break;
}

if ($uri !~ wp-content/plugins) {
rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;
}

# Uncomment one of the lines below for the appropriate caching plugin (if used).
#include global/wordpress-ms-subdir-wp-super-cache.conf;
# include global/wordpress-ms-subdir-w3-total-cache.conf;

# Rewrite multisite '.../wp-.*' and '.../*.php'.
if (!-e $request_filename) {
rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
rewrite ^/[_0-9a-zA-Z-]+.*(/wp-admin/.*\.php)$ $1 last;
rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
}
Thanx in advance
Cyprus
Reply With Quote
  #6  
Old 23rd April 2012, 15:29
cyprus cyprus is offline
Member
 
Join Date: Oct 2011
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So I deleted everything I´ve changed in the nginx.conf and orx.org vhost config and dropped the rewrite rule I posted above without the part for the caching plugin into nginx configuration in the ispconfig backend and the result is a 500 Error.
Not shure what to check next.
Reply With Quote
  #7  
Old 6th November 2013, 21:43
PermaNoob PermaNoob is offline
Senior Member
 
Join Date: Jan 2007
Posts: 194
Thanks: 12
Thanked 5 Times in 5 Posts
Default

Quote:
Originally Posted by till View Post
The nginx configuration for php is done by ispconfig, so you should not duplicate this with your manual configuration or nginx will fail. The guide you followed is for a complete nginx configuration for servers without a controlpanel thats uses different paths etc., if you use a controlpanel like ispconfig, then dont touch nginx.conf file or site configuration file. Instaed you just add the wordpress rules in the custom nginx directives field in ispconfig.
Can someone give me the specific code which needs to go in the custom nginx directives field to get wordpress to work on Centos 6.4, nginx, ispconfig 3.0.5.3

I currently have ERROR 500 on wordpress sites
Reply With Quote
  #8  
Old 6th November 2013, 21:46
Steveorevo Steveorevo is offline
Member
 
Join Date: Feb 2010
Posts: 33
Thanks: 6
Thanked 6 Times in 5 Posts
Default

I use these nginx directives in the "options" tab. This is to work like typical post name permalink settings one would use with WordPress on Apache...

# Secure nginx.conf file
location /nginx.conf {
deny all;
}

# block s2Member log file ***if you use the s2Member plugin
location ~ /\.log {
deny all;
}

# Include W3TC nginx.conf file ***if you use w3tc cache
#include /var/www/clients/client1/web1/web/nginx.conf;

# Support permalinks
location / {
try_files $uri $uri/ /index.php?$args;
}

rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}

rewrite ^/files/(.+) /wp-includes/ms-files.php?file=$1 last;
location ^~ /files/ {
rewrite ^.*/files/(.+)$ /wp-includes/ms-files.php?file=$1 last;
}

# Rewrite multisite '.../wp-.*' and '.../*.php'.
if (!-e $request_filename) {
rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
}

Last edited by Steveorevo; 6th November 2013 at 21:47. Reason: clarifications
Reply With Quote
The Following User Says Thank You to Steveorevo For This Useful Post:
PermaNoob (6th November 2013)
  #9  
Old 6th November 2013, 22:18
PermaNoob PermaNoob is offline
Senior Member
 
Join Date: Jan 2007
Posts: 194
Thanks: 12
Thanked 5 Times in 5 Posts
Default

Thanks! that got it...however...

After inserting that code from Steveorevo, the wordpress install worked and completed.

However, even though I deleted the index.html file, the index.php file won't load--not even if I put in site.com/index.php. Other files in the directory will load, and I put in a text file to make sure nginx was directing to the correct directory.

nvm, now it started working--I guess it just needed time for the conf updates.

Last edited by PermaNoob; 6th November 2013 at 23:03.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Updating and Uploading to Wordpress website on ISPConfig3 - Fedora 13 MrCompTech Tips/Tricks/Mods 8 25th August 2014 14:18
wordpress multisite a0011010011 Installation/Configuration 8 14th February 2012 22:44
ISPConfig 3.x - First Steps (Creating Web Sites, Email Addresses, Etc.) sighkick Suggest HOWTO 18 7th October 2010 00:12
ispconfig wordpress and directory/file permissions willebanks Installation/Configuration 4 9th March 2010 21:52
wordpress u Amorphous Installation/Configuration 2 10th July 2009 10:00


All times are GMT +2. The time now is 17:08.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.