Some check to see if the install is successfull.yum -y install libcap-devel
wget http://dave.t0xic.nl/tars/mod_ruid2-0.9.3.tar.bz2
tar xjf mod_ruid2-0.9.3.tar.bz2
cd mod_ruid2-0.9.3
apxs -a -i -l cap -c mod_ruid2.c
SuexecUserGroup should be commented.RMode config
RUidGid |USER| |GROUP|
RGroups apache
Thanks for posting thisJeff on mine installation script i use to install mod_ruid2 from my own repository, use the steps indicated.. and.. download my custom da template from my repo.. so.. on a new install is ok, on an existin one just you will need to rewrite httpd confs using command in post #1
Hi all,
May i know that implementing mod_ruid2 and reset those folders to owned by user and permission with 755 can solve such php injection problem?
it's seem not,
because injection depend on your web script
you mean this php injection is not / may not caused by folder 777 and cracker use this 777 folder to put php script through apache?
uid=503(gayan) gid=503(gayan) groups=48(apache)
find /home/*/domains/*/p*_html -type d -print0 | xargs -0 chmod 711
find /home/*/domains/*/p*_html -type f -print0 | xargs -0 chmod 644
find /home/*/domains/*/p*_html -type f -name '*.cgi*' -exec chmod 755 {} \;
find /home/*/domains/*/p*_html -type f -name '*.pl*' -exec chmod 755 {} \;
find /home/*/domains/*/p*_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/*/p*_html;}; done;
I'm more than a bit lost. I know I can do the first part (wget) before I run setup, but I have no idea where the second part (the template) is. Please help; I'd like to get this done today if possible.Jeff: I guess this is 'easy' possible with custombuild.
My fast reply would be
Custombuild needs to do
Some check to see if the install is successfull.Code:yum -y install libcap-devel wget http://dave.t0xic.nl/tars/mod_ruid2-0.9.3.tar.bz2 tar xjf mod_ruid2-0.9.3.tar.bz2 cd mod_ruid2-0.9.3 apxs -a -i -l cap -c mod_ruid2.c
And custom DA template
SuexecUserGroup should be commented.Code:RMode config RUidGid |USER| |GROUP| RGroups apache
If you update mod_ruid2, I don't think it will overwrite the configuration, since the configuration is located at the custom DA template, not the main httpd.conf or whatelse.
You don't need to make any changes at the default/main php.ini file, only httpd.conf for loading the mod_ruid2 module.
Kind Regards,
Dave
To clarify: If possible I'd like an exact cookbook for changes to make it just work in the original DirectAdmin install, as well as when updating through custombuild. The latter is important; I can't afford to break anything when updating through custombuild.
Thanks.
Jeff
yum -y install libcap-devel
wget http://dave.t0xic.nl/tars/mod_ruid2-0.9.3.tar.bz2
tar xjf mod_ruid2-0.9.3.tar.bz2
cd mod_ruid2-0.9.3
apxs -a -i -l cap -c mod_ruid2.c
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/usr/local/lib/php/|
<VirtualHost |IP|:80 |MULTI_IP|>
|CUSTOM|
|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/cgi-bin/|
ServerName www.|DOMAIN|
ServerAlias www.|DOMAIN| |DOMAIN| |SERVER_ALIASES|
ServerAdmin |ADMIN|
DocumentRoot |DOCROOT|
|CGI|
|USECANONICALNAME|
[COLOR="Red"][B] #SuexecUserGroup |USER| |GROUP|
RMode config
RUidGid |USER| |GROUP|
RGroups apache
[/B][/COLOR] CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log
<Directory |DOCROOT|>
Options +Includes -Indexes
|*if CLI="1"|
php_admin_flag engine |PHP|
<IfModule !mod_php6.c>
php_admin_flag safe_mode |SAFE_MODE|
</IfModule>
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f |USER|@|DOMAIN|'
|*endif|
|*if OPEN_BASEDIR="ON"|
php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
|*if SUPHP="1"|
suPHP_Engine |PHP|
suPHP_UserGroup |USER| |GROUP|
|*endif|
</Directory>
|HANDLERS|
|MIMETYPES|
</VirtualHost>
chown -R diradmin:diradmin custom/
Thanks. For the moment I'll hope that nothing else need be done since it's a new server. Now the question is only how do you update it with CustomBuildl without having to set it up over again?
Anyone?
Thanks.
Jeff
cd /usr/local/directadmin/scripts && ./set_permissions.sh user_homes
find /home/*/domains/*/p*_html -type d -print0 | xargs -0 chmod 711
find /home/*/domains/*/p*_html -type f -print0 | xargs -0 chmod 644
find /home/*/domains/*/p*_html -type f -name '*.cgi*' -exec chmod 755 {} \;
find /home/*/domains/*/p*_html -type f -name '*.pl*' -exec chmod 755 {} \;
find /home/*/domains/*/p*_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/*/p*_html;}; done;
grep 'mod_ruid2' /etc/httpd/conf/httpd.conf
LoadModule ruid2_module /usr/lib/apache/mod_ruid2.so