nginx编译安装
2016-03-21 22:04
633 查看
linux 源码安装nginx http://www.cnblogs.com/zhoulf/archive/2013/02/09/2909653.html
安装说明
系统环境:CentOS 6.4
软件:nginx-1.9.12.tar.gz
安装方式:源码编译安装
安装位置:/opt/nginx
下载地址:http://nginx.org/en/download.html
1.yum 安装一些依赖包
[root@niaoyun-101 tools]# yum install pcre* zlib* gcc openssl openssl-devel libxml* libxslt* gd-devel GeoI GeoIP-data GeoIP-devel perl-devel perl-ExtUtils-Embed gcc-c++
2.创建目录 创建用户
[root@niaoyun-101 tools]# mkdir -p /opt/nginx
[root@niaoyun-101 tools]# mkdir -p /opt/tools
[root@niaoyun-101 tools]# groupadd www
[root@niaoyun-101 tools]# useradd -g www www
3.编译
[root@niaoyun-101 tools]#wget http://nginx.org/download/nginx-1.9.12.tar.gz
[root@niaoyun-101 tools]#tar zxf nginx-1.9.12.tar.gz
[root@niaoyun-101 tools]#cd nginx-1.9.12
[root@niaoyun-101 nginx-1.9.12]# ./configure --prefix=/opt/nginx --user=www --group=www --with-http_stub_status_module --with-select_module --with-poll_module --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module
--with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_perl_module
--with-threads
[root@niaoyun-101 nginx-1.9.12]# make
[root@niaoyun-101 nginx-1.9.12]# make install
[root@niaoyun-101 nginx-1.9.12]# /opt/nginx/sbin/nginx -V
4.修改配置文件
cd /opt/nginx/conf/
vi nginx.conf
mkdir /opt/nginx/conf/vhosts
cd /opt/nginx/conf/vhosts
vi 80port.conf
5.启动
[root@niaoyun-101 nginx-1.9.12]# /opt/nginx/sbin/nginx
[root@niaoyun-101 tools]# ps -ef | grep nginx
root 26050 1 0 18:16 ? 00:00:00 nginx: master process /opt/nginx/sbin/nginx
www 26161 26050 0 18:28 ? 00:00:00 nginx: worker process
root 26225 18824 0 18:35 pts/0 00:00:00 grep nginx
[root@niaoyun-101 tools]# lsof -i:80
安装说明
系统环境:CentOS 6.4
软件:nginx-1.9.12.tar.gz
安装方式:源码编译安装
安装位置:/opt/nginx
下载地址:http://nginx.org/en/download.html
1.yum 安装一些依赖包
[root@niaoyun-101 tools]# yum install pcre* zlib* gcc openssl openssl-devel libxml* libxslt* gd-devel GeoI GeoIP-data GeoIP-devel perl-devel perl-ExtUtils-Embed gcc-c++
2.创建目录 创建用户
[root@niaoyun-101 tools]# mkdir -p /opt/nginx
[root@niaoyun-101 tools]# mkdir -p /opt/tools
[root@niaoyun-101 tools]# groupadd www
[root@niaoyun-101 tools]# useradd -g www www
3.编译
[root@niaoyun-101 tools]#wget http://nginx.org/download/nginx-1.9.12.tar.gz
[root@niaoyun-101 tools]#tar zxf nginx-1.9.12.tar.gz
[root@niaoyun-101 tools]#cd nginx-1.9.12
[root@niaoyun-101 nginx-1.9.12]# ./configure --prefix=/opt/nginx --user=www --group=www --with-http_stub_status_module --with-select_module --with-poll_module --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module
--with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_perl_module
--with-threads
[root@niaoyun-101 nginx-1.9.12]# make
[root@niaoyun-101 nginx-1.9.12]# make install
[root@niaoyun-101 nginx-1.9.12]# /opt/nginx/sbin/nginx -V
4.修改配置文件
cd /opt/nginx/conf/
vi nginx.conf
mkdir /opt/nginx/conf/vhosts
cd /opt/nginx/conf/vhosts
vi 80port.conf
5.启动
[root@niaoyun-101 nginx-1.9.12]# /opt/nginx/sbin/nginx
[root@niaoyun-101 tools]# ps -ef | grep nginx
root 26050 1 0 18:16 ? 00:00:00 nginx: master process /opt/nginx/sbin/nginx
www 26161 26050 0 18:28 ? 00:00:00 nginx: worker process
root 26225 18824 0 18:35 pts/0 00:00:00 grep nginx
[root@niaoyun-101 tools]# lsof -i:80
相关文章推荐
- Linux socket 初步
- 小心服务器内存居高不下的元凶--WebAPI服务
- Linux Kernel 4.0 RC5 发布!
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户