Quantcast
Channel: EasyEngine Community Forum - Latest posts
Viewing all articles
Browse latest Browse all 12639

Multisite setup with Domain Mapping (SSL etc.)

$
0
0

Hello there!

I set up a single WordPress site with Domain: domain.com
( ee site create domain.com --wp --php7 --letsencrypt )

Later in project development we decided to expand this single WP installation to a multisite network.

So I ran ee site update domain.com --wpsubdom

The update went through without issues.

I then set up Domain Mapping without extra plugin installation by editing site-available domain.com-file in nginx by adding another domain to the server name line like so:

# Uncomment the following line for domain mapping
# listen 80 default_server;

server_name domain.com  *.domain.com  domain2.com *.domain2.com;

# Uncomment the following line for domain mapping
server_name_in_redirect off;

Then I added another site to my new multisite network under Domain: domain2.com

After that there were two sites in my multisite network: domain.com and domain2.com

Domain.com was working fine also in wp admin. However when triying to login to the wp admin of the domain2.com it wouldnt let me. Also was I not able to access network wp-admin.

So I checked wp-config.php and added the following lines to the newly added lines when ee-updating to multisite in wp-config.php:

done by ee:
define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'domain.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );/* That's all, stop editing! Happy blogging. */

my addition:
define( 'NOBLOGREDIRECT', 'domain.com' );
define('ADMIN_COOKIE_PATH', '/');
define('COOKIEPATH', '');
define('SITECOOKIEPATH', '');
define( 'COOKIE_DOMAIN', $SERVER[ 'HTTPHOST' ] );

Now I was able to log into network wp-admin as well as accessing both domain.com and domain2.com wp-admin areas.

However, I once in a while am seeing a cookie issue when trying to switch to network admin from domain.com wp-admin oder domain2.com wp-admin area.

And today I am completely unable to access network wp-admin area. Even after clearing cookies and browser cache.

Something seems to be missing in the nginx configuration. There needs to be some work done on easyengine to handle this better.

Also the script that is handling the letsencrypt SSL certs is not compatible with wp multisite on easyengine.
This needs improvement.

I solved the issue by disabling letsencrypt on domain.com and instead adding a multi domain SSL cert issued by PositiveSSL, which covers the planned domains within multisite network.

Back to my initial problem:

Does anyone of you have an idea, why I am seeing random cookie issues? And why it wont let me access network wp-admin all of a sudden?

Best
Saskia


Viewing all articles
Browse latest Browse all 12639

Trending Articles