Tuesday, April 13, 2010

The Suexec command on your system is configured to only run scripts under /var/www, but the Virtualmin base directory is /home. CGI and PHP scripts run as domain owners will not be executed.

I had my system running Ubuntu 9.10 Server and after installing Webmin and Virtualmin I came across this problem

The Suexec command on your system is configured to only run scripts under /var/www, but the Virtualmin base directory is /home. CGI and PHP scripts run as domain owners will not be executed.

If you installed using the script provided by virtualmin then you might not have this problem, but when you see this error it is already too late.  The script was only available for Ubuntu LTS, and obviously I didn't install that variation of the OS.  For me to uninstall and try it is too time consuming, thus I have found some easy solutions to fix this error. No compiling involved.

1. Disable Suexec in Virtualmin


1. Use the Virtualmin framed layout;
2. On the left top; click on Virtualmin;
3. Open the + on "System settings";
4. Click "Server Templates";
5. On the right screen; click "Default Settings";
6. On the select box "Edit template section" choose "Apache website";
7. Find the radio button: "Automatically add appropriate SuExec directive" 
8. Choose "no", scroll down and "save"





2. Create a temporary mount between the 2 directories by typing the following command


mount --bind /var/www /home


3. Create a symlink between the 2 directories, similar solution as #2, but a different command.  You first have to move the original /var/www directory, then create the link


rm -fr /var/www
ln -s /home /var/www


Enjoy

2 comments:

deyson thome said...

Thank you my friend, you really help me .... God bless you..... More one thanks...YEHHH!!!!

Victoria John said...

Thank you so much for sharing this informative blog. Your technical information is really useful for me. Keep update your blog.

Regards..

PHP Training in Chennai