CentrioHost Blog

Stories and News from IT Industry, Reviews & Tips | Technology Blog


Howto Directadmin+Apache 2.2+PHP5+SUPHP+Suexec perfect setup

To configure SUPHP in directadmin is an easy task. There are a number of ways to do it. But this method seems to be a perfect setup for it .

Why this method is better than default suphp?

  • The php will be installed under /usr/local/
  • There is no conflict with multiple server phps
  • The php ini path is /usr/local/lib/php.ini
  • This will help to set correct path for php scripts or crons without modifying the client files
  • No modification for default template , just use custom.
  • Use server mysql for php-mysql client , this will avoid client API conflict
  • Easy to implement

Any Auto installer script ?

Yes you can download an auto installer script fromย here.

How to setup is manually?

Please see the procedure below,

cd /usr/local/directadmin/custombuild
./build clean
./build update
mkdir -pv custom/ap2 
mkdir -pv custom/suphp
rm -rf custom/ap2/*
rm -rf custom/suphp/*
wget -c http://files.centriohost.com/da/conf/suphp/configure.apache.conf
mv -vf  configure.apache.conf  custom/ap2/configure.apache
wget -c http://files.centriohost.com/da/conf/suphp/configure.php5.conf
mv -vf  configure.php5.conf  custom/ap2/configure.php5
cp -vf  custom/ap2/configure.php5 custom/suphp/
wget -c http://files.centriohost.com/da/conf/suphp/configure.suphp.conf
mv -vf configure.suphp.conf custom/suphp/configure.suphp

Now edit /usr/local/directadmin/custombuild/options.conf and make the following changes

php5_cli=no
php5_cgi=yes

Now build apache as follows

./build apache

Now build php as follows

./build php 5

Now create the custom config folder , so that you can simply include all thirdpary php extensions

mkdir -pv /usr/local/lib/php.d

Now make all required soft links

ln -sf  /usr/local/bin/php-cgi /usr/local/bin/php
ln -sf /usr/local/bin/php /usr/bin/php

Now set suphp.conf for the php-cgi location

sed -i 's/x-httpd-php5=.*/x-httpd-php5="php:/usr/local/bin/php-cgi"/g' /usr/local/suphp/etc/suphp.conf

Now set the php.ini location for suphp

sed -i 's/suPHP_ConfigPath.*/suPHP_ConfigPath  /usr/local/lib//g' /etc/httpd/conf/extra/httpd-suphp.conf

Restart apache

/etc/init.d/httpd restart

Testing :

Create a phpinfo page on you domain document root and check it.

Optional Settings:

The following settings are not recommended in a production environment . It will enable user_dir access to your domains and disable some security

Read more about thisย from here

Subscribe Now

10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!

Archive Calendar

SatSunMonTueWedThuFri
 123456
78910111213
14151617181920
21222324252627
282930 

Over 20000 Satisfied Customers!

  • web hosting reviewer
    Valerie Quinn
    CTO, Acteon Group

    Centriohost staff were fantastic, I had a concern with a domain and they got back to me very quickly and they helped me to resolve the issue! ~ . . . Read more

  • Joomla hosting reviewer
    Collin Bryan
    Photographer, Allister Freeman

    I'm using centrio for my portfolio since 2006. The transition was seamless, the support was immediate, and everything works perfectly. ~ . . . Read more

  • dedicated server reviewer
    Harry Collett
    Actor, A&J Artists

    Very easy to understand & use even though I am not very technologically minded. No complications whatsoever & I wouldn't hesitate to recommend it to all. ~ . . . Read more

  • vps web hosting reviewer
    Porfirio Santos
    Technician, Diageo PLC

    Centrio support team have been amazingly responsive and helpful to any of my queries, thank you so much to the Centriohost have been amazingly responsive and helpful to any of my queries ๐Ÿ‘๐Ÿ‘๐Ÿ‘ ~ . . . Read more

  • wordpress hosting plans reviewer
    Catherine Auer
    Doctor, SmartClinics

    Anytime I've had a problem I can't solve, I've found Centriohost to be diligent and persistent. They simply won't let an issue go until the client is happy. ~ . . . Read more

  • reseller hosting reviewer
    Effectivo Social
    Freelancer, Fiverr

    Recommend their shared hosting for all my SME web design clients. Their cloud or VME offerings are too great to deal with. Pricing is perfect and suitable for all users (อ โ‰– อœส–อ โ‰–) ๐Ÿ‘Œ ~ . . . Read more

Top