+91 88 00 563434 sales@webhostingpeople.net

Our Knowledge Base Articles

Company Blog

How to install suPHP on DirectAdmin

You are here:

On this tutorial we will learn to set up suPHP on DirectAdmin

The suPHP is a instrument for executing PHP scripts with the permission of their homeowners, which signifies that the suPHP can management who can entry a sure file. It consists of a mod_suphp module of apache. Since most PHP scripts run as ‘no person’ person, which implies any customers of the server can execute the file and provides them the flexibility so as to add code to URL and manipulate the file accordingly. The suPHP is an answer for this drawback, that suPHP will cease PHP operating as person ‘no person’, so the recordsdata will be solely written by the person allowed for that file.


Benefits of utilizing suPHP

1) It offers higher safety.

2) It should make any PHP utility equivalent to Mambo extra person pleasant.

3) Can outline customized php.ini file for various customers.

4) It doesn’t permit world writable file (777).

DirectAdmin is a management panel for internet hosting administration by means of that administrator can handle web sites simpler. And it’s suitable with servers like CloudLinux, Crimson Hat, CentOS, Ubuntu, and so on. By default, the DirectAdmin got here with php as CLI possibility. All of the PHP scripts will run as a person ‘apache’.  The suPHP provides higher safety than the mod_php module of apache webserver, because it run the php recordsdata below the account person as a substitute of default person ‘apache’. The DirectAdmin custombuild offers easy method to allow the suPHP on DirectAdmin management panel.


Set up of suPHP

1) Login as root person to the DirectAdmin server. And go to the listing /usr/native/directadmin/custombuild through the use of the next command.

# cd /usr/native/directadmin/custombuild/

2) Run beneath custombuild scripts to vary the DirectAdmin settings.

# ./construct clear

# ./construct replace

# ./construct set php5_cgi sure

# ./construct set php5_cli no

# ./construct all d

# ./construct rewrite_confs

After these scripts run on the server, the suPHP can be put in on the server.

3) As soon as the set up of suPHP is accomplished, you will want to repair the phpMyAdmin, Roundcube, squirrelmail. For that run beneath command.

# ./construct roundcube

# ./construct squirrelmail

# ./construct phpmyadmin

4) Now repair the permissions of all of the recordsdata and directories of the customers by operating the beneath given scripts.

# for i in `/bin/ls /usr/native/directadmin/information/customers/` ; do chown -R $i.$i /house/$i/domains/* ; echo $i ;carried out

# for i in `/bin/ls /usr/native/directadmin/information/customers/` ; do discover /house/$i/domains/ -type f -exec chmod 644 ; ; echo $i ;carried out

# for i in `/bin/ls /usr/native/directadmin/information/customers/` ; do discover /house/$i/domains/ -type d -exec chmod 755 ; ; echo $i ;carried out


Potential errors

1) Customers will see message that ” Apache functioning usually” as a substitute of precise web site.


Run the next command as root person.

# cd /usr/native/directadmin/custombuild/

# ./construct rewrite_confs

2) Apache wouldn’t begin with following error message.

Beginning httpd: httpd: Syntax error on line 17 of /and so on/httpd/conf/httpd.conf: Syntax error on line 1 of /and so on/httpd/conf/additional/httpd-phpmodules.conf: Can not load /usr/lib/apache/mod_suphp.so into server: /usr/lib/apache/mod_suphp.so: can’t open shared object file: No such file or listing



Run the next command as root person.

# ./construct suphp

# ./construct rewrite_confs

Leave a Comment