官方使用手冊(https://github.com/licess/lnmp)
?sudo ?/etc/init.d/php-fpm restart修改php.ini后重啟php-fpm
cd /usr/local/nginx/conf/vhost/ 虛擬主機配置文件
[if !supportLists]?[endif]LNMP官網:https://lnmp.org
[if !supportLists]?[endif]作者: licessadmin@lnmp.org
[if !supportLists]?[endif]問題反饋&技術支持論壇:https://bbs.vpser.net/forum-25-1.html
[if !supportLists]?[endif]打賞捐贈:https://lnmp.org/donation.html
如斷線可使用screen -r lnmp?恢復。詳細安裝教程參考:https://lnmp.org/install.html
執行:./pureftpd.sh?安裝,可使用?lnmp ftp {add|list|del}?進行管理。
執行:./upgrade.sh?按提示進行選擇 也可以直接帶參數:./upgrade.sh {nginx|mysql|mariadb|php|phpa|m2m|phpmyadmin}
[if !supportLists]?[endif]參數: nginx 可升級至任意Nginx版本。
[if !supportLists]?[endif]參數: mysql 可升級至任意MySQL版本,MySQL升級風險較大,雖然會自動備份數據,依然建議自行再備份一下。
[if !supportLists]?[endif]參數: mariadb 可升級已安裝的Mariadb,雖然會自動備份數據,依然建議自行再備份一下。
[if !supportLists]?[endif]參數: m2m 可從MySQL升級至Mariadb,雖然會自動備份數據,依然建議自行再備份一下。
[if !supportLists]?[endif]參數: php 僅適用于LNMP,可升級至大部分PHP版本。
[if !supportLists]?[endif]參數: phpa 可升級LNMPA/LAMP的PHP至大部分版本。
[if !supportLists]?[endif]參數: phpmyadmin 可升級phpMyadmin。
[if !supportLists]?[endif]參數: xcache 安裝時需選擇版本和設置密碼,http://yourIP/xcache/?進行管理,用戶名 admin,密碼為安裝xcache時設置的。
[if !supportLists]?[endif]參數: redis 安裝redis
[if !supportLists]?[endif]參數: memcached 可選擇php-memcache或php-memcached擴展。
[if !supportLists]?[endif]參數: opcache 可訪問http://yourIP/ocp.php?進行管理。
[if !supportLists]?[endif]參數: eaccelerator 安裝。
[if !supportLists]?[endif]參數: apcu 安裝apcu php擴展,支持php7,可訪問http://yourIP/apc.php?進行管理。?請勿安裝多個緩存類擴展模塊,多個可能導致網站出現問題!
[if !supportLists]?[endif]IonCube安裝執行:./addons.sh {install|uninstall} ionCube。
[if !supportLists]?[endif]可選2,數據庫安裝執行:./install.sh db?可以直接單獨安裝MySQL或MariaDB數據庫。
[if !supportLists]?[endif]可選4,執行:./reset_mysql_root_password.sh?可重置MySQL/MariaDB的root密碼。
[if !supportLists]?[endif]可選5,執行:./check502.sh?可檢測php-fpm是否掛掉,502報錯時重啟,配合crontab使用。
[if !supportLists]?[endif]可選6,執行:./cut_nginx_logs.sh?日志切割腳本。
[if !supportLists]?[endif]可選7,執行:./remove_disable_function.sh?運行此腳本可刪掉禁用函數。
[if !supportLists]?[endif]設置如下環境變量即可完全無人值守安裝
變量名變量值含義
LNMP_Auto啟用無人值守自動安裝
DBSelect數據庫版本序號
DB_Root_Password數據庫root密碼(不可為空),不安裝數據庫時可不加該參數
InstallInnodb是否安裝Innodb引擎,y 或 n ,不安裝數據庫時可不加該參數
PHPSelectPHP版本序號
SelectMalloc內存分配器版本序號
ApacheSelectApache版本序號,僅LNMPA和LAMP模式需添加該參數
ServerAdmin管理員郵箱,僅LNMPA和LAMP模式需添加該參數
[if !supportLists]?[endif]各程序版本對應序號
MySQL版本對應序號PHP版本對應序號內存分配器對應序號Apache版本對應序號
MySQL 5.11PHP 5.21不安裝1Apache 2.21
MySQL 5.52PHP 5.32Jemalloc2Apache 2.42
MySQL 5.63PHP 5.43TCMalloc3??
MySQL 5.74PHP 5.54????
MariaDB 5.55PHP 5.65????
MariaDB 10.06PHP 7.06????
MariaDB 10.17PHP 7.17????
MariaDB 10.28PHP 7.28????
不安裝數據庫0??????
[if !supportLists]?[endif]以LNMP模式,默認選項安裝MySQL 5.5、MySQL root密碼設置為lnmp.org、啟用InnoDB、PHP 5.6、不安裝內存分配器為例,先執行(建議先運行screen),再下載解壓lnmp安裝包:
[if !supportLists]?[endif]卸載LNMP、LNMPA或LAMP可執行:./uninstall.sh?按提示選擇即可卸載。
[if !supportLists]?[endif]LNMP/LNMPA/LMAP狀態管理:lnmp {start|stop|reload|restart|kill|status}
[if !supportLists]?[endif]Nginx狀態管理:lnmp nginx或/etc/init.d/nginx {start|stop|reload|restart}
[if !supportLists]?[endif]添加:lnmp vhost add
[if !supportLists]?[endif]刪除:lnmp vhost del
[if !supportLists]?[endif]列出:lnmp vhost list
[if !supportLists]?[endif]數據庫管理:lnmp database {add|list|edit|del}
[if !supportLists]?[endif]FTP用戶管理:lnmp ftp {add|list|edit|del|show}
[if !supportLists]?[endif]SSL添加:lnmp ssl add
[if !supportLists]?[endif]通配符/泛域名SSL添加:lnmp dnsssl {cx|ali|cf|dp|he|gd|aws}?需依賴域名dns api
[if !supportLists]?[endif]PHPMyAdmin:http://yourIP/phpmyadmin/
[if !supportLists]?[endif]phpinfo:http://yourIP/phpinfo.php
[if !supportLists]?[endif]PHP探針:http://yourIP/p.php
[if !supportLists]?[endif]Xcache管理界面:http://yourIP/xcache/
[if !supportLists]?[endif]Zend Opcache管理界面:http://yourIP/ocp.php
[if !supportLists]?[endif]apcu管理界面:http://yourIP/apc.php
[if !supportLists]?[endif]Nginx:/usr/local/nginx/
[if !supportLists]?[endif]MySQL:/usr/local/mysql/
[if !supportLists]?[endif]MariaDB:/usr/local/mariadb/
[if !supportLists]?[endif]PHP:/usr/local/php/
[if !supportLists]?[endif]多PHP目錄:/usr/local/php5.6/ 版本號隨安裝版本不同而不同
[if !supportLists]?[endif]PHP擴展插件配置文件目錄:/usr/local/php/conf.d/
[if !supportLists]?[endif]PHPMyAdmin:/home/wwwroot/default/phpmyadmin/
[if !supportLists]?[endif]默認虛擬主機網站目錄:/home/wwwroot/default/
[if !supportLists]?[endif]Nginx日志目錄:/home/wwwlogs/
[if !supportLists]?[endif]Nginx主配置文件:/usr/local/nginx/conf/nginx.conf
[if !supportLists]?[endif]MySQL/MariaDB配置文件:/etc/my.cnf
[if !supportLists]?[endif]PHP配置文件:/usr/local/php/etc/php.ini
[if !supportLists]?[endif]PHP-FPM配置文件:/usr/local/php/etc/php-fpm.conf
[if !supportLists]?[endif]PureFtpd配置文件:/usr/local/pureftpd/etc/pure-ftpd.conf
[if !supportLists]?[endif]Apache配置文件:/usr/local/apache/conf/httpd.conf
參數名稱參數介紹例子
Download_Mirror下載鏡像一般默認,如異常可修改下載鏡像
Nginx_Modules_Options添加Nginx模塊或其他編譯參數--add-module=/第三方模塊源碼目錄
PHP_Modules_Options添加PHP模塊或編譯參數--enable-exif 有些模塊需提前安裝好依賴包
MySQL_Data_DirMySQL數據庫目錄設置默認/usr/local/mysql/var
MariaDB_Data_DirMariaDB數據庫目錄設置默認/usr/local/mariadb/var
Default_Website_Dir默認虛擬主機網站目錄位置默認/home/wwwroot/default
Enable_Nginx_OpensslNginx是否使用新版openssl默認 y,建議不修改,y是啟用并開啟到http2
Enable_PHP_Fileinfo是否安裝開啟php的fileinfo模塊默認n,根據自己情況而定,安裝啟用的話改成 y
Enable_Nginx_Lua是否為Nginx安裝lua支持默認n,安裝lua可以使用一些基于lua的waf網站防火墻
技術支持論壇:https://bbs.vpser.net/forum-25-1.html
?
?/usr/local/nginx/sbin/nginx -t 測試配置文件是否錯誤
chattr?-i?/home/wwwroot/yoursite/.user.ini? 不能刪除user.ini時使用