lnmpa 备份及恢复

服务器类 cpciti 1408℃ 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

 

转载请注明:我的个人学习笔记 » lnmpa 备份及恢复

喜欢 (0)
发表我的评论
取消评论
表情