centos啟動php-fpm不使用預設9000連接埠Permission denied

來源:互聯網
上載者:User

今天終於有時間想自己撘一套LNMP開發環境,由於之前的開發環境都是公司現有的,用的時候改改配置就OK了,感覺很輕鬆的,但是自己親自動手從安裝虛擬機器到最後一步步搭建LNMP,竟然困難重重,務必腳踏實地,絕對不能眼高於頂。

言歸正傳,就在按照前輩的博文,一步步yum完了nginx和php-fpm之後,想要將項目用的fastcgi連接埠改為非預設的90001的時候,詭異的事情出現了

[root@localhost ~]# service php-fpm start  Starting php-fpm: [18-Nov-2015 22:41:44] ERROR: unable to bind listening socket for address '127.0.0.1:9001': Permission denied (13)[18-Nov-2015 22:41:44] ERROR: FPM initialization failed                                                           [FAILED]

明明是root使用者,明明9001連接埠沒被佔用,怎麼會沒有許可權。百思不得其解

原因竟然是Centos核心中啟用了SELinux

[root@localhost ~]# cat /etc/sysconfig/selinux    # This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:#     enforcing - SELinux security policy is enforced.#     permissive - SELinux prints warnings instead of enforcing.#     disabled - No SELinux policy is loaded.SELINUX=enforcing#SELINUX=disabled# SELINUXTYPE= can take one of these two values:#     targeted - Targeted processes are protected,#     mls - Multi Level Security protection.SELINUXTYPE=targeted 

將SELINUX=enforcing改為SELINUX=disabled並重啟系統 就可以了

何為SELinux。什麼時候需要啟用SELinux,什麼時候不啟用。




相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.