LNMP環境搭建和配置-ubuntu14.04+nginx1.4.6+php5.6+mysql5.6
阿新 • • 發佈:2018-11-09
具體步驟如下:
1. 安裝nginx和php
sudo apt-get update
sudo apt-get -y install nginx
sudo apt-get -y install python-software-properties
sudo apt-get -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get -y install php5.6 php5.6-cli php5.6-fpm php5.6-gd
php5.6-json php5.6-mysql php5.6-readline
sudo apt-get -y install php5.6-mbstring
sudo apt-get -y install php5.6-curl
sudo apt-get -y install php5.6-xml
sudo apt-get -y install php5.6-xmlrpc
sudo apt-get -y install php5.6-xmlseclibs
1. 安裝nginx和php
sudo apt-get update
sudo apt-get -y install nginx
sudo apt-get -y install python-software-properties
sudo apt-get -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get -y install php5.6 php5.6-cli php5.6-fpm php5.6-gd
php5.6-json php5.6-mysql php5.6-readline
sudo apt-get -y install php5.6-mbstring
sudo apt-get -y install php5.6-curl
sudo apt-get -y install php5.6-xml
sudo apt-get -y install php5.6-xmlrpc
sudo apt-get -y install php5.6-xmlseclibs
sudo apt-get -y install php5.6-mcrypt
2. 配置nginx
/etc/nginx/sites-available/default中修改
3. 用xftp下載伺服器上專案的原始碼壓縮檔案到本地,再上傳到新伺服器上解壓,解壓的路徑在步驟2中需要用到(專案根目錄)。
4.安裝mysql5.6
我參考的是這片文章,https://blog.csdn.net/y353027520dx/article/details/77621468(非常感謝作者,很詳細,很實用)
(1)配置下mysql能夠遠端訪問,上述連線有說到
(2)用navicat連線到伺服器上把原來伺服器的資料庫表結構和資料匯入到新伺服器上
資料轉移:參考文章:http://www.bubuko.com/infodetail-2593011.html
(3)確定新伺服器網頁可開啟後,到第4小步驟
(4)用navicat連線到新資料庫,開啟表結構,和原伺服器的表結構進行對比,並修改到一致。測試新伺服器是否可用。
5.參考好文:https://blog.csdn.net/qpggyy/article/details/79398271