• I have setup multisite on WordPress running on a LEMP stack in order to host two sites on a single WordPress install. Each site has a different domain name. Site 1 was created 6 years ago and is running well. I am now trying to setup site2. So far, I have done the following:

    Setup WordPress at /var/www/wordpress

    Modified wp-config.php to allow multisite and multisubdomains.

    Built and tested a server block for site 2.This was tested with a landing page located at /var/www/html which after testing was modified in the server block to point to /var/www/wordpress

    Set up a separate site which in the network dashboard as a subdomain of the original site (site2.site1.com). Later, this was changed in the settings to https://www.site2.com. Both sites are now listed under My Sites but when I click on site2 it takes me to site1. If I build a new page for site2 it goes to site1.

    I can’t find a way to install the second site files (backed up from an earlier site) or get WP to load anything but site1 material.

    I hope someone knows how to fix this problem.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Modified wp-config.php to allow multisite and multisubdomains.

    1) Besides allowing multisite installation, did you also include the additional multisite configuration rules in your wp-config.php file? (This can be found in My Sites -> Network Admin -> Settings -> Network Setup)

    2) On the same “Network Setup” page, you should also see multisite-specific webserver rewrite rules. But this is only for Apache. As you’re using Nginx, you’ll need to craft appropriate Nginx-specific rewrite rules for the primary site’s server block. Googling “multisite Nginx” (or something similar for your full server stack) should give you lots to chew on.

    BUT PAUSE!

    … and ask yourself: do you really need a complicated multisite setup to hold just two sites? Since you’re doing much of the initial setup work manually, I’d just install two independent WordPress sites and not have to deal with plugins misbehaving in multisite environments.

    Good luck!

    Thread Starter wrknight

    (@wrknight)

    I just now confirmed that the additional define commands to allow multiple subdomains, set paths, ids, etc. are in wp-config.php; and the spelling and syntax are correct. Without those instructions I would not have been able to set up the second site. The problem remains that when I try to create pages or posts for the second site they still get published on the original site.

    In answer to your question, I had thought about that and right now, it’s very appealing. But I may wish to add more sites later which would require more wp installations. Besides that, being the obstinate cuss that I am, I am determined to beat this sucker one way or another.

    Thread Starter wrknight

    (@wrknight)

    Update: I found the following message in debug.log:

    [28-Jan-2025 15:14:03 UTC] PHP Warning: chmod(): Operation not permitted in /var/www/wordpress/wp-admin/includes/class-wp-filesystem-direct.php on line 173

    It appears to be attempting to change the file permissions somewhere, but I can’t figure out which file or where it is. Here’s the php code from class-wp-filesystem-direct.php around line 173

    149 /**

    150 * Changes filesystem permissions.

    151 *

    152 * @since 2.5.0

    153 *

    154 * @param string $file Path to the file.

    155 * @param int|false $mode Optional. The permissions as octal number, usually 0644 for

    156 files,

    157 * 0755 for directories. Default false.

    158 * @param bool $recursive Optional. If set to true, changes file permissions recursively.

    159 * Default false.

    160 * @return bool True on success, false on failure.

    161 */

    162 public function chmod( $file, $mode = false, $recursive = false ) {

    163 if ( ! $mode ) {

    164 if ( $this->is_file( $file ) ) {

    165 $mode = FS_CHMOD_FILE;

    166 } elseif ( $this->is_dir( $file ) ) {

    167 $mode = FS_CHMOD_DIR;

    168 } else {

    169 return false;

    170 }

    171 }

    172 if ( ! $recursive || ! $this->is_dir( $file ) ) {

    173 return chmod( $file, $mode );

    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.