lnmpa 备份及恢复

2012/11/17 2546点热度 0人点赞 0条评论

lnmpa比较好用,apache比较好的解决了nginx的502错误问题,nginx做反向代理

lnmpa备份命令

service nginx stop
service mysql stop
service php-fpm stop

service httpd stop
tar zcvf /home/nginx.tar.gz  /usr/local/nginx/conf
tar zcvf /home/mysql.tar.gz  /usr/local/mysql/var
tar zcvf /home/php.tar.gz  /usr/local/php/etc

tar zcvf /home/apache.tar.gz  /usr/local/php/etc

tar zcvf /home/wwwroot.tar.gz  /home/wwwroot

service nginx start
service mysql start
service php-fpm start

service apache start

lnmpa恢复命令

上传所有tar.gz到home目录

service nginx stop
service mysql stop
service php-fpm stop
service httpd stop
tar zxvf nginx.tar.gz
tar zxvf mysql.tar.gz
tar zxvf php.tar.gz

tar zxvf apache.tar.gz

tar zxvf wwwroot.tar.gz
mv  /usr/local/php/etc /usr/local/php/etc-bak
mv  usr/local/php/etc /usr/local/php/etc
mv  /usr/local/nginx/conf /usr/local/nginx/conf-bak
mv /usr/local/mysql/var /usr/local/mysql/var-bak
mv  usr/local/nginx/conf  /usr/local/nginx/conf
mv  /usr/local/apache/conf /usr/local/apache/conf-bak
mv  usr/local/apache/conf  /usr/local/apache/conf
mv usr/local/mysql/var /usr/local/mysql/var
mv home/wwwroot /home/wwwroot
chown -R mysql /usr/local/mysql/var

chown -R www /usr/local/nginx/conf

chown -R www /usr/local/apache/conf

/root/lnmpa restart

 

幸运猪头

保持饥渴的专注,追求最佳的品质

文章评论