http://www.smalljacky.com/linux/centos/centos7-install-setup-nginx-mariadb-php-phpmyadmin-lemp/
其餘遇到的問題列在下面
[root@www ~]# rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
文章裡面的這一條會幫你建好/etc/yum.repos.d/nginx.repo這個檔案重點是版本要對,不然會一直安裝失敗
遇到的第一個問題就是
Error: Package: nginx-1.12.2-1.el6.ngx.x86_64 (nginx)
Requires: libpcre.so.0()(64bit)
所以安裝失敗
解決方法參考至:
This happened to me. I updated my EPEL repository with
yum update epel-release
yum install nginx
https://serverfault.com/questions/620684/cant-install-nginx-using-epel-repo-on-centos-7-64bit
--> Finished Dependency Resolution
然後就成功了
遇到的第二個問題是
systemctl start nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" f
因為port號被用走了
nginx: [emerg] bind() to 0.0.0.0:8843 failed (98: Address already in use)
解決方法參考至:
https://serverfault.com/questions/565339/nginx-fails-to-stop-and-nginx-pid-is-missing 之後80port就正常啟動了 遇到的第三個問題
改了設定檔要換port重啟的時候
[emerg] bind() to 0.0.0.0:8843 failed (13: Permission denied)
iptables -I INPUT -p tcp --dport 8843 -j ACCEPT
然後就不小心開錯port了,要怎刪掉?
列出所有規則,前面加上行號
- iptables -L INPUT -n --line-numbers
要刪除某一行的規則
- iptables -D INPUT 1 # 若只有上述那行,那就是 1
- iptables -D INPUT 3 # 若有多行,只要刪除第三行
然後開了還是不行,結果是selinux 的問題,要關掉....
或者加port進去該軟體
http://n.sfs.tw/mymedia/index/10393
解決方法參考至:
http://blog.51cto.com/liuqh/1839889
最後終於正常重啟了QQ
第4個問題mariadb安裝完之後,改port號
同樣參考至:http://n.sfs.tw/mymedia/index/10393
第5個問題
改完port號之後遠端不能登入
mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION
參考至:
https://stackoverflow.com/questions/25777943/failed-to-connect-to-mysql-at-127-0-0-13306-with-user-root-access-denied-for-us
https://stackoverflow.com/questions/8348506/grant-remote-access-of-mysql-database-from-any-ip-address
再來又遇到 /var/run/php-fpm/php-fpm.sock failed (2: No such file or directory)
重開服務,解決
systemctl restart php-fpm
沒有留言:
張貼留言