LNMP架构搭部署及应用

实验

一、LNMP架构解读

  • LNMP平台就是Linux、Nginx、MySQL、PHP的组合架构,类似于apache的网页服务平台
  • 主要用来处理静态页面,apache擅长处理动态页面

二、Nginx服务安装

[root@promote ~]# cd /opt
[root@promote opt]# ls
rh
[root@promote opt]# rz -E
rz waiting to receive.
[root@promote opt]# ls
Discuz_X3.4_SC_UTF8.zip    ncurses-5.6.tar.gz   php-7.1.10.tar.bz2
mysql-boost-5.7.20.tar.gz  nginx-1.12.2.tar.gz  rh
[root@promote opt]# yum -y install pcre-devel zlib-devel make gcc gcc-c++
[root@promote opt]# cd nginx-1.12.2/
[root@promote nginx-1.12.2]# useradd -M -s /sbin/nologin nginx
./configure \
--prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \
--with-http_stub_status_module
[root@promote nginx-1.12.2]# make && make install
[root@promote nginx-1.12.2]# ln -s /usr/local/nginx/sbin/* /usr/local/sbin
[root@promote nginx-1.12.2]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@promote nginx-1.12.2]# vim /etc/init.d/nginx
#!/bin/bash
# chkconfig: - 99 20
# description:Nginx Service Control Script
PROG="/usr/local/nginx/sbin/nginx"
PIDF="/usr/local/nginx/logs/nginx.pid"
case "$1" in
 start)
        $PROG
        ;;
 stop)
        kill -s QUIT $(cat $PIDF)
        ;;
 restart)
        $0 stop
        $0 start
        ;;
 reload)
        kill -s HUP $(cat $PIDF)
        ;;
 *)
        echo "Usage: $0 {start|stop|restart|reload}"
        exit 1
 esac
exit 0
[root@promote nginx-1.12.2]# chmod +x /etc/init.d/nginx    
[root@promote nginx-1.12.2]
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值