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

Monday, April 12, 2010

How to change hostname in Ubuntu (for Virtualmin)

In Ubuntu you can check your hostname with the command

hostname -f

And for the purpose of installing webmin, you would need a hostname that is searchable and resolve to your IP address.  Therefore you can set it by editing

sudo pico /etc/hostname
sudo pico /etc/host

and replacing the OLDNAME with the NEWNAME in these files. This will take effect after a reboot.  However to set it immediately, you can simply type

sudo hostname NEWNAME

this should fix your hostname, and it will be much easier to install Virtualmin