directadmin suphp模式设置openbasedir

http://help.directadmin.com/item.php?id=2
http://help.directadmin.com/item.php?id=183
http://forum.directadmin.com/showthread.php?t=29483
最后一个只需要参考下即可


#!/bin/sh
cd /usr/local/directadmin/data/templates
cp virtual_host2*.conf custom
cd custom

sed -i '7 iSetEnv PHP_INI_SCAN_DIR /usr/local/directadmin/data/users/|USER|/php/' virtual_host2_sub.conf
sed -i '7 iSetEnv PHP_INI_SCAN_DIR /usr/local/directadmin/data/users/|USER|/php/' virtual_host2.conf
sed -i '8 iSetEnv PHP_INI_SCAN_DIR /usr/local/directadmin/data/users/|USER|/php/' virtual_host2_secure.conf
sed -i '8 iSetEnv PHP_INI_SCAN_DIR /usr/local/directadmin/data/users/|USER|/php/' virtual_host2_secure_sub.conf
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue

cat>/usr/local/directadmin/scripts/custom/user_create_post.sh</usr/local/lib/php.ini.template
echo "open_basedir = OBD" >>/usr/local/lib/php.ini.template

ls -l /home | grep '^d' |grep -v root| awk '{system("username="$3" /usr/local/directadmin/scripts/custom/user_create_post.sh")}'