訪問https://lnmp.org/install.html按照步驟安裝
當下載執行完
wget -c http://soft.vpser.net/lnmp/lnmp1.3.tar.gz && tar zxf lnmp1.3.tar.gz && cd lnmp1.3 && ./install.shlnmp
要到.install.sh下改一下下載地址,把http直接更換成ftp即可
Nginx狀態管理:/etc/init.d/nginx {start|stop|reload|restart}
MySQL狀態管理:/etc/init.d/mysql {start|stop|restart|reload|force-reload|status}lnmp {start|stop|reload|restart|kill|status}
目錄結構:
Nginx 目錄: /usr/local/nginx/
MySQL 目錄 : /usr/local/mysql/
MySQL數據庫所在目錄:/usr/local/mysql/var/
MariaDB 目錄 : /usr/local/mariadb/
MariaDB數據庫所在目錄:/usr/local/mariadb/var/
PHP目錄 : /usr/local/php/
配置文件:
Nginx主配置(默認虛擬主機)文件:/usr/local/nginx/conf/nginx.conf
添加的虛擬主機配置文件:/usr/local/nginx/conf/vhost/域名.conf
MySQL配置文件:/etc/my.cnf
PHP配置文件:/usr/local/php/etc/php.ini
第一:更改 “mysql” 數據庫里的 “user” 表里的 “host” 項,從”localhost”改稱'%'。?
或者新加條記錄,“host” 項為要訪問的ip地址,并授權。重啟mysql服務。?
第二:在系統防火墻添加例外端口:3306,并允許例外。?
2) 即時生效,重啟后失效?
開啟: service iptables start?
關閉: service iptables stop?
將3306添加到防火墻
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT