WordPress.org

Forums

[resolved] Nginx+ WP Multisite - "Warning: An existing WordPress network was detected" (6 posts)

  1. javipas
    Member
    Posted 2 years ago #

    I'm trying to setup WordPres multisite under Debian 6, Nginx, PHP5-FPM and MySQL.

    I've followed the Codex, so these has been my steps:

    1) Deployed a Debian 6 image on a new Linode 512 VPS

    2) Installed Nginx, PHP5-FPM, MySQL

    3) Downloaded an installed WordPress 3.5 (the Spanish version, though this shouldn't make a difference)

    4) Edited wp-config.php to add the needed

    /* Multisite */
    define('WP_ALLOW_MULTISITE', true);

    As shown on the WordPress Codex (http://codex.wordpress.org/Create_A_Network#Step_2:_Allow_Multisite)

    5) I get the Network Setup option on my dashboard, so I go there, select subdomains (not subdirectories, although I've tried also this).

    6) Once I save the configuration and reloaded the page, it asks me to add a few more lines to the wp-config.php file as expected:

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', true);
    define('DOMAIN_CURRENT_SITE', 'site1.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    7) I can't use the .htaccess entries, so I've followed this WordPress support post from a user that had success at this:

    http://wordpress.org/support/topic/nginx-php-fpm-php-apc-wordpress-multisite-subdirectory-wp-super-cache?replies=59

    The Nginx config files are three: the main one,

    http://pastebin.com/vh4SD0C4

    And the other two that are called

    http://pastebin.com/cJzyMjVr
    http://pastebin.com/4tHz45Xn

    So after applying these changes and restarting Nginx, I reload again the site, but the network setup page gives me a "Warning: An existing WordPress network was detected".

    8) I try to log out and log in again to see if something has changed, but no luck.

    Even with all that changes, I can't get the process to go further than that. I've checked the database and the new tables (wp_blogs, wp_blog_versions, etc) are there. If I drop them, the network setup shows me again the option to select subdomains or subdirectories but I go over and over to step 7). I've uploaded a screenshot of that message here: http://i.imgur.com/yiMmL.jpg

    I think all the problem lies in Nginx, but I think everything should be fine.

    Any ideas??

  2. rahul286
    Member
    Posted 2 years ago #

    So after applying these changes and restarting Nginx, I reload again the site, but the network setup page gives me a "Warning: An existing WordPress network was detected".

    Why are you accessing network-setup page again? If your network is working fine, you won't need to goto "network-setup" page again.

    You can also try a Nginx config from my http://rtcamp.com/wordpress-nginx/tutorial

  3. javipas
    Member
    Posted 2 years ago #

    I've tried your suggestion and used the file from http://rtcamp.com/tutorials/nginx-wordpress-multisite-subdomains-domain-mapping/

    This is the /etc/nginx/sites-available/mysite.com config file:

    map $http_host $blogid {
    default -999;

    #Must Read - http://rtcamp.com/tutorials/nginx-maps-wordpress-multisite-static-files-handling/
    #foo.example.com 3;
    #bar.example.com 4;
    }
    server {
    #@DM - uncomment following line for domain mapping or you will need to add every mapped-domain to server_name$
    listen 80;
    server_name mysite.com *.mysite.com ;
    #@DM - uncomment following line for domain mapping
    #server_name_in_redirect off;

    access_log /home/myuser/domains/mysite.com/logs/mysite.access.log;
    error_log /home/myuser/domains/mysite.com/logs/mysite.error.log debug;

    root /home/myuser/domains/mysite.com/public_html;
    index index.php;

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

    location ~ \.php$ {
    try_files $uri /index.php;
    include fastcgi_params;
    fastcgi_pass unix:/var/run/php5-fpm-myuser.sock;
    #fastcgi_pass unix:/var/run/php5-fpm.sock;
    #@DM - uncomment following line for wordpress-plugins that uses value of _SERVER["SERVER_NAME"] e.g.
    #fastcgi_param SERVER_NAME $http_host;
    }

    #WPMU Files
    location ~ ^/files/(.*)$ {
    try_files /wp-content/blogs.dir/$blogid/$uri /wp-includes/ms-files.php?file=$1 ;
    access_log off; log_not_found off; expires max;
    }

    #WPMU x-sendfile to avoid php readfile()
    location ^~ /blogs.dir {
    internal;
    alias /home/myuser/domains/mysite.com/public_html/wp-content/blogs.dir;
    access_log off; log_not_found off; expires max;
    }

    location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|$
    access_log off; log_not_found off; expires max;
    }

    location = /favicon.php { access_log off; log_not_found off; }
    location = /robots.txt { access_log off; log_not_found off; }
    location ~ /\. { deny all; access_log off; log_not_found off; }
    }

    No luck though. nd I don't access the network-setup: when I logout and login again the system goes straight to that page. I haven't got the normal WP multisite menu to manage sites, it keeps showing me the network setup, and just that. But always with the message "Warning: An existing WordPress network was detected" :(

  4. javipas
    Member
    Posted 2 years ago #

    I've finally solved the issue. And it was a really stupid change. When asked to add the typical lines:

    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', true);
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'example.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    I was doing it BELOW the "/* That's all, stop editing! Happy blogging. */".

    And all I had to do is to insert those lines ABOVE (over) that line. It works now, and it was not a Nginx issue, just a tiny change on the wp-config.php file.

    Uauh.

  5. javipas
    Member
    Posted 2 years ago #

    Sorry, forgot to mark this as solved.

  6. rahul286
    Member
    Posted 2 years ago #

    Glad to know your issue got fixed. :-)

Topic Closed

This topic has been closed to new replies.

About this Topic