[HOWTO] mod_ruid2

LocNguyen had contacted me and it's resolved now, he also was trying to access it through ip/~user. Although it says so in the wiki, I know also have placed it again under the test script so people won't miss it that easy.
 
I am about to install a new server. I want to use custombuild 2.0 and php cli with mod_ruid2.

Question: In custombuild 2.0, does custombuild do all the needed configuration of mod_ruid2 when I do ./build mod_ruid2?

Or does I need to manually configure settings in mod_ruid2 myself?

Please note, I only want to run ONE version of php, it will be php 5.4.

I haven't tried it myself but from what I know you wouldn't have to do anything manually.
 
I followed the tutorial to install suguiente mod_ruid2 and I have the problem:

Existing installations of wordpress work ok with the permissions set to 755, but new installations of wordpress or prestashop continue to require 777 permissions on some folders and files.

I uploaded the files with filezilla.

What Is Causing This?
 
Seems ownership of new files does not get set correctly.

Which tutorial exactly did you follow? And did you keep in mind that you have to either use the pre-release binaires of DA or use the fix described in this thread and in the guide of Arieh to have it work correctly?
 
It seems that I have solved, failed in a subdomain, the reason is that I had forgotten virtual_host2_sub.conf edit.

I have also changed this:

Code:
        |*if HAVE_RUID2="1"|
        <IfModule mod_ruid2.c>
                RMode config
                RUidGid |USER| |GROUP|
                RGroups apache |SECURE_ACCESS_GROUP|
        </IfModule>
        |*endif|

so ...

Code:
        <IfModule mod_ruid2.c>
                RMode config
                RUidGid |USER| |GROUP|
                RGroups apache |SECURE_ACCESS_GROUP|
        </IfModule>

I'm using version 1.43 DA
 
If you changed it that way, you should be fine now.
This is fixed in the next DA release (probably 1.43.1 or 1.44) and in the current pre-release binaries, in which those changes are not needed anymore.
 
Hello everyone,

Since there are alot of people asking for it, here is my HowTo about mod_ruid2
This is based on my CentOS server with Apache 2.x.

Installing this module its no longer needed to chmod config files to 666 or upload/attachments directories to 777. Since with this module enabled everything @ HTTP will run under the user itself and not 'apache' anymore.

** If you are using mod_ruid instead of mod_ruid2, first of all remove the mod_ruid line from '/etc/httpd/conf/httpd.conf'

First, we are going to install libcap-develAfter this is done we are going to download and install mod_ruid2Now, if you didn't get any errors mod_ruid2 should be installed and added to the '/etc/httpd/conf/httpd.conf'.
Lets confirm mod_ruid2 is addedIf you get any response like below its installed

Now we need to modify the DA httpd.conf templates a little bit to enable mod_ruid2 for the users

Now copy the template files to customNow you have copied the original templates to the 'custom' directory, so they won't be overwritten.
Code:
cd /usr/local/directadmin/data/templates/custom/

Now follow the steps below for each virtual_host2 file you've copiedSave the files and lets rewrite the HTTPd config filesIf you want you can start the rewrite of the HTTPd config files manually, just paste the line below and wait when its doneAfter the rewrite is complete you can restart HTTPd with the command belowNow mod_ruid2 should be installed and you don't need to chmod anymore like 'chmod 666 config.php' or 'chmod 777 uploads'.

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>
* Thanks to Arieh for this change.
End edit by NoBaloney

** Questions with Answers **
-------------------------------------------------------
Q: How can I test this is working?
A: Easy, install some CMS that you are used before. Like Wordpress, Joomla that required (before!!) chmod 666 or 777 to get install/working.

Q: I've dirs/files owned by apache for some users, must I change this?
A: Yes, you need to give the dirs/files owner of the user itself, not apache anymore. Check below
Thanks for snk for the commands below, to fix the owner permissions of the dirs/files* Added '&&' so if they do a typo, it won't change anything.


You are missing a question, or you have a question, please let me know and I'll try to answer them for you! :D

