Roundcube and PHP7 virtual host (Invalid request. No data was saved)

Hi,
I need to Update PHP to version 7 for some Wordpress Updates I am running on Nethserver. I use this package by @stephdl https://wiki.nethserver.org/doku.php?id=php-scl to do this. I can configure the virtual host. Everything is fine.
BUT: The roundcube instance changes also to PHP7 and fails with the message “Invalid request. No data was saved.” after login (but still on the login page). When I change back to 5.6 everything is good.
I access my website at mydomain.com and the roundcube at mydomain.com/webmail
What can I do to run php7 on my Website and php5 on roundcube?

1 Like

Check the wiki page on wordpress, I made a wordpress version which is able to auto update with rh-php72

Yes, but that will be the same problem, or not? The vHost url is still the same as roundcube and roundcube will use the php7.

This has the same props as the former version so it is compatible, else it is a bug

OK. I have setup a roundcube instance using the Nethserver plugin and a vhost.
If I change the vhosts PHP version, Roundcube is not working anymore. If I change it back to default, everything is OK.

And I think I cannot use your Wordpress module because the consultants that are maintaining the website want to have the “full control” over it and setup everything by their own.

You probably miss a rpm php\* of the php-scl version for your vhost, you have to find what you are missing, check all rpms that the official wordpress install then find the missing rpm in the good php version then install it. You can also check in the log if you have some clues, we could also ping @michelandre to see if he gets some.

Hi Kristian,

You can install a standard WordPress in a vhost without any problem. Just make sure that the vhost directory and all its subdirectory and files have apache:apache for user:group.
Also for security, you can remove rwx for “other” inside the WordPress dir/subdir.

You can have a look at: https://dokuwiki.micronator-dev.org/doku.php?id=nethserver_101_cahier_06_nethserver_wordpress It is in French but you can easily follow the commands.
For the PDF of this document you can get it at: NethServer-101, Cahier-06:NethServer & WordPress – Boutique Micronator, registering is required.

For the PHP, in this document, there is also a description for the installation of the PHP Collection.
I recommend to use PHP-7.2 for the vhost and for the default PHP for the server.
I tried PHP-7.3 with an add-on to NethServer and it failed because of the 7.3, but that was quite a few months ago.

Feel free to ask questions,

Michel-André

PS: You can also install a standard WordPress in /var/www/html. Just make sure that /var/www/cgi-bin and /var/www/html have apache:apache for user:group…

Hi, the WordPress is already running on a vHost. I do not have to set it up.
The only problem is that roundcube is not working when I change the php version to anything else than the default.
Both are using the same top level domain. It feels like because of this the settings for the vHost also apply to to roundcube.

ok we have completely misunderstood your issue

You have installed my rpm nethserver-php-scl to use a major version of php with wordpress, but when you do it roundcube is no more workable

It should not be possible :smiley: because we just use a different php version inside of the vhost of wordpress, and no more.

Definitively you have to go to the apache logs / message logs and search about clues, check if it is not apache which is full down when you change the php settings (check the apache status)

Because I don’t have direct access to the system, I tried to reproduce the issue and was successful. What I did:

  1. Install latest NS7
  2. Update
  3. Install Mailserver and roundcube
  4. Install OpenLDAP Provider
  5. Setup a test user
  6. Test Roundcube/Mail (works)
  7. install the webhosting module
  8. Install the php-scl module
  9. setup a vHost using php7.4
  10. test Roundcube => Fails

What I recognized doing this:
It only fails, when I access Roundcube via domain name (ie. mydomain.intern/webmail). If I access it via IP (i.e. 192.168.0.123/webmail) it works. So it is definetly something that has to do with the domain name.

Will try to reproduce, no time yet, please could you provide some log clues, it surely could help

Hi Kristian,

It looks more like a DNS problem.

Since you are on the local network (192.168.0.0/24), try to add:
192.168.0.123 mydomain.intern
in the hosts file of your station - it will be: C:\Windows\System32\drivers\etc\hosts.
Clear the cache of your station: ipconfig /flushdns and also the cache of your web browser.

Try again,

Michel-André

I just did a quick test, following your instruction, it works as it should roundcubemail is reachable whatever I use php73 or php74 (we use different vhost, I could not catch how it could break roundcubemail)

https://ns7loc13.nethservertest.org/roundcubemail
or
https://192.168.56.14/roundcubemail/

we need more information to debug

  • check logs and try to catch the errors
  • we need the output of : https -S

Can you share your virtualhost settings and the path to the wordpress files?
might be wrong, but is this the case?
“virtualhost” created pointing to TLD (nethservertest.org)
roundcube accessed trough the TLD (instead of the server’s FQDN)

  • roundcube accessed through https://nethservertest.org/roundcubemail
  • wordpress accessed through https://nethservertest.org/

both sharing the same hostname/FQDN

Hi,

I can call the roundcube website, yes. But login does not work anymore.
That is what is happening when you login with valid credentials (the “Invalid request! No data was saved.” message). (If you use wrong credentials, you get the prompt for wrong credentials.)


As @stephdl mentioned: I added the Hostname to the hosts file.

My vhost config is like this (default except PHP version):


image

There is no program called “https”, I think you mean httpd. This is the output of httpd -S:
> VirtualHost configuration:

*:443                  is a NameVirtualHost
         default server wprctest.home.intern (/etc/httpd/conf.d/nethserver.conf:44)
         port 443 namevhost wprctest.home.intern (/etc/httpd/conf.d/nethserver.conf:44)
         port 443 namevhost wprctest.home.intern (/etc/httpd/conf.d/ssl.conf:56)
         port 443 namevhost homepage.home.intern (/etc/httpd/conf.d/virtualhosts.conf:24)
*:80                   is a NameVirtualHost
         default server wprctest.home.intern (/etc/httpd/conf.d/virtualhosts.conf:12)
         port 80 namevhost wprctest.home.intern (/etc/httpd/conf.d/virtualhosts.conf:12)
         port 80 namevhost homepage.home.intern (/etc/httpd/conf.d/virtualhosts.conf:67)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: _RH_HAS_HTTPPROTOCOLOPTIONS
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48

Other Logs:

  • The httpd/error_log has no errors
  • The httpd/access_log shows just the call
    192.168.0.19 - - [20/Nov/2019:08:51:54 +0100] "POST /webmail/?_task=login HTTP/1.1" 200 6147 "https://homepage.home.intern/webmail/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763"
  • The roundcubemail/errors.log shows nothing

I can login, others could you try to reproduce please, we need to reproduce and get some log clues before to fix

I can reproduce but not sure there’s anything to fix (my understanding of vhosts is limited).
I think the problem lies in the way roundcube is being accessed: through the FQDN of the virtualhost + the path suffix (/webmail).

1 Like

IIRC we have moved the vhost of nextcloud to zzz_nexcloud.conf, could you reproduce, solve or break more if you mv roundcubemail.conf to zzz_roundcubemail.conf, think to restart httpd

Same error. For the test I only have roundcube installed from software center and a custom index.html in the vhost.

1 Like

fun, how you vhost is named ?