lnmt架构搭建

lnmt架构搭建

环境说明:

系统平台 安装的服务
centos7、redhat7 nginx-1.16.1、mysql-5.7、tomcat

1.安装nginx服务

1.首先搭建yum网络源
[root@localhost ~]# rpm -ivh http://mirror.centos.org/centos/7/os/x86_64/Packages/wget-1.14-18.el7_6.1.x86_64.rpm
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@localhost yum.repos.d]# sed -i 's/\$releasever/7/g' /etc/yum.repos.d/CentOS7-Base-163.repo
[root@localhost yum.repos.d]# yum -y install epel-release vim
2.安装开发工具包
[root@localhost ~]# yum groups mark install 'Development Tools'
3.创建nginx组和用户
[root@localhost ~]# groupadd -r nginx
[root@localhost ~]# useradd -r -M -s /sbin/nologin -g nginx nginx
4.安装依赖包
[root@localhost ~]# yum -y install openssl-devel pcre-devel expat-devel libtool gcc gcc-c++ gd-devel
5.下载nginx包并解压(到/usr/local目录中)
[root@localhost ~]# cd /usr/src/
[root@localhost src]# wget http://nginx.org/download/nginx-1.16.1.tar.gz
[root@localhost src]# ls
debug  kernels  nginx-1.16.1.tar.gz
[root@localhost src]# tar xf nginx-1.16.1.tar.gz -C /usr/local/
[root@localhost src]# cd /usr/local/
[root@localhost local]# ls
bin  etc  games  include  lib  lib64  libexec  nginx-1.16.1  sbin  share  src
6.编译安装
[root@localhost local]# cd nginx-1.16.1/
[root@localhost nginx-1.16.1]# ./configure \
--prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \
--with-debug \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_image_filter_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log 
[root@localhost nginx-1.16.1]#  make -j $(grep 'processor' /proc/cpuinfo | wc -l) && make install
8. 配置环境变量并启动服务
[root@localhost ~]# echo 'export PATH=/usr/local/nginx/sbin:$PATH' > /etc/profile.d/nginx.sh[root@localhost ~]# . /etc/profile.d/nginx.sh 
[root@localhost ~]# nginx
[root@localhost ~]# ss -antl
State      Recv-Q Send-Q Local Address:Port                Peer Address:Port              
LISTEN     0      128                *:80                             *:*                  
LISTEN     0      128                *:22                             *:*                  
LISTEN     0      100        127.
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值