LN(A)MP環境快速部署

lnmp集成包下載鏈接:https://pan.baidu.com/s/1CGhiuTIzUIVGzK4PeqfBdg    密碼:n2ie

或者在Linux執行:wget http://mirrors.duapp.com/lnmp/lnmp1.4-full.tar.gz

1.準備工作
初始化安裝,設置永久IP,關閉防火牆
安裝包lnmp1.2-full.tar.gz上傳到服務器
服務器需要3GB以上硬盤剩餘空間
MySQL5.6及MariaDB 10 必須1GB內存
確定yum正常使用
2.快速部署LNMP
#tar -xvzf lnmp1.2-fulll.tar.gz
#cd lnmp1.2
#./install lnmp
* 如需要安裝LNMP或LAMP,將install.sh後面的參數替換爲lnmpa或lamp即可
按上述命令執行後,會出現如下提示
[root@GouplovXim lnmp1.2-full]# ./install.sh lnmp
+------------------------------------------------------------------------+
|          LNMP V1.2 for CentOS Linux Server, Written by Licess          |
+------------------------------------------------------------------------+
|        A tool to auto-compile & install LNMP/LNMPA/LAMP on Linux       |
+------------------------------------------------------------------------+
|          For more information please visit http://www.lnmp.org         |
+------------------------------------------------------------------------+
Please setup root password of MySQL.(Default password: root)
Please enter: 123456 -- 設置mysql的root密碼(不輸入直接回車將會設置爲root)
MySQL root password: 123456
===========================
Do you want to enable or disable the InnoDB Storage Engine?
Default enable,Enter your choice [Y/n]: Y
You will enable the InnoDB Storage Engine
===========================
You have 5 options for your DataBase install.
1: Install MySQL 5.1.73
2: Install MySQL 5.5.42 (Default)
3: Install MySQL 5.6.23
4: Install MariaDB 5.5.42
5: Install MariaDB 10.0.17
Enter your choice (1, 2, 3, 4 or 5): 3
You will Install MySQL 5.6.23
===========================
You have 5 options for your PHP install.
1: Install PHP 5.2.17
2: Install PHP 5.3.29
3: Install PHP 5.4.41 (Default)
4: Install PHP 5.5.25
5: Install PHP 5.6.9
Enter your choice (1, 2, 3, 4 or 5): 5
You will install PHP 5.6.9
===========================
You have 3 options for your Memory Allocator install.
1: Don't install Memory Allocator. (Default) -- 內存是否優化,1不優化,2跟3是兩種優化方式
2: Install Jemalloc
3: Install TCMalloc
Enter your choice (1, 2 or 3): 1
You will install not install Memory Allocator.


Press any key to install...or Press Ctrl+c to cancel -- 整個過程大概45分鐘
安裝成功:
============================== Check install ==============================
Checking ...
Nginx: OK
MySQL: OK
PHP: OK
PHP-FPM: OK
+------------------------------------------------------------------------+
|          LNMP V1.2 for CentOS Linux Server, Written by Licess          |
+------------------------------------------------------------------------+
|         For more information please visit http://www.lnmp.org          |
+------------------------------------------------------------------------+
|    lnmp status manage: lnmp {start|stop|reload|restart|kill|status}    |
+------------------------------------------------------------------------+
|  phpMyAdmin: http://IP/phpmyadmin/                                     |
|  phpinfo: http://IP/phpinfo.php                                        |
|  Prober:  http://IP/p.php                                              |
+------------------------------------------------------------------------+
|  Add VirtualHost: lnmp vhost add                                       |
+------------------------------------------------------------------------+
|  Default directory: /home/wwwroot/default                              |
+------------------------------------------------------------------------+
|  MySQL/MariaDB root password: 123456                          |
+------------------------------------------------------------------------+
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              http://lnmp.org              |
+-------------------------------------------+
nginx (pid 28922 28920) is running...
php-fpm is runing!
SUCCESS! MySQL running (29615)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State      
tcp        0      0 0.0.0.0:46364               0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      
tcp        0      0 :::52859                    :::*                        LISTEN      
tcp        0      0 :::3306                     :::*                        LISTEN      
tcp        0      0 :::111                      :::*                        LISTEN      
tcp        0      0 :::22                       :::*                        LISTEN      
tcp        0      0 ::1:631                     :::*                        LISTEN      
Install lnmp V1.2 completed! enjoy it.
並且Nginx,MySQL,PHP都是running,80和3306端口都存在,並install lnmp V1.2 completed! enjoy it. 的話,說明已經安裝成功

安裝失敗:
=========================================== Check install ===========================================
Check ...
Nginx:OK
MySQL:OK
Error:PHP install failed.
Sorry,Faild to install LNMP!
……

如出現類似上面的提示,則表明安裝失敗,說明沒有安裝成功,說明上面的準備工作沒有做好,例如yum源不能正常使用


3.相關目錄與文件
Nginx目錄: /usr/local/nginx/
MySQL目錄: /usr/local/mysql/
MySQL數據庫目錄: /usr/local/mysql/var/
PHP目錄: /usr/local/php/
PHPMyAdmin目錄: /home/wwwroot/deault/hphmyadmin/
默認網站目錄: /home/wwwroot/default/
Nginx日誌目錄: /home/wwwlogs/
Nginx主配置文件: /usr/local/nginx/nginx.conf
MySQL配置文件: /etc/my.cnf
PHP配置文件: /usr/local/php/etc/php.ini
4.LNMP狀態管理命令
LNMP 狀態管理: lnmp [start|reload|restart|status]
LNMP各個進程狀態管理: lnmp [nginx|mysql|php-fpm] [start|stop|reload|restart|kill|status]
平滑啓動nginx進程 pkill -HUP nginx
檢查nginx配置文件語句錯誤命令 /usr/local/nginx/nginx.conf -t

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章