概述
nginx安装
//1.创建nginx用户
[root@localhost ~]# useradd -r -M -s /sbin/nologin nginx
[root@localhost ~]# id nginx
uid=991(nginx) gid=986(nginx) groups=986(nginx)
//2.安装nginx依赖包
[root@localhost ~]# yum -y install pcre-devel openssl openssl-devel gd-devel gcc gcc-c++
[root@localhost ~]#yum -y groupinstall 'Development Tools'
//3.创建nginx日志文件目录
[root@localhost ~]# mkdir -p /var/log/nginx
[root@localhost ~]# chown -R nginx.nginx /var/log/nginx
[root@localhost ~]# ll -d /var/log/nginx
drwxr-xr-x. 2 nginx nginx 6 Jan 7 20:42 /var/log/nginx
[root@localhost ~]#
//4.下载nginx压缩包,解压并编译安装
[root@localhost ~]# cd /usr/src/
[root@localhost src]# wget http://nginx.org/download/nginx-1.16.1.tar.gz
[root@localhost src]# tar xf nginx-1.16.1.tar.gz
[root@localhost src]# 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]# echo $?
0
[root@localhost nginx-1.16.1]# make -j4 && make install
[root@localhost nginx-1.16.1]# echo $?
0
//5.
[root@localhost nginx-1.16.1]# echo 'export PATH=/usr/local/nginx/sbin:$PATH' > /etc/profile.d/nginx.sh
[root@localhost nginx-1.16.1]# . /etc/profile.d/nginx.sh
[root@localhost nginx-1.16.1]# echo $PATH
/usr/local/nginx/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/root/bin
//6.启动nginx并查看端口号
[root@localhost nginx-1.16.1]# nginx
[root@localhost nginx-1.16.1]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.100.200:6379 0.0.0.0:* LISTEN 43114/redis-server
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 60895/nginx: master
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 1128/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 930/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 935/cupsd
tcp6 0 0 :::111 :::* LISTEN 1/systemd
tcp6 0 0 :::22 :::* LISTEN 930/sshd
tcp6 0 0 ::1:631 :::* LISTEN 935/cupsd
//7.测试
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200108103854749.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV
最后
以上就是呆萌萝莉为你收集整理的LNMT部署nginx安装mysql安装tomcat安装安装Jenkins的全部内容,希望文章能够帮你解决LNMT部署nginx安装mysql安装tomcat安装安装Jenkins所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复