Centos6 - Vesta面板以及suphp模块安装
- 星期四, 13日 三月, 2014
- 17:51下午
vesta面板基于LANMP环境,简洁开源非常不错,以下代码仅限Centos6有效
安装vesta
yum remove httpd* bind* -y
rm -rf /etc/httpd
wget 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/httpd/conf.d/vesta.conf /usr/local/vesta/data/users/*/conf/web/*.conf
sed -i 's#%home%#/usr/local/vesta/data/users#g' /usr/local/vesta/data/templates/web/httpd/* /usr/local/vesta/data/templates/web/nginx/*
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#mkdir \$HOMEDIR/\$user/conf#\#mkdir \$HOMEDIR/\$user/conf#g" /usr/local/vesta/bin/v-add-user
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
<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
AddType text/html .php
DirectoryIndex index.php
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
EOF