azure 云上安装部署nginx
来源:互联网 发布:恒大社会招聘网络面试 编辑:程序博客网 时间:2024/05/29 14:14
在安装nginx之前可以先安装libevent,安装libevent步骤如下:
1.下载libevent:
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
2.解压libevent:
tar -zxvpf libevent-2.0.21-stable.tar.gz
3.进入解压目录:
cd libevent-2.0.21-stable
4.指定安装目录:
./configure --prefix=/usr/local/libevent-2.0.21
5.安装libevent:
make
make install
6,安装nginx
yum install -y openssl*
tar -xvf pcre-8.31.tar.gz -C /usr/local/
tar -xvf nginx-1.4.2.tar.gz
cd nginx-1.4.2
./configure --with-http_ssl_module --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre-8.31 --with-http_stub_status_module
pS:首席编译脚本 1.121/122
yum -y install gcc automake autoconf libtool make
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_realip_module --with-http_gzip_static_module --with-http_ssl_module --with-pcre=/usr/local/pcre-8.31
make
make install
8,使用nginx帐号启动
setcap CAP_NET_BIND_SERVICE=+ep /usr/local/nginx/sbin/nginx
要先用root帐号运行 /usr/local/nginx/sbin/nginx 启动,然后kill掉nginx进程
再切换到nginx帐号执行service nginx restart或者/usr/local/nginx/sbin/nginx 启动,就会看到进程是用nginx帐号在启动了
9,报错调试
[nginx@lb_net_1 ~]$ service nginx start
start nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx is running[nginx@lb_net_1 ~]$
[nginx@lb_net_1 ~]$ exit
logout
[root@lb_net_1 conf]#
[root@lb_net_1 conf]# sudo chown root:wheel /usr/local/nginx/sbin/nginx
[root@lb_net_1 conf]# sudo chmod u+s /usr/local/nginx/sbin/nginx
[root@lb_net_1 conf]#
[root@lb_net_1 conf]# su - nginx
[[root@lb_net_1 conf]# sudo chmod u+x /usr/local/nginx/sbin/nginx
之后进入nginx帐号启动成功了。
1.下载libevent:
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
2.解压libevent:
tar -zxvpf libevent-2.0.21-stable.tar.gz
3.进入解压目录:
cd libevent-2.0.21-stable
4.指定安装目录:
./configure --prefix=/usr/local/libevent-2.0.21
5.安装libevent:
make
make install
本blog来源地址:http://blog.csdn.net/mchdba/article/details/50967970,不经过原作者mchdba(黄杉)允许,谢绝转载。
6,安装nginx
yum install -y openssl*
tar -xvf pcre-8.31.tar.gz -C /usr/local/
tar -xvf nginx-1.4.2.tar.gz
cd nginx-1.4.2
./configure --with-http_ssl_module --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre-8.31 --with-http_stub_status_module
pS:首席编译脚本 1.121/122
yum -y install gcc automake autoconf libtool make
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_realip_module --with-http_gzip_static_module --with-http_ssl_module --with-pcre=/usr/local/pcre-8.31
make
make install
7,查看编译参数:
/usr/local/nginx/sbin/nginx -V
8,使用nginx帐号启动
setcap CAP_NET_BIND_SERVICE=+ep /usr/local/nginx/sbin/nginx
要先用root帐号运行 /usr/local/nginx/sbin/nginx 启动,然后kill掉nginx进程
再切换到nginx帐号执行service nginx restart或者/usr/local/nginx/sbin/nginx 启动,就会看到进程是用nginx帐号在启动了
9,报错调试
[nginx@lb_net_1 ~]$ service nginx start
start nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx is running[nginx@lb_net_1 ~]$
[nginx@lb_net_1 ~]$ exit
logout
[root@lb_net_1 conf]#
[root@lb_net_1 conf]# sudo chown root:wheel /usr/local/nginx/sbin/nginx
[root@lb_net_1 conf]# sudo chmod u+s /usr/local/nginx/sbin/nginx
[root@lb_net_1 conf]#
[root@lb_net_1 conf]# su - nginx
[[root@lb_net_1 conf]# sudo chmod u+x /usr/local/nginx/sbin/nginx
之后进入nginx帐号启动成功了。
4 0
- azure 云上安装部署nginx
- Windows Azure应用系列:在微软云上部署VPN
- 在Windows Azure平台上部署服务
- 在Windows Azure平台上部署服务
- 在Windows Azure上部署Linux虚拟机
- 部署在windows azure上的openvpn
- 在Azure上部署squid的教程
- 如何在 Azure 上部署 Kubernetes 集群
- 在腾讯云上部署nginx
- Centos7上部署nginx
- [Redmine] Centos5上安装Redmine3.0+nginx+thin部署
- 第二章 Nginx服务器的安装部署【上】
- 微软云技术Windows Azure专题(五):如何将WCF服务部署在Windows Azure上
- azure 云上准备oracle11g的vnc安装环境
- zabbix3.0 azure云上rpm包安装
- nginx 安装部署
- Nginx安装部署
- Nginx安装部署
- leetcode015 3Sum
- hdu 5631 并查集
- 自己理解的“数据库事务隔离级别”
- JS判断当前的浏览器类型
- 在线简洁Logo制作
- azure 云上安装部署nginx
- SO_REUSEADDR和SO_REUSEPORT异同
- effective C++ 第三章:C++构造、析构和赋值
- TNS-12547: TNS:lost contact
- 程序员的自我修养——运行库
- docker(一)部署tomcat应用
- 131. Palindrome Partitioning | Java最短代码实现
- linux 线程边学边总结
- 虚拟机克隆CentOS后的网卡配置