网站首页 > 技术教程 正文
1、第一步:获取nginx的安装包
wget http://nginx.org/download/nginx-1.7.8.tar.gz
2、解压安装包
tar -xvf nginx-1.7.8.tar.gz
3、执行./configure --prefix=/usr/local/nginx命令报如下错误
报错:./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
解决之法:
yum -y install pcre-devel
4、执行./configure --prefix=/usr/local/nginx命令报如下错误
报错:./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.
解决之法:
yum -y install pcre-devel openssl openssl-devel
5、执行如下命令:
./configure --prefix=/usr/local/nginx
6、执行如下命令:
make
7、执行如下命令:
make install
8、启动nginx
启动代码格式:nginx安装目录地址 -c nginx配置文件地址
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
9、访问nginx
curl nginx所在后台的IP地址:端口(默认80)
eg:
表示nginx安装成功
10、强制停止nginx
pkill -9 nginx
11、更改nginx的端口
修改配置文件路径:/usr/local/nginx/conf/nginx.conf
修改为你需要的端口:
重启nginx生效
12、同一linux后台安装多个nginx服务
1)重复步骤5
./configure --prefix=/usr/local/nginx2
ps:prefix必须指定新的nginx安装目录
2)执行:make && make install
3)修改配置文件如下3个地方
(1)赋予root权限,在nginx.conf开头增加如下内容:
(2)修改访问端口
(3)修改访问路径
4)启动nginx
/usr/local/nginx2/sbin/nginx -c /usr/local/nginx2/conf/nginx.conf
猜你喜欢
- 2024-10-10 Linux下Docker部署Nginx并配置IPv6,实现公网访问
- 2024-10-10 nginx-linux服务器内核参数的优化
- 2024-09-12 如何在 LINUX 虚拟机上安装 NGINX Web 服务器
- 2024-09-12 【linux】Nginx 反向代理与负载均衡
- 2024-09-12 linux 安装nginx(linux安装nginx1.8)
- 2024-09-12 Linux下Nginx相关常用操作(linux+nginx)
- 2024-09-12 Linux搭建nginx,在window环境中访问
- 2024-09-12 nginx在linux下如何安装(linux怎么安装nginx)
- 2024-09-12 linux服务器下Nginx的搭建和部署(linux服务器nginx集群搭建)
- 2024-09-12 Linux运维笔记——Nginx详细安装部署
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)