Sympl and multisites with domain mapping

Problem Description

I have a testing server on a throwaway Bytemark instance:

mysymplsite.uk a is a wordpress multisite with sub directories rather than subdomains, although the example might not look that way!

in the recent symbiosis past I could add an ip to a server and assign it to the mother site /srv/mysymplsite.uk/config/ip, add the ip and symlink to anyolddomain.tv. The example below:

ln -s /srv/mysymplsite.uk/public/htdocs/ /srv/oh.mysymplsite.uk/public/htdocs

But when I visit https://oh.mysymplsite.uk

I get that 500 error. Is this because the new sympl folders php_session and php_tmp are not in the same directory tree as the mother site?

Will sympl work with a multisite arrangement with domain mapping?

I have 3 projects with this arrangement looking for a new home. :confused:

What is your advice?

Any Error Messages

tail /srv/mysymplsite.uk/public/logs/ssl_error.log

[Tue Jul 21 08:45:13.742716 2020] [php7:error] [pid 23417] [client 54.159.204.4:35038] PHP Fatal error:  Unknown: Failed opening required '/srv/oh.mysymplsite.uk/public/htdocs/index.php' (include_path='.:/usr/share/php') in Unknown on line 0
[Tue Jul 21 09:29:25.796356 2020] [php7:warn] [pid 23420] [client 82.71.25.206:58519] PHP Warning:  Unknown: open_basedir restriction in effect. File(/srv/mysymplsite.uk/public/htdocs/index.php) is not within the allowed path(s): (/srv/oh.mysymplsite.uk/public/:/srv/oh.mysymplsite.uk/php_tmp/:/srv/oh.mysymplsite.uk/php_sessions/) in Unknown on line 0
[Tue Jul 21 09:29:25.796406 2020] [php7:warn] [pid 23420] [client 82.71.25.206:58519] PHP Warning:  Unknown: failed to open stream: Operation not permitted in Unknown on line 0
[Tue Jul 21 09:29:25.796421 2020] [php7:error] [pid 23420] [client 82.71.25.206:58519] PHP Fatal error:  Unknown: Failed opening required '/srv/oh.mysymplsite.uk/public/htdocs/index.php' (include_path='.:/usr/share/php') in Unknown on line 0
[Tue Jul 21 09:30:56.824813 2020] [php7:warn] [pid 7698] [client 82.71.25.206:58527] PHP Warning:  Unknown: open_basedir restriction in effect. File(/srv/mysymplsite.uk/public/htdocs/wp-admin/index.php) is not within the allowed path(s): (/srv/oh.mysymplsite.uk/public/:/srv/oh.mysymplsite.uk/php_tmp/:/srv/oh.mysymplsite.uk/php_sessions/) in Unknown on line 0
[Tue Jul 21 09:30:56.824856 2020] [php7:warn] [pid 7698] [client 82.71.25.206:58527] PHP Warning:  Unknown: failed to open stream: Operation not permitted in Unknown on line 0
[Tue Jul 21 09:30:56.824868 2020] [php7:error] [pid 7698] [client 82.71.25.206:58527] PHP Fatal error:  Unknown: Failed opening required '/srv/oh.mysymplsite.uk/public/htdocs/wp-admin/index.php' (include_path='.:/usr/share/php') in Unknown on line 0
[Tue Jul 21 09:31:42.467171 2020] [php7:warn] [pid 7699] [client 82.71.25.206:58531] PHP Warning:  Unknown: open_basedir restriction in effect. File(/srv/mysymplsite.uk/public/htdocs/index.php) is not within the allowed path(s): (/srv/oh.mysymplsite.uk/public/:/srv/oh.mysymplsite.uk/php_tmp/:/srv/oh.mysymplsite.uk/php_sessions/) in Unknown on line 0
[Tue Jul 21 09:31:42.467946 2020] [php7:warn] [pid 7699] [client 82.71.25.206:58531] PHP Warning:  Unknown: failed to open stream: Operation not permitted in Unknown on line 0
[Tue Jul 21 09:31:42.467962 2020] [php7:error] [pid 7699] [client 82.71.25.206:58531] PHP Fatal error:  Unknown: Failed opening required '/srv/oh.mysymplsite.uk/public/htdocs/index.php' (include_path='.:/usr/share/php') in Unknown on line 0

Environment

  • Sympl Version [10.0]:
  • Sympl Testing Version? [No]
  • Debian Version [Buster]:
  • Hardware Type? [Virtual]
  • Hosted On? [Bytemark]

You should be able to touch config/disable-php-security for each of the sub-sites then tun `sudo sympl-web-configure, which will disable the open_basedir configuration, and should solve the issue.

It’s because the actual target of the symlink isn’t in the authorised path, so PHP isn’t allowed to actually read the files.

It’s a known ‘feature’ at the moment, but when sympl-web gets re-worked, it’ll take these into account when configuring the PHP security.

1 Like

You could also edit the site’s config file in /etc/apache2/sites-available and expand the open_base_dir list to include both locations.
That way you still get some of the security benefit of open_basedir, against the possible disadvantage of breaking the file’s MD5 checksum.

I know it works: I’ve done it myself when caught out in a very similar way!

I added an includeoptional line in the template, so I can add stuff like this without breaking the checksum. This has been discussed as a possible enhancement to sympl, but for now it works for me.

Not that I’d let Wordpress anywhere near my server!

I’ve done that IncludeOptional thing as well. It’s fantastically useful!

Thanks everyone.

For now @Kelduum’s solution has fixed it.

A howto on IncludeOptional would be handy, but thank you @hairydog @Anahata

Have a great day!

Thanks for that, will give that whirl.
:slight_smile: