[HOWTO] mod_ruid2

My guess it's a "check" problem of WHMCS. I had the same problem on installation of some script, I don't remember if it was Centovacast or something else, which definately wanted 777 to get installed. And this script had admin:admin as user so everthing was setup correctly.

Just as Sellerone stated, I installed with 777 and after installation changed back to 755 and there were no problems for good working.
So IMHO some scripts, probably including WHMCS have some (installation and/or working) checks which don't recognize the fact that 777 is not needed anymore. Maybe they don't recognize mod_ruid2.
Joomla and Wordpress don't have this issue, so IMHO it's a script problem, not a mod_ruid2 problem.
 
My guess it's a "check" problem of WHMCS. I had the same problem on installation of some script, I don't remember if it was Centovacast or something else, which definately wanted 777 to get installed. And this script had admin:admin as user so everthing was setup correctly.

Just as Sellerone stated, I installed with 777 and after installation changed back to 755 and there were no problems for good working.
So IMHO some scripts, probably including WHMCS have some (installation and/or working) checks which don't recognize the fact that 777 is not needed anymore. Maybe they don't recognize mod_ruid2.
Joomla and Wordpress don't have this issue, so IMHO it's a script problem, not a mod_ruid2 problem.

Well ok lets forget WHMCS for a moment then, howabout Wordpress? I tried uploading an image using the wordpress/admin and it failed. Thats because the uploads directory was 755. Why did it fail? But i think its all about why all my directories are 711. I can see that now and its probably the reason why WP cant find my themes. Here is the problem.

cd /usr/local/directadmin/scripts && ./set_permissions.sh user_homes
find /home/*/domains/*/public_html -type d -print0 | xargs -0 chmod 711 <------ What the hell!
find /home/*/domains/*/public_html -type f -print0 | xargs -0 chmod 644
find /home/*/domains/*/public_html -type f -name '*.cgi*' -exec chmod 755 {} \;
find /home/*/domains/*/public_html -type f -name '*.pl*' -exec chmod 755 {} \;
find /home/*/domains/*/public_html -type f -name '*.pm*' -exec chmod 755 {} \;
cd /usr/local/directadmin/data/users && for i in `ls`; do { chown -R $i:$i /home/$i/domains/*/public_html;}; done;

Not only will wordpress have an issue with 0711 but WHMCS will never load. WHMCS does not work with those directory perms.
 
Last edited:
find /home/*/domains/*/public_html -type d -print0 | xargs -0 chmod 711 <------ What the hell!
That's odd indeed, I forgot about that in the manual. Maybe Arieh can explain why that's not 755.
 
Use those:

Code:
find /home/*/domains/*/public_html -type d -exec chmod 755 {} \;
find /home/*/domains/*/public_html -type f -exec chmod 644 {} \;
find /home/*/domains/*/public_html -type f -name '*.cgi*' -exec chmod 755 {} \;
find /home/*/domains/*/public_html -type f -name '*.pl*' -exec chmod 755 {} \;
find /home/*/domains/*/public_html -type f -name '*.pm*' -exec chmod 755 {} \;

Regards
 
I ran a test. Not only was my directory perms of 777 not working but my WHMCS failed to load now for 2 days.

So i ran

find /home/mydomain/domains/*/public_html -type d -print0 | xargs -0 chmod 755

Now my whmcs is working again. But the 777 issues still remains.
 
Use those:

Code:
find /home/*/domains/*/public_html -type d -exec chmod 755 {} \;
find /home/*/domains/*/public_html -type f -exec chmod 644 {} \;
find /home/*/domains/*/public_html -type f -name '*.cgi*' -exec chmod 755 {} \;
find /home/*/domains/*/public_html -type f -name '*.pl*' -exec chmod 755 {} \;
find /home/*/domains/*/public_html -type f -name '*.pm*' -exec chmod 755 {} \;

Regards

I cant understand why nobody caught this before.
 
Ah thats a good one. I copied those lines from page one of this tutorial, to be honest I hadn't used them myself as I've only installed new ones. Ill edit it soon.

edit: actually 711 on public_html seems ok.

edit2: I have both on my machine Ill compare some stuff later.
 
Last edited:
Now my wp installations work and my whmcs loads up but still the chmod 777 thing is a mystery. Again, i may uninstall everything and run CB2.0 but i really cant see what i missed. I bet, the results are the same.
 
And of course there are more mysteries. Like for example in the OP's origional writeup he says this;

nano -w virtual_host2.conf
## replace line: SuexecUserGroup |USER| |GROUP|
## replace with: #SuexecUserGroup |USER| |GROUP|
## Add the lines below under the just replaced line
RMode config
RUidGid |USER| |GROUP|
RGroups apache

But when i look at my httpd.conf for users i see

<IfModule !mod_ruid2.c>
SuexecUserGroup user user
</IfModule>

There is no comment # in from of SuexecUserGroup. Should there be?
 
I wish people would update their writeups. I mean anyone setting this up cant be expected to read 24 pages to find the latest changes.

NOT EVEYONE will use custom CB2.0. Why, because it doesnt support php 5.2 for instance. I need 5.2 and 5.3 running and since CB2.0 does not support 5.2 i have to do it manually. Many reasons why i need 5.2. One is that Zend works with 5.2 while its not support with 5.3. And we have many scripts zend encoded that need to continue to run.
 
Last edited:
Apart from maybe that 711 my article should be up to date. Also most of us here are just as much involved with DA as you are, no one is stopping you from writing something :)
 
