Nginx安装
来源:互联网 发布:京东和淘宝联盟类似 编辑:程序博客网 时间:2024/06/06 20:18
- 配置多台Tomcat:
- 路径:conf/server.xml
- 分别修改Tomcat服务器端口号。如:8080/8081/8082。。。
- 启动之后查看端口号:
- 命令:netstat -apn|grep 80XX
- 安装Nginx:
- 查看是否安装gcc:
- 命令:gcc -v
- 通过yum安装Nginx:
[root@leixin ~]# rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
[root@leixin ~]# yum install nginx
[root@leixin ~]# service nginx start
- 启动Nginx:
- 命令:service nginx start
- 查看Nginx端口:
- 命令:ps -ef|grep nginx / netstat -ap|grep nginx
这种安装和从源代码编译Nginx的安装完全不一样,安装完执行下面的命令
[root@leixin ~]# find / -name *nginx*
/etc/nginx/nginx.conf
[root@leixin ~]# whereis nginx
nginx: /usr/sbin/nginx /etc/nginx /usr/share/nginx
你会发现主要文件安装到了/etc/nginx下
接下来是启动Nginx服务,可以执行
[root@leixin ~]# service nginx start
正在启动 nginx: [确定]
启动成功。
接着
[root@leixin ~]# netstat -lntp | grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3680/nginx
[root@leixin ~]# ps -ef | grep nginx
root 3680 1 0 23:43 ? 00:00:00 nginx: master process /usr/sbin/nginx -c
/etc/nginx/nginx.conf
nginx 3681 3680 0 23:43 ? 00:00:00 nginx: worker process
root 3758 3569 0 23:52 pts/1 00:00:00 grep nginx
缺省是一个master,一个slave,可以在配置nginx.conf文件里调整
4.设置开机自动启动
在centos6.5下测试了一下,不用设置
chkconfig nginx on
可以自行开机自动启动
0 0
- nginx笔记:nginx安装
- Nginx-----源码安装nginx
- 【nginx】nginx的安装
- 安装Nginx
- nginx安装
- 安装 nginx
- 安装nginx
- 安装 Nginx
- nginx安装
- Nginx安装
- 安装Nginx
- 安装nginx
- nginx安装
- 安装nginx
- Nginx安装
- nginx安装
- nginx安装
- nginx 安装
- three.js 动画效果01
- hdu 3038 How Many Answers Are Wrong (带权并查集入门)
- JSP_4th_编译指令include
- LDAP认证的两种方式
- 绘制简易窗口
- Nginx安装
- 递归算法反序输出字符串
- leetcode 504. Base 7(easy)
- Error contacting service. It is probably not running.
- mac SourceTree 配置比较工具 Beyond Compare 4
- Python Django基础教程(二)(模板templatetags)
- 选择排序
- tp缓存
- echarts-日历图