• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Only homepage loads after Plesk migration Drupal server

A.P

New Pleskian
I've just migrated to a new plesk server and after migration, the Drupal 7 sites don't work correctly any more. The home pages load fine, but anything else comes back with "NOT FOUND - The requested document was not found on this server." I've compared the database, php files, etc. on the new server and old and everything seems the same except what worked before on the old now returns this damn 'not found' error. I've searched through Google for some answers and nothing has helped thus far. From what some of those answers report for this type of error include .htaccess file problem. Checking I can't be sure the file under httpdocs/.htaccess is actually being used by drupal because I added garbage at the start and that supposedly causes a website crash, but nothing changed. etc., etc. I believe that Plesk has changed some configuration dealing with .htacess and/or php server config and/or apache config that's messing things up. I'm also guessing that it's the mod_rewrite that Plesk does to function properly that's not working. The sites have been down now in this mode for a couple of days and counting and any and all help much appreciated. Thanks!
 
Hello.
The home pages load fine, but anything else comes back with "NOT FOUND
This looks like a misconfiguration in the chain PHP-Nginx-Apache. Try to use the article below as a base to check and make sure that both servers have the same configuration for the affected domains
1) in PHP Settings (whether the PHP handler served by Nginx or by Apache) and
2) in Apache & Nginx Settings (e.g. Proxy mode checkbox).
In case you find any difference adjusting the settings in accordance with the "old" server is the preferable option to get the fastest resolution.
Site shows 404 not found on Plesk server: nginx error: index.html is not found (2: No such file or directory)
 
I see the difference in PHP setings:
Old server has: run PHP as a FastCGI Application
New and broken server has: run PHP as FPM Application served by nginx -- but the problem is that's the only option it gives, there's no FastCGI Application choice.
How to I force it to FastCGI like the old working server?

Problematic still, old server has Apache & Nginx Settings config option. But there's no such option anywhere for the new server. What to do?

Thanks.
 
>> Problematic still, old server has Apache & Nginx Settings config option. But there's no such option anywhere for the new server. What to do?
Never mind that question--I see the new Plesk has tabs whereas it was all on one page with the old. Apache & Nginx Settings is on one of the side tabs!
 
The absence of the part "served by nginx/served by Apache" in the PHP handler names means Nginx is disabled/not installed on the server. The "Apache & Nginx Settings" menu will be there anyway. In the current Plesk Obsidian for domains, it's in the "Domains -> example.com -> Hosting & DNS tab in the domain card".Screenshot 2022-03-03 at 16.33.20.png


So, in fact, we see that the old server works on PHP FastCGI Application (served by Apache).
To fix the issue it should be enouth:
1) Enable PHP as a FastCGI Application handler for the new server at Tools & Settings > PHP Settings (just click on the required PHP handler to turn it on/off)
2) Select the new handler at Domains -> example.com -> PHP Settings and make sure it is the one that "server by Apache". Or you can simply disable/stop Nginx service in Tools & Settings -> Service management, only Apache handlers will remain then in PHP Settings.

You also might want to make this configuration serverwide for all the affected domains through the Service Plans configuration: Administrator's Guid: Properties of Hosting Plans and Subscriptions: PHP Settings

Just in case, different PHP+Apache+Nginx configurations work differently, especially with CMS. Therefore, it is highly recommended to ensure that the source and target configurations are identical before migrating.
 
Last edited:
Did you check if the .htaccess file is migrated from the old server? That could explain the issues you're having.

What also could lead to problems is incorrect file permissions. These can be checked from the command line:

or via Tools & Settings -> Diagnose & Repair -> File System -> Check
 
Thanks to both of you.
I've determined why I wasn't seeing the FastCGI (only nginx) under the dropdown for PHP support under PHP settings--I found (from https://support.plesk.com/hc/en-us/...are-not-available-in-PHP-settings-on-Plesk-UI) I had to enable Proxy mode under Apache & Nginx settings.

The problem, though, is that once I set FastCGI, it got worse with 500 error instead of loading the page. The file system repair suggested didn't change anything either.

Anyhow, I reverted to nginx and it went back to only loading the homepage and no more 500 error. Then I got some help with riding through ngix, for instance, with the post at Question - drupal 8 in nginx-only mode and others from Google.
Here's what I added under the Additional nginx directives (under Apache & nginx settings), and this did away with the 'Not found' error and got things to work!--
if (!-e $request_filename) { rewrite ^(.+)$ /index.php?q=$1 last; }

Well, at least all the domains work except one (with an old version of Drupal)--this one works only if not logged into Drupal, otherwise, it keeps endlessly redirecting to the same page!!! I've tracked it to some bug in the devel module. However, I can't disable the module because of the endless redirect link that never actually loads the page. I'm not sure how to get over this final hurdle!
 
Old server has: run PHP as a FastCGI Application
New and broken server has: run PHP as FPM Application served by nginx
and this
if (!-e $request_filename) { rewrite ^(.+)$ /index.php?q=$1 last; }
still makes me think that the original configuration was not including Nginx and was working only with the Apache and proper .htaccess files on domains.

The mentioned additional configuration for Nginx usually is written in default CMS .htaccess files. But Nginx won't work with .htaccess, that's why you need this additional configuration while staying with Nginx on the "new" server. We even have an article for those who prefer stay with Nginx + CMS which contains almost the same additional nginx directives: After switching a website to FPM served by nginx in Plesk, it fails to load with "404 Not Found" on all pages except start page

However, since you face additional CMS issues with Nginx, I think the best and fastest option here is to reproduce the original configuration. I suppose the "old" server had no custom configs in "Additional nginx directives" which only proves my assumption on the Nginx absence in your original configuration.

So, have you tried to disable nginx on the "new" server to leave websites in "Apache mode only" (which, currently and unfortunately, can be set only by disabling nginx on the server)? If not, try to do this.
 
Old server has: run PHP as a FastCGI Application
New and broken server has: run PHP as FPM Application served by nginx

Try FPM Application served by Apache ?
 
Try FPM Application served by Apache ?
PHP handlers by Apache still involves Nginx as a proxy when it's enabled on the server which will ignore .htaccess. Simply selecting some PHP handler "served by Apache" would not be enough. That's why in my last reply I recommended explicitly disabling Nginx on the server.

To bring the sites back online after the migration it should be enough.

If the goal is to make websites to work on a new configuration including Nginx, I think it deserves a separate discussion.
 
.htaccess files are handled by Apache when using nginx as a reverse proxy
Double-checked, you are right @Dave W . It should work as well. So, either set PHP handler served by Apache or disable Nginx if not needed (if both work, disabling Nginx is less preferable because Nginx still has its proxy benefits).
 
Thanks all. I've found a workaround to the endless redirect. Since I couldn't load pages and so couldn't disable any module, I figured how to do it from the MySQL database. So, disabling the devel module and submodules wasn't it as that did nothing to endless redirects. Then I scanned through the modules for anything else that could be causing redirect problems and saw a Global redirect module and a Path redirect module. Disabling the Path redirect wasn't it either, but once I disabled the Global redirect, the endless redirecting stopped. There are some minor issue such as some pages loosing formatting, but that's minor and can be easily fixed. The major thing is that I'm still on Nginx, and everything is now acceptably operational.
 
Back
Top