永久黄网站色视频免费直播,yy6080三理论日本中文,亚洲无码免费在线观看视频,欧美日韩精品一区二区在线播放
標(biāo)題:
[分享]
wdcpv2升級(jí)v3一鍵腳本
[打印本頁(yè)]
作者:
ropon
時(shí)間:
2017-6-6 13:39
標(biāo)題:
wdcpv2升級(jí)v3一鍵腳本
本帖最后由 ropon 于 2017-6-6 13:44 編輯
#!/bin/bash
#功能描述:
#1、一鍵升級(jí)wdcp為v3.2.2
#2、自動(dòng)導(dǎo)入原v2.5的站點(diǎn)信息
#3、備份原v2.5配置文件到/home/wddata2,若需還原v2.5
# 恢復(fù)備份,然后將現(xiàn)在wddata改名,將/home/wddata2改名為/home/wddata
#
#注意事項(xiàng):
#1、升級(jí)時(shí),請(qǐng)暫停網(wǎng)站,以免數(shù)據(jù)不同步
#2、升級(jí)后,所有FTP用戶都需要重新設(shè)置密碼,也可在使用時(shí)再重設(shè)。
#3、之前部署ssl,若證書(shū)文件存放根分區(qū),請(qǐng)注意備份證書(shū)文件。
#
PATH="/sbin:/bin:/usr/sbin:/usr/bin"
serviceall(){
service nginxd $1
service httpd $1
service mysqld $1
service memcached $1
service pureftpd $1
}
install_ftp(){
service pureftpd stop
wget -c http://dl.wdlinux.cn/files/ftp/pure-ftpd-1.0.42.tar.gz
tar zxvf pure-ftpd-1.0.42.tar.gz
cd pure-ftpd-1.0.42
./configure --prefix=/www/wdlinux/pureftpd-1.0.42 \
--with-puredb \
--with-quotas \
--with-cookie \
--with-virtualhosts \
--with-virtualchroot \
--with-diraliases \
--with-sysquotas \
--with-ratios \
--with-altlog \
--with-paranoidmsg \
--with-shadow \
--with-welcomemsg \
--with-throttling \
--with-uploadscript \
--with-rfc2640 \
--with-ftpwho \
--with-language=simplified-chinese
make
make install
rm -f /www/wdlinux/pureftpd
ln -sf /www/wdlinux/pureftpd-1.0.42 /www/wdlinux/pureftpd
cp configuration-file/pure-config.pl /www/wdlinux/pureftpd/sbin/
chmod 755 /www/wdlinux/pureftpd/sbin/pure-config.pl
mkdir /www/wdlinux/pureftpd/etc -p
touch /www/wdlinux/pureftpd/etc/{pureftpd.passwd,pureftpd.pdb}
rm -f /www/wdlinux/etc/pure-ftpd.conf
wget -c http://www.fsowen.com/conf/ftp/pure-ftpd.conf -O /www/wdlinux/etc/pure-ftpd.conf
}
update_wdcp(){
ind="/www/wdlinux/wdcp"
if [ -f $ind/data/db.inc.php ];then
if [ -d /www/wdlinux/wdcp/phpmyadmin ];then
cp -pR /www/wdlinux/wdcp/phpmyadmin /www/web/default/pma_*****
fi
sed -i 's#/wdcp#/wdcp2#' /www/wdlinux/wdapache/conf/httpd.conf
service wdapache stop
mv $ind /www/wdlinux/wdcp2
wport=`grep "Listen " /www/wdlinux/wdapache/conf/httpd.conf|awk 'NR==4{print}'|awk '{print $2}'`
grep "$wport" /www/wdlinux/wdapache/conf/httpd.conf
if [ $? == 0 ];then
sed -i "s/$wport/8090/g" /www/wdlinux/wdapache/conf/httpd.conf
iptables -I INPUT -p tcp --dport 8090 -j ACCEPT
else
iptables -I INPUT -p tcp --dport $wport -j ACCEPT
fi
iptables-save > /etc/sysconfig/iptables
fi
if [ ! -d $ind ];then
mkdir -p $ind
fi
pushd $ind
filename="wdcp_v3.2.2_64.tar.gz"
wget -c http://dl.wdlinux.cn/files/wdcp/$filename
if [ $? == 0 ];then
tar zxvf $filename
mkdir {logs,tmp,rewrite}
ln -sf bin/wdcp_v3.2.2_64 wdcp
if [ ! -f /bin/mysql ];then
ln -s /www/wdlinux/mysql/bin/mysql /bin/mysql
fi
chown root.root bin favicon.ico html static shell conf -R
chmod 700 data conf shell bin html
ln -sf /www/wdlinux/wdcp/wdcp.sh /etc/rc.d/init.d/wdcp
chkconfig --add wdcp
chkconfig --level 35 wdcp on
pushd $ind
rm -f $filename
fi
}
wdcp_modified(){
serviceall "stop"
mv /home/wddata/ /home/wddata2
mkdir -p /home/wddata
mkdir -p /home/wddata/vhost
mkdir -p /home/wddata/wdcp
pushd /home/wddata/
mv /www/wdlinux/wdcp/etc.tar.gz ./
tar xvzf etc.tar.gz
mv /www/wdlinux/pureftpd/etc /home/wddata/etc/pureftpd_etc
ln -sf /home/wddata/etc/pureftpd_etc /www/wdlinux/pureftpd/etc
cp -pR /home/wddata2/vhost /home/wddata/vhost/apache_vhost
rm -f /www/wdlinux/apache/conf/vhost
ln -sf /home/wddata/vhost/apache_vhost /www/wdlinux/apache/conf/vhost
cp -pR /www/wdlinux/nginx/conf/vhost /home/wddata/vhost/nginx_vhost
mv /www/wdlinux/nginx/conf/vhost/ /home/wddata2/nginx_vhost
ln -sf /home/wddata/vhost/nginx_vhost /www/wdlinux/nginx/conf/vhost
rm -f /www/wdlinux/mysql/var
ln -sf /home/wddata2/var /www/wdlinux/mysql/var
rm -f /www/wdlinux/wdcp2/data
ln -sf /home/wddata2/data /www/wdlinux/wdcp2/data
mv /www/wdlinux/wdcp/conf /home/wddata/wdcp/conf
ln -sf /home/wddata/wdcp/conf /www/wdlinux/wdcp/conf
mv /www/wdlinux/wdcp/data /home/wddata/wdcp/data
ln -sf /home/wddata/wdcp/data /www/wdlinux/wdcp/data
serviceall "start"
service wdcp start
ip=`ifconfig eth0 | grep "inet addr" | awk '{ print $2}' | awk -F: '{print $2}'`
sh /www/wdlinux/wdcp/shell/mysqlrootchp.sh
cp -pR /home/wddata2/var /home/wddata/mysql_data
echo -e "\033[40;32mimport v2.5 data ...\033[40;37m"
echo
sleep 2
curl -c ./cookie_c.txt -F "username=admin" -F "passwd=wdlinux.cn" "http://${ip}:8080/login"
sleep 2
curl -b ./cookie_c.txt "http://${ip}:8080/index?act=import"
echo
sh /www/wdlinux/wdcp/shell/wdcploginchp.sh
}
main(){
bit=`getconf LONG_BIT`
if [ $bit == '32' ] ;then
echo -e "\033[1;40;31m32bit is not support!\033[0m"
exit
fi
if [ ! -d /www/wdlinux/pureftpd-1.0.42 ];then
install_ftp
fi
if [ ! -d /www/wdlinux/wdcp2 ];then
update_wdcp
fi
if [ ! -d /home/wddata2 ];then
wdcp_modified
fi
}
main
echo -e "\033[1;40;31mPlease retain the data reinstall system\033[0m"
echo
echo -e "\033[1;40;31mchown mysql.mysql -R /home/wddata/mysql_data\033[0m"
echo -e "\033[1;40;31mupdate success!\033[0m"
echo
復(fù)制代碼
作者:
samuelly
時(shí)間:
2017-8-20 06:19
樓主,能否留下聯(lián)系方式,我一個(gè)小白級(jí)別的,升級(jí)了下出錯(cuò)了。
作者:
ropon
時(shí)間:
2017-8-21 09:38
回復(fù)
2#
samuelly
www.idiyrom.com
歡迎光臨 WDlinux官方論壇 (http://www.fsowen.com/bbs/)
Powered by Discuz! 7.2