搭建LNMP環境

安裝依賴包

yum -y yum -y install gcc openssl-devel pcre-devel zlib-devel

#創建用戶沒有可交互的shell

useradd -s /sbin/nologin nginx

#源碼安裝nginX

tar xf /lnmp_soft.tar.gz

cd lnmp_soft/

tar xf nginx-1.12.2.tar.gz

cd nginx-1.12.2/

./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module

make && make install

#安裝數據庫的包

yum -y install mariadb mariadb-server mariadb-devel

yum -y install php php-mysql

yum -y install lnmp_soft/php-fpm-5.4.16-42.el7.x86_64.rpm

#啓動相關服務

systemctl start mariadb

systemctl enable mariad

systemctl start php-fpm

systemctl enable php-fpm

#關閉httpd服務,以免佔用80端口

systemctl stop httpd

#啓動nginX服務

ln -s /usr/local/nginx/sbin/nginx /sbin/

nginx

ss -antpu | grep nginx

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章