linux 下mysql等php的安装 lnmp
生活随笔
收集整理的這篇文章主要介紹了
linux 下mysql等php的安装 lnmp
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
訪問https://lnmp.org/install.html按照步驟安裝
當(dāng)下載執(zhí)行完
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狀態(tài)管理:/etc/init.d/nginx {start|stop|reload|restart}
MySQL狀態(tài)管理:/etc/init.d/mysql {start|stop|restart|reload|force-reload|status}lnmp {start|stop|reload|restart|kill|status}
目錄結(jié)構(gòu):
Nginx 目錄: /usr/local/nginx/
MySQL 目錄 : /usr/local/mysql/
MySQL數(shù)據(jù)庫(kù)所在目錄:/usr/local/mysql/var/
MariaDB 目錄 : /usr/local/mariadb/
MariaDB數(shù)據(jù)庫(kù)所在目錄:/usr/local/mariadb/var/
PHP目錄 : /usr/local/php/
配置文件:
Nginx主配置(默認(rèn)虛擬主機(jī))文件:/usr/local/nginx/conf/nginx.conf
添加的虛擬主機(jī)配置文件:/usr/local/nginx/conf/vhost/域名.conf
MySQL配置文件:/etc/my.cnf
PHP配置文件:/usr/local/php/etc/php.ini
第一:更改 “mysql” 數(shù)據(jù)庫(kù)里的 “user” 表里的 “host” 項(xiàng),從”localhost”改稱'%'。?
或者新加條記錄,“host” 項(xiàng)為要訪問的ip地址,并授權(quán)。重啟mysql服務(wù)。?
第二:在系統(tǒng)防火墻添加例外端口:3306,并允許例外。?
2) 即時(shí)生效,重啟后失效?
開啟: service iptables start?
關(guān)閉: service iptables stop?
將3306添加到防火墻
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
總結(jié)
以上是生活随笔為你收集整理的linux 下mysql等php的安装 lnmp的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: hadoop+hive-0.10.0完全
- 下一篇: 分区分表实验用的语句