资讯

展开

一键部署LNMP平台脚本

作者:快盘下载 人气:

分享一个一键部署LNMP平台脚本,设置通过systemd管理nginx服务,好用!

#!/bin/bash

yum -y install gcc openssl-devel pcre-devel

tar xf lnmp_soft.tar.gz

cd lnmp_soft/

tar xf nginx-1.12.2.tar.gz

cd nginx-1.12.2/

./configure --with-http_ssl_module --with-http_stub_status_module

make && make install

yum install -y mariadb-server mariadb-devel php php-fpm php-mysql

systemctl enable mariadb.service --now

ss -tlnp | grep :3306

systemctl enable php-fpm.service --now

ss -tlnp | grep :9000

echo "

[Unit]

Description=The Nginx HTTP Server

After=network.target remote-fs.target nss-lookup.target

[Service]

Type=forking

ExecStart=/usr/local/nginx/sbin/nginx

ExecReload=/usr/local/nginx/sbin/nginx -s reload

ExecStop=/bin/kill -s QUIT ${MAINPID}

[Install]

WantedBy=multi-user.target

" > /usr/lib/systemd/system/nginx.service

systemctl start nginx

ss -tlnp | grep :80

加载全部内容

相关教程
猜你喜欢
用户评论
快盘暂不提供评论功能!