[HOWTO] mod_ruid2

I'd be happy to. Maybe I should just make a whole new thread? Currently it's quite a mess and lots needs to be changed, added & removed. Ill make some time for it soon.
 
I've got a short method which I always use.
But I don't use squirrelmail so that would work correct for people with squirrelmail.

Would be nice of you if you would make a complete new one for all the people here.
 
The only problem we have with squirrelmail is when moving a user from a machine without mod_ruid2 to a machine with it. We find the prefs file isn't readable. We fix it by changing ownership of all the squirrelmail to webapps:webapps.

Jeff
 
The only problem we have with squirrelmail is when moving a user from a machine without mod_ruid2 to a machine with it. We find the prefs file isn't readable. We fix it by changing ownership of all the squirrelmail to webapps:webapps.

Jeff

we had the same problem only we also needed to change the chmod of the data dir to 711
 
I don't think that should be necessary, did you add RUidGid webapps webapps to <Directory "/var/www/html">, as in the tutorial on page 1? You might have missed it, since it was added later.
 
I'd be happy to. Maybe I should just make a whole new thread? Currently it's quite a mess and lots needs to be changed, added & removed. Ill make some time for it soon.
That would be WONDERFUL! I will be going through our severs soon for security and to add WebDAV using roark's instructions at WebDav Instructions/configuration to support session-based PHP debugging with PHPEd. The current thread would require a lot of time to figure out.
 
I don't think that should be necessary, did you add RUidGid webapps webapps to <Directory "/var/www/html">, as in the tutorial on page 1? You might have missed it, since it was added later.

yes that was also added, after i changed the chmod of the data dir it did work
 
No such file or directory error,


[root@server ~]# chown -R webapps:webapps /var/www/html/squirrelmail/data
chown: cannot access `/var/www/html/squirrelmail/data': No such file or directory
[root@server ~]# cd /var/www/html/squirrelmail/data
-bash: cd: /var/www/html/squirrelmail/data: No such file or directory
[root@server ~]#

Why ?
 
During login, I get this error:

PHP:
ERROR
Error opening ../data/default_pref
Default preference file not found or not readable!
Please contact your system administrator and report this error.
How to fix this ?
 
During login, I get this error:

PHP:
ERROR
Error opening ../data/default_pref
Default preference file not found or not readable!
Please contact your system administrator and report this error.
How to fix this ?

Did you run
chown -R webapps:webapps /var/www/html/squirrelmail/data
as root user ???

You can also try
chmod 711 /var/www/html/squirrelmail/data/
that worked for me
 
During login, I get this error:

PHP:
ERROR
Error opening ../data/default_pref
Default preference file not found or not readable!
Please contact your system administrator and report this error.
How to fix this ?

Also did you change the following

Edit by NoBaloney; see posts 324 and 325, page 17 of this thread:
And last you need to modify httpd-directories.conf
Code:

nano -w /etc/httpd/conf/extra/httpd-directories.conf

Add the RUidGid line below between the <Directory "/var/www/html"> and </Directory>
Code:

<Directory "/var/www/html">
Options -Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
<IfModule mod_suphp.c>
suPHP_Engine On
suPHP_UserGroup webapps webapps
SetEnv PHP_INI_SCAN_DIR
</IfModule>
RUidGid webapps webapps
</Directory>

* Thanks to Arieh for this change.
 
Did you run as root user ???

You can also try that worked for me

Yes, already done:


[root@server custombuild]# sudo chown -R webapps:webapps /var/www/html/squirrelmail/data
[root@server custombuild]# sudo chmod 711 /var/www/html/squirrelmail/data/
[root@server custombuild]#


Still, I get an error after login;

Error opening /var/www/html/squirrelmail/data/default_pref
Default preference file not found or not readable!
Please contact your system administrator and report this error.
 
I encounter new problem;

I tried loging in using the main admin email, i get.

ERROR
You must be logged in to access this page.

I tried creating a new email, still the same error appear after I press "login"

:/
 
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?
 
Back
Top