Restore failed : No <Directory> section found for mod_fcgid directives

Hi there,

When restoring a backup made on one server to another, I get the following error:

Checking restored PHP execution mode …

Restore failed : No <Directory> section found for mod_fcgid directives

Although I have searched these forums (and Google…) it is not clear what’s causing this error, or how I would go about fixing it. It’s a bit worrying since I can’t restore backups to the backup server!

Any help greatly appreciated.

Webmin version 1.510 and Virtualmin version 3.78.gpl GPL

on both servers.

P.

Not sure if this sheds any light at all, but the (incompletely) imported domain shows the following error if I run Limits and Validation -> Validate Virtual Servers…

Apache website : Missing Apache <Directory> block for HTML directory /home/website.co.uk/public_html

This problem seems to exist for all my virtual servers.

Checking the Services->Configure Website->Virtual Server Options->Edit Directives

Shows that there is in fact a

<Directory /home/website.co.uk/public_html>

directive on the source server but that this has changed to

<Directory /home/website/public_html>

on the target.

So it looks like the restore can’t handle the fact that I have my user/group without the .co.uk, but I DO have the .co.uk on the home directory name.

  1. Create a domain name with the same name as the one you want to restore.

  2. Go to Server Configuration->Change Domain Name

  3. Choose to keep all the settings the same EXCEPT “Change home directory” which should be changed to match the one in the backup.

  4. Do a restore of the domain. This picks up all the existing settings.

The question remains, however, if you are doing a RESTORE operation, surely it should recreate the domain as per the original, not change directory names which the system actually knows are different?

Is there any other solution?
I did not get such kind of problem in my last batch backup/restore 18 months ago.
Thank you

@pierstaylor: My setup is the same as yours in the regard, home directories with FQDN, usernames only first part of domain name.

I’m gonna try to restore a domain backup from my production server to my experimental one and let you know if I run into any snags. :slight_smile:

Oh wait, I just now realized that this is a 6 month old post being “warmed up”… hrmph. :slight_smile:

Still I’d like to report that there occured no such problem as described here in my test restore. The user was named correctly, same as the home directory, and also the Directory directive in Apache is correct.

Current Virtualmin version is 3.82 too, this article refers to an old version.

Virtualmin :
Fcgi & FCGI issues on Ubuntu / Debian

Issue 1:
When changing to FCGI or CGI, if php downloads,
go to conf file and comment phpadmin flag line
php_admin_value engine Off
change to
#php_admin_value engine Off

Issue 2:
When FCGI troubleshooting flops and only Apache handler can be used.
Then try php-fpm because it can run the program as user this way we can save time for changing ownership each time from user to Apache and vice versa.

when install php-fpm
you have start service. upto latest version of virtualmin only one running version of php-fpm can be used.

A proper fpm work require addition add proxy_fcgi module

After installing make sure to goto virtualmin and make it detect
virtualmin -> system configuration -> Re-check configuration

Issue 3:
After changing FCGI or CGI it goes back to Apache / FCGI and CGI does not function

Possible cause I,
if this happens after additional php version is installed.
then
check if lib Apache is changed
go to virtualmin -> system configuration -> Re-check configuration

Check if our php is being detected
if detected, what version of mod_php is used

If mod_php is lower and on back end we have enabled the higher or different version of mod_php disable the module and enable once detected by virtualmin.

Possible cause II,
If a error happens stating something like
Restore failed : No section found for mod_fcgid directives

Then try to check if CGI module is installed.
php(version)-cgi

IF this does not solve still shows directory missing error

That would be probably because the document root and directory command has been edited on back-end

Eg:
docroot should be public_html
but on conf it has git like location
public_html/xyz

make sure you change this using virtualmin website option settings,

in apache config
<Directory /home/user/public_html>

added lines in <Directory “/home/user/public_html”> section of apache config

AddType application/x-httpd-php .php
AddHandler fcgid-script .php7.2
FCGIWrapper /home/user/fcgi-bin/php7.2.fcgi .php7.2
“/home/user/public_html/”

Additionally,
Some issue can be solved by below methods
Rename fcgi-bin, cgi-bin & etc folders in /home/user/ directory.

1 Like