Is this how-to updated and valid now..i am running into problems with file permissions with wordpress and about to follow this guide...please advice what i need to know before following the guide.

Also will anything break if i have manually editted the virtual hosts for some of the users on the server? Will this overide with appropriate settings?

Thanks
 
mod_ruid2 is now part of Custombuild 2.0, the templates should be ok with the default (if you have latest Directadmin) and no edits would be needed.

So if you're using Cb 1.2 (or older) you should consider switch to CB 2.0 unless you are still using PHP 5.2 that is deprecated

Regards
 
mod_ruid2 is now part of Custombuild 2.0, the templates should be ok with the default (if you have latest Directadmin) and no edits would be needed.

So if you're using Cb 1.2 (or older) you should consider switch to CB 2.0 unless you are still using PHP 5.2 that is deprecated

Regards

Well... CB 2.0 could be a bit more stable before changing to it imho.

If you're still on CB 1.2 (which also has php 5.3), you can follow this guide, which is up2date:
http://wiki.amservers.nl/Mod_ruid2


well i am using the most updated directadmin so does that mean i am using CB 2? How do i know what version of CB i am using?

Apache 2.2.22 Running
DirectAdmin 1.40.3 Running
Exim 4.76 Running
MySQL 5.5.14 Running
Named 9.8.2rc1 Running
ProFTPd 1.3.3e Running
sshd Running
dovecot 2.1.3 Running
Php 5.2.17 Installed
 
Well, in options.conf you can see what version are you using.

Also, you are using PHP 5.2, so you are using for sure 1.x

And is not up2date, All software are not up2date from what you listed.

Regards
 
Well, in options.conf you can see what version are you using.

Also, you are using PHP 5.2, so you are using for sure 1.x

And is not up2date, All software are not up2date from what you listed.

Regards


I mean am not sure..but i thought directadmin is updated automatically? So it doesn't update anything else just directadmin? how do i go about updating things?
 
You need to manually updated all those packages, those are not updated when you update directadmin cause different system administrator may want to config/use different versions/release

For update those packages you need to do that via ssh in /usr/local/directadmin/custombuild

If you have no experience with that, or with ssh, i highly suggest to hire a system administrator for do that for you.

Me, Zeiter, NoBaloney and other use does offer those kind of service, feel free in case to pm which one you would prefer for a quote.

Regards
 
You need to manually updated all those packages, those are not updated when you update directadmin cause different system administrator may want to config/use different versions/release

For update those packages you need to do that via ssh in /usr/local/directadmin/custombuild

If you have no experience with that, or with ssh, i highly suggest to hire a system administrator for do that for you.

Me, Zeiter, NoBaloney and other use does offer those kind of service, feel free in case to pm which one you would prefer for a quote.

Regards

If i want to just resolve the issue i have..what is the least thing i can do? Do i just update to CB 2? and that is all? Or what do i update and what commands do i need to run?
 
Well, in options.conf you can see what version are you using.

Also, you are using PHP 5.2, so you are using for sure 1.x

And is not up2date, All software are not up2date from what you listed.

Regards

I have custombuild 1.1
 
Yes it will. For CB 1.1 and 1.2 the template edit is needed until DA 1.43.1 is released.

Will following that guide mess things up? especially if i have manually edited some virtual hosts of certain users?

Just want to be safe because i don't want to destroy my data because of some update
 
I strongly doubg on what you say Richard.

I do have DA 1.43.0 and im using CB 2.0, the default template those have this:

Code:
        |*if HAVE_RUID2="1"|
        <IfModule mod_ruid2.c>
                RMode config
                RUidGid |USER| |GROUP|
                RGroups apache |SECURE_ACCESS_GROUP|
        </IfModule>

mod_ruid2 in CB2.0 is already stable and im using it since about 2 months now.

uberguru, you cant edit a single virtual_host of a user, this will change every user.

Is not an update, is a change of how the things are working on you server, is an apache module.

I dont see how your data should be lost, the most bad thing that should happen is that you dont install/set it correctly and apache will not startup, but reading logs and debugging a bit will let it work back in a few if you know what to do.

Regards
 
Back
Top