[HOWTO] mod_ruid2

I followed this tutorial exactly as described on a clean installation of DirectAdmin. The only problem now is that I cannot access phpmyadmin anymore, I only get a white screen. Is this a known issue? How can I fix it?
 
Normally this can not happen if nothing else is changed. However, you can try this as a solution.

Code:
chown webapps:webapps /var/www/html -R
It might fix the problem.
 
I accidentally ran "chown webapps:webapps /var/www -R" instead of "chown webapps:webapps /var/www/html -R". What are the default owner settings for /var/www ? Should I use apache:apache or root:root? I want to set it back how it was.

Also I found out the breaking phpmyadmin occurred because of the ./build secure_php command in custombuild. One of the functions added to the disable_functions line in php.ini breaks the phpmyadmin. I need to narrow it down of which one is causing it. It was a clean install so nothing else has changed.
 
Oops... yep, always be very careful when running commands as root.:)

This is the default for /var/www:
Code:
dr-xr-x---  9 webapps apache 4.0K Jul 18 18:55 www

I can't imagine that one of the secure_php functions caused the problem. Could you please tell us which added function you think caused the problem as soon as you find out?
 
Thanks and let me ask some questions:
1:
To be sure the webmail clients etc still works we need to change the owner permissions

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>
I can't see httpd-directories.conf on /etc/httpd/conf/extra/
should I create it?
I have error on SquirrelMail:
Code:
Error opening ../data/default_pref
Default preference file not found or not readable!
Please contact your system administrator and report this error.
-----------------------------
2:
Code:
cd /usr/local/directadmin/data/templates/custom/
Now follow the steps below for each virtual_host2 file you've copied
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

Im using vi editor and just comment this line:
SuexecUserGroup |USER| |GROUP| with # is it enough?
this is part of my virtual_host2*:
Code:
 <IfModule !mod_ruid2.c>
                #SuexecUserGroup |USER| |GROUP|
        </IfModule>
        <IfModule mod_ruid2.c>
                RMode config
                RUidGid |USER| |GROUP|
                RGroups apache |SECURE_ACCESS_GROUP|
        </IfModule>
 
Since DA now install via CB 2 mod_ruid2, i suppose your default templates should work with mod_ruid2 without need to edit them.

Be sure you do have just latest DirectAdmin.

Regards
 
Since DA now install via CB 2 mod_ruid2, i suppose your default templates should work with mod_ruid2 without need to edit them.
Be sure you do have just latest DirectAdmin.
Regards
Thanks Andrea
You mean If upgrade DA to last version mod_ruid2 will install?
My DA is 1.42.1
I installed mod_ruid2 from this [HOWTO] and have web mail problem, post 425
 
No, i mean the edit to virtual_host2 files should not be done.

If you wanna use Custombuild to install mod_ruid2 you need use Custombuild 2,0.

Keep in mind that on CB 2.0 support for PHP 5.2 has been dropped so you will be able just to have PHP 5.3 or PHP 5.4 with mod_ruid2.

Otherwise, if you need to mantain PHP 5.2 you should do more research on virtual_host file modification or hire some one to do this install for you.

Me, Zeiter and other guys on this forum offer this kind of service.

Regards
 
Thanks but its work, and just have a little problem, as I told, cuold you please help:

Thanks and let me ask some questions:
1:

I can't see httpd-directories.conf on /etc/httpd/conf/extra/
should I create it?
I have error on SquirrelMail:
Code:
Error opening ../data/default_pref
Default preference file not found or not readable!
Please contact your system administrator and report this error.
-----------------------------
2:


Im using vi editor and just comment this line:
SuexecUserGroup |USER| |GROUP| with # is it enough?
this is part of my virtual_host2*:
Code:
 <IfModule !mod_ruid2.c>
                #SuexecUserGroup |USER| |GROUP|
        </IfModule>
        <IfModule mod_ruid2.c>
                RMode config
                RUidGid |USER| |GROUP|
                RGroups apache |SECURE_ACCESS_GROUP|
        </IfModule>
 
For problem #1, you should check owner of files in /var/www/html/
For problem #2, your edit should work, wasnt needed but should work

Regards
 
After installing mod_ruid2 is it necessary to enable "Safe Mode" in DirectAdmins "Php Safe Mode Settings"? I also setup CSF and the scan I run there tells me that everything is OK (green). I disabled the "dangerous" php functions directly in the server config.

I just wanna know why "Safe Mode" in DA is turned off by default. I see that "Open BaseDir" is enabled. Should I enable both?
 
Thanks Andrea and Arieh
SquirrelMail problem not solved. I tried:

1-check /etc/httpd/conf/extra/httpd-directories.conf
its fine:
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>

2:
Code:
chown -R webapps:webapps squirrelmail
chown -R webapps:webapps /var/www/html/squirrelmail/data

3:
Code:
cd /usr/local/directadmin/scripts/
./set_permissions.sh email

4:
Code:
touch /var/www/html/squirrelmail/data/default_pref

5:
Code:
 cd /usr/local/directadmin
 cd custombuild
 ./build squirrelmail
cp: `/var/www/html/squirrelmail/data' and `/var/www/html/squirrelmail-1.4.22/data' are the same file
SquirrelMail 1.4.22 installation is done.

Error:
Code:
SquirrelMail version 1.4.22
By the SquirrelMail Project Team
ERROR
Error opening ../data/default_pref
Default preference file not found or not readable!
Please contact your system administrator and report this error
 
What permissions do you have there?

Code:
ls -ld /var/www/html/squirrelmail/data/
?
Code:
ls -ld /var/www/html/squirrelmail/
?
Code:
ls -ld /var/www/html/
?
Code:
ls -ld /var/www/
?
Code:
ls -ld /var/
?
 
Thanks Alex, permissions:
Code:
drwxrwx--- 2 webapps webapps 135168 Mar  4 17:00 /var/www/html/squirrelmail/data/
drwxr-xr-x 16 webapps webapps 4096 Mar  2 15:27 /var/www/html/squirrelmail/
drwxr-xr-x. 5 webapps webapps 4096 Mar  2 15:27 /var/www/html/
dr-xr-x---. 9 webapps apache 4096 Dec  3  2011 /var/www/
drwxr-xr-x. 23 root root 4096 Jan 12  2012 /var/
 
Back
Top