[HOWTO] mod_ruid2

By default the data dir is group webapps and owner apache, with chmod 770. It should work with that because both owner and group have full access like that.

If you chown the data dir webapps:webapps, it also works with just chmod 700. The .pref files inside then only need chmod 600, with also webapps:webapps.

As soon as I set data dir's group back to apache with 700/600, I get that error.

So if you have data dir webapps:webapps, and 700 it should work. If it doesn't then mod_ruid2 probably doesn't work correctly.

You could test that by creating a test php file inside /var/www/html/squirrelmail-1.4.22/test.php - chown it webapps:webapps

<?php
file_put_contents('test.txt', 'hello');
?>

run the file at e.g. www.domain.tld/squirrelmail/test.php, see what the owner of text.txt if its created.

Also, after putting RUidGid webapps webapps inside that <Directory, you did restart httpd?


Regarding to your article here: http://wiki.amservers.nl/Mod_ruid2

cd /usr/local/directadmin/custombuild
mkdir -p custom2/ap2/
cp configure/ap2/configure.php5 custom/ap2/
nano custom/ap2/configure.php5


A little bit confusing, is it really custom2 directory to create ? or just custom2 ?

After running, "./build php n"

I get this:


Notice: Following unknown configure options were used:

--with-ttf

Check './configure --help' for available options

/usr/local/directadmin/custombuild/custom/ap2/configure.php5: line 31: --disable-posix: command not found

*** There was an error while trying to configure php. Check the custom/ap2/configure.php5 file

[root@server custombuild]#
 
Post here your current /usr/local/directadmin/custombuild/custom/ap2/configure.php5 as it seems you're missing a "\" sign in not final line.
 
A little bit confuse :)


[root@server scripts]# find /home/*/domains/*/public_html -type d -print0 | xargs -0 chmod 711
[root@server scripts]# find /home/*/domains/*/public_html -type f -print0 | xargs -0 chmod 644
[root@server scripts]# find /home/*/domains/*/public_html -type f -name '*.cgi*' -exec chmod 755 {} \;
[root@server scripts]# find /home/*/domains/*/public_html -type f -name '*.pl*' -exec chmod 755 {} \;
[root@server scripts]# find /home/*/domains/*/public_html -type f -name '*.pm*' -exec chmod 755 {} \;
[root@server scripts]# cd /usr/local/directadmin/data/users && for i in `ls`; do { chown -R $i:$i /home/$i/domains/*/public_html;}; done;
chown: `memcache-3.0.6:memcache-3.0.6': invalid user
chown: `memcache-3.0.6.tgz:memcache-3.0.6.tgz': invalid user
chown: `package.xml:package.xml': invalid user

[root@server users]# chown -R webapps:webapps /var/www/html/squirrelmail/data
[root@server users]# ls
admin memcache-3.0.6 memcache-3.0.6.tgz package.xml
[root@server users]#


Should I delete this, memcache-3.0.6 memcache-3.0.6.tgz package.xml ?
 
I'm guessing you once used /usr/local/directadmin/data/users to install memcache?

It doesn't do any harm, because the dirs it tried to chown simple do not exist.
 
That sounds right, I've modified some parts to mention the enable_dl function. I do leave it in there, so people know the risk.
 
There will be a DA wiki coming soon by Jeff, until that's ready you can find my tutorial here: http://wiki.amservers.nl/Mod_ruid2

If anyone has a addition or correction let me know.
I'm busy right now because of some email issues in my office. I've chosen to correct them by building a vps for my account only and should be following your instructions today to install mod_ruid2. It may be yet another day or two but I need to get to it as soon as possible.

When I've got it working we'll know it's right, and then I'll set up the wiki.

Jeff
 
Can anyone help me why am i getting this error:

after i put

apxs -a -i -l cap -c mod_ruid2.c

it says: -bash: apxs: command not found
 
Hi, i have suphp, and i have a problem with wordpress or joomla ?
mod_ruid2 is better or suphp must be configured. I'm running Centos 5.8
thank you
 
Hello,

i have suphp, and i have a problem with wordpress or joomla ?

Is that your question? I prefer using suPHP and I've never faced any unresolvable issues. So if you have any errors, what are they? Note, with suPHP it's not allowed to set 777 on directories and 666 on php scripts. More to say, there is no even need to do that, all you need is:

1. change owner of your files and directories withing public_html to the account holder name.
2. chown files to 644 and directories to 755 or even 711.

That should solve the most issues. And you should consider removing php directives from .htaccess files.
 
Joomla configuration not writeable

I have configured everything as the how to describes but i still got problems, the config for joomla is not writeable.
 
What you see with

Code:
ls -la ./configuration.php

? In public_html directory with joomla site?

What you see with

PHP:
<?php
var_dump(exec('id'));
?>

Put in a script.php in public_html directory with joomla site, and open the link domain.com/script.php
 
Hi all,

Does anyone have any experience with mod_ruid2 and homepage domain aka yourserver.com/~customer ?

The this we see is that dir's are not writable except if chmod is on 777 also running the site gives problems with 755.

Is there any change this is related to mod_ruid and homepage link or is it possible that th problem is with the script (concrete5) that there is some check for 777 dir's
 
If you use mod_ruid2 every page or file with permission different than 755 (for folder) and 644 (for files) will return an error.

For test a website before dns are updated you should consider to modify hosts file for match the domain name (ex. www.domain.com) with the server ip you wanna point to.

ex. 1.2.3.4 www.domain.com

This is the better way to check the website without have confusion between mod_ruid2, paths, and permissions.

Regards
 
So by default it wont work like this, the question came becouse a customer had this problems.

I dont feel mutch like manually changeing hosts file for every customer that wants to do some testing.

Thanks anyway.
 
Back
Top