Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

Suexec error when Checking Configuration

Rumi, October 27, 2008October 27, 2008

I am running Virtualmin 3.62 GPL on CentOS 5.2

After the upgrade to Virtualmin 3.62 today, the system ported me to run configuration re-check. When I do it it returns the error below:

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.

.. your system is not ready for use by Virtualmin.

What would be the easiest way to fix this without endangering the many sites, already hosted on the system, by messing up their config files?

Just disable suexec in Virtualmin (Server Templates:Apache Website:Automatically add appropriate SuExec directive? set it to “No”). Obviously you’re not using it, if scripts are working. 😉

Longer term, if you have less than fully trusted users on your system, I’d suggest getting suexec setup correctly. We provide Apache packages for CentOS 5 that are appropriately configured for use with Virtualmin in our CentOS yum repo.

suEXEC the CGI wrapper

A CGI wrapper is a system that executes scripts in a safe and controlled fashion. It also allows scripts to be executed as the same user and group of the virtual host. This allows scripts to have proper permission to execute and use the users directory tree. It also stops scripts from effecting folders the owner shouldn’t have access to.
Setting up suEXEC

suEXEC can be difficult to setup, it depends on whether you compiled apache yourself, or whether it came with your distribution. Your distribution may have configured suEXEC correctly for you, in which case you’ll just need to enable it. You can check your suEXEC settings with the command:-
suexec -V
In our example we are running RedHat 9, which comes with Apache 2 by default, however suEXEC is not configured properly by default so you need to recompile suEXEC (not the whole of apache) with the correct settings to get it working. Here is our quick guide.

1. Check your suEXEC settings
suexec -V
2. The interesting bit of info is AP_DOC_ROOT. Default is “/var/www”. If this isn’t the same as the directory where your site files are (“/home” for RH9) you’re going to need to recompile it. If it is the same then you’re lucky! You can skip to step 15.
3. Download and decompress the source RPM for httpd.
4. Navigate to the “support” sub folder of the httpd source directory (such as “/usr/src/redhat/SOURCES/httpd-2.0.40/support/”)
5. Edit the file “suexec.h” and change the lines:-
6. #define AP_DOC_ROOT “/var/www”
to the location of your site files such as:-
#define AP_DOC_ROOT “/home”
7. #define AP_HTTPD_USER “apache”
to the user you have set for apache
8. #define AP_LOG_EXEC “/some/long/thing/I’ve/forgot/suexec.log”
to something sensible like:-
#define AP_LOG_EXEC “/var/log/httpd/suexec.log”
9. Now you’ll need to configure the apache source:-
./configure –prefix=/usr/local/apache2
10. Now:-
make
11. And Now:-
make suexec
12. Now replace your old suexec executable with your new one, backing up the old one first:-
cd /usr/sbin
mv suexec suexec.bak
cp /usr/src/redhat/SOURCES/httpd-2.0.40/support/suexec suexec
13. Don’t forget to change the group and owner to the same as the old suexec file!!!
ls -l suexec
chgrp apache suexec
chown apache suexec
14. Now make executable:-
chmod 4510 suexec
15. Ok that’s suexec ready to go. Now open httpd.conf (make a backup first) and add the line:-
LoadModule suexec_module modules/mod_suexec.so
16. Now suexec is in use you can define the user and group that scripts should be executed as for each VirtualHost. In the following examples username and groupname should be swapped with the actual user and group you wan to use. This should be the same as the owner and group of that VirtualHost.
In Apache 2:-
<VirtualHost 111.111.111.111:80>
…
SuexecUserGroup username groupname
…
</VirtualHost>
In Apache 1:-
<VirtualHost 111.111.111.111:80>
…
User username
Group groupname
…
</VirtualHost>
17. Restart apache and away you go!

Configurations (Windows)

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker endian icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx pfsense php Postfix powerdns Proxmox RDP squid SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin XCP-NG zimbra

Topics

Recent Posts

  • Install Jitsi on Ubuntu 22.04 / 22.10 April 30, 2025
  • Key Lessons in life April 26, 2025
  • Create Proxmox Backup Server (PBS) on Debian 12 April 19, 2025
  • Add Physical Drive in Proxmox VM Guest April 19, 2025
  • Mount a drive permanently with fstab in Linux April 16, 2025
  • Proxmox 1:1 NAT routing March 30, 2025
  • Installation steps of WSL – Windows Subsystem for Linux March 8, 2025
  • Enabling Nested Virtualization In Proxmox March 8, 2025
  • How to Modify/Change console/SSH login banner for Proxmox Virtual Environment (Proxmox VE / PVE) March 3, 2025
  • Install Proxmox Backup Server on Debian 12 February 12, 2025

Archives

Top Posts & Pages

  • Install Jitsi on Ubuntu 22.04 / 22.10
©2025 Bots! | WordPress Theme by SuperbThemes