I need to run 5.3 as CLI and 5.2 as CGI. But i still want to run it under mod_ruid2. Anyone have any which way i should go?
I cant run it from CB1.2 because it does not support mod_ruid2 and i cant run it from CB2.0 because it does not install php 5.2.

Maybe i can just continue using CB1.2 which is what iv done for 5.3 in CLI mode but as you can see the manual installation of mod_ruid2 does not work on 777 directories.
 
Last edited:
This mod_ruid2 is a complete waste of time and good for the birds.

Iv followed the installation to a tee and there is nothing wrong with my manual installation.

So far it cant handle uploading images into an upload directory chmod 755 in a wordpress installation.
You get an error saying it couldnt copy la di da file to directory because its not writeable. Well mod_ruid2 is running and it shouldnt have this problem.

and it cant handle whmcs which requires the attachements, downloads and templates_c directory to be chmod 777 after installation. If its 0755 it complains that it cant write to those directories. PITA!

Its useless.

I HAVE A TON of Joomla users with installations. I cant wait till they notice that their installations a BORKED! Oh and Installatron. Well thats another question. Mod_Ruid2 may be great for simple installations but forget it otherwise. It even craps out when using LVE. Time to look for another solution.
 
Last edited:
If you mean CloudLinux's LVE then why try mod_ruid2 in the first place, all the important features of CL won't work.

Also really many hosting company's are using mod_ruid2 with success, wordpress, joomla, smarty template, magento, uploading, moving, uploading -- it all works.

If it doesn't for you, you can try fixing it, ask someone else to look at ur setup or otherwise try something else..
 
@pucky,

If you really feel you need to use an insecure and not-recommended setting to make your sites work, then of course you should. But many of us have no problems with mod_ruid2 and WHMCS, and with mod_ruid2 and wordpress with custom templates (including me). So I'd think it very important you figure out the problem you're having rather than revert to an insecure setting.

I'm going to do a new install of WHMCS with mod_ruid2 in the next few days, and I'll report back of anything I had to change to make it work. But as far as images working with WordPress with mod_ruid2, that works fine for me and for my clients.

Jeff
 
I'm having a problem right now.
Mod_ruid2 1.9.8 is installed and it looks as if php is running as apache:acces instead as admin:admin (in this case).
Castcontrol installation is also telling "PHP is running under the 'apache' account".

Httpd.conf looks fine though.
Code:
LoadModule ruid2_module       /usr/lib/apache/mod_ruid2.so
Include /etc/httpd/conf/extra/httpd-phpmodules.conf

User apache
Group apache

# Mod_ruid
RMode config
RUidGid apache access

I'm also seeing that directory's I make via SSH as admin are becoming standardly 775 instead of 755.
How can I fix all this?
 
I don't know if this is a directadmin or a mod_ruid problem. I just discovered that the vhosts aren't created as should be:
This part is present:

Code:
<IfModule !mod_ruid2.c>
                SuexecUserGroup pirates pirates
        </IfModule>

Below this, the following lines should be present but they are not:

Code:
        <IfModule mod_ruid2.c>
                RMode config
                RUidGid admin  admin
                RGroups apache access
        </IfModule>

Who is messing up here, is this a DA bug? DA not detecting mod_ruid2?
 
Back
Top