Centos6 - Vesta面板安装suphp
vesta面板基于LANMP环境,简洁开源非常不错,以下代码仅限Centos6有效
安装vesta
yum remove httpd* bind* -y
rm -rf /etc/httpd
curl -O http://vestacp.com/pub/vst-install.sh
bash vst-install.sh -f -n -e [email protected] #换成你的邮箱
安装设置suphp
wget http://down.kvm.la/vesta/cn.txt -O /usr/local/vesta/web/inc/i18n/cn.php
wget http://down.kvm.la/vesta/conf_templates/apache_suphp.tpl -O /usr/local/vesta/data/templates/web/httpd/suphp.tpl
wget http://down.kvm.la/vesta/conf_templates/apache_suphp.stpl -O /usr/local/vesta/data/templates/web/httpd/suphp.stpl
wget http://down.kvm.la/vesta/conf_templates/nginx_suphp.tpl -O /usr/local/vesta/data/templates/web/nginx/suphp.tpl
wget http://down.kvm.la/vesta/conf_templates/nginx_suphp.stpl -O /usr/local/vesta/data/templates/web/nginxsuphp.stpl
wget http://down.kvm.la/vesta/packages/suphp.pkg -O /usr/local/vesta/data/packages/suphp.pkg
chattr -i /home/admin/conf
mv /home/admin/conf /usr/local/vesta/data/users/admin/
sed -i 's#AddDefaultCharset UTF-8#AddDefaultCharset OFF#g' /etc/httpd/conf/httpd.conf
sed -i 's#\$HOMEDIR/\$user/conf/web/ssl.#\$USER_DATA/\$user/ssl/#g' /usr/local/vesta/func/*
sed -i 's#\$HOMEDIR/\$user/conf/#\$VESTA/data/users/\$user/conf/#g' /usr/local/vesta/bin/*
sed -i 's#/home#/usr/local/vesta/data/users#g' /etc/*/conf.d/vesta.conf
sed -i 's/Include %home%/#Include %home%/g' /usr/local/vesta/data/templates/web/httpd/* /usr/local/vesta/data/users/*/conf/web/httpd.conf
sed -i 's/include %home%/#include %home%/g' /usr/local/vesta/data/templates/web/nginx/* /usr/local/vesta/data/users/*/conf/web/nginx.conf
sed -i 's#%/\$HOMEDIR/$user/conf/web/ssl\.#\$USER_DATA/ssl/#g' /usr/local/vesta/*
sed -i 's#en#cn#g' /usr/local/vesta/data/users/*/user.conf /usr/local/vesta/conf/vesta.conf
sed -i "s/PACKAGE='default'/PACKAGE='suphp'/g" /usr/local/vesta/data/users/*/user.conf
sed -i "s/WEB_TEMPLATE='default'/WEB_TEMPLATE='suphp'/g" /usr/local/vesta/data/users/*/user.conf
sed -i "s#chmod a+x \$HOMEDIR/\$user#\#chmod a+x \$HOMEDIR/\$user#g" /usr/local/vesta/bin/v-add-user
sed -i "s#chattr +i \$HOMEDIR/\$user/conf#\#chattr +i \$HOMEDIR/\$user/conf#g" /usr/local/vesta/bin/v-add-user
sed -i "s#chattr -i \$HOMEDIR/\$user/conf#\#chattr -i \$HOMEDIR/\$user/conf#g" /usr/local/vesta/bin/v-delete-user
yum -y --skip-broken install gcc gcc-c++ libtool-libs libtool autoconf subversion zip unzip wget crontabs iptables file bison patch mlocate flex diffutils automake imake make cmake kernel-devel cpp vim-minimal
yum -y --skip-broken install httpd-devel
cd /tmp
wget -c http://www.suphp.org/download/suphp-0.7.1.tar.gz
tar -xzf suphp-0.7.1.tar.gz
cd suphp-0.7.1
./configure --quiet --prefix=/usr --sysconfdir=/etc --with-apr=/usr/bin/apr-1-config --with-apxs=/usr/sbin/apxs --with-apache-user=apache --with-setid-mode=paranoid --with-php=/usr/bin/php-cgi --with-logfile=/var/log/httpd/suphp_log --enable-SUPHP_USE_USERGROUP=yes
make -j12 && make install
wget http://down.kvm.la/conf/suphp.conf -O /etc/suphp.conf
sed -i 's#;x-httpd-php54="php:/opt/php54/bin/php-cgi"#x-httpd-php54="php:/usr/bin/php-cgi"#g' /etc/suphp.conf
if [ `uname -m` == "x86_64" ]; then archlib="lib64"; else archlib="lib"; fi
cat>/etc/httpd/conf.d/php.conf<<EOF
LoadModule suphp_module /usr/$archlib/httpd/modules/mod_suphp.so
<IfModule mod_suphp.c>
<FilesMatch "\.(inc|php|php3|php4|php5|php6|phtml|phps)$">
#AddHandler x-httpd-php52 .inc .php .php3 .php4 .php5 .phtml
#AddHandler x-httpd-php53 .inc .php .php3 .php4 .php5 .phtml
AddHandler x-httpd-php54 .inc .php .php3 .php4 .php5 .phtml
#AddHandler x-httpd-php55 .inc .php .php3 .php4 .php5 .phtml
</FilesMatch>
AddType text/html .php
DirectoryIndex index.php
<Location />
suPHP_Engine on
suPHP_ConfigPath /etc/
suPHP_AddHandler x-httpd-php52
suPHP_AddHandler x-httpd-php53
suPHP_AddHandler x-httpd-php54
suPHP_AddHandler x-httpd-php54
</Location>
</IfModule>
EOF
http://mjjer.kvmla.com
http://hoster.kvmla.com
http://coder.kvmla.com
http://zzer.kvmla.com
none
sed -i 's#%/\$HOMEDIR/$user/conf/web/ssl\.#\$USER_DATA/ssl/#g' /usr/local/vesta/*
上面这一步执行后出现错误提示: sed: couldn't edit /usr/local/vesta/bin: not a regular file
这是正常的?
sed对象是* 通匹配,bin是个文件夹 所以会出现提示,这个不影响。
按照这样的方法,如果重启服务器后,httpd和named无法重启成功,还请教,希望您通过电子邮件回复我,谢谢!