nginx编译和配置
来源:互联网 发布:斑马梦龙网络计划2016 编辑:程序博客网 时间:2024/06/04 20:00
1安装nginx前准备工作
Yum install –y gcc gcc-c++
Yum install zlib zlib-devel
Yum install openssl
2.编译和安装pcre
执行如下命令:
#cd/data/software/pcre-8.32
#./configure –prefix
#make
#make install
2.编译和安装nginx
执行如下命令:
# cd /data/software/nginx-1.7.0
# ./configure --prefix=/data/nginx/ --with-http_ssl_module --with-http_spdy_module \
--with-http_stub_status_module --with-pcre
#Make
#Make install
–with-http_stub_status_module:支持nginx状态查询
–with-http_ssl_module:支持https
–with-http_spdy_module:支持google的spdy,想了解请百度spdy,这个必须有ssl的支持
–with-pcre:为了支持rewrite重写功能,必须制定pcre
安装完成启动nginx。
[root@localhost conf]#/data/nginx/sbin/nginx (启动nginx提示如下错误)
/data/nginx/sbin/nginx: error while loadingshared libraries: libpcre.so.1: cannot open shared object file: No such file ordirectory
建立软连接
[hadoop@SCLABHADOOP01 ~]$ ln -s/usr/local/lib/libpcre.so.1 /lib64/
判断Nginx配置是否正确命令如下:
/usr/nginx/sbin/nginx –t
/data/nginx/sbin/nginx(启动服务)
/data/nginx/sbin/nginx-s stop(停止服务)
/data/nginx/sbin/nginx-s reload(重启服务)
配置nginx
#server {
#侦听80端口
listen 80;
#定义使用www.xx.com访问
server_name www.xx.com;
#设定本虚拟主机的访问日志
access_log logs/www.xx.com.access.log main;
#默认请求
location / {
root /root; #定义服务器的默认网站根目录位置
index index.phpindex.html index.htm; #定义首页索引文件的名称
例
server {
listen 80;
server_name bo.artronekp.net;
location/ {
root /data/software/beian/;
index index.html help.html;
}
}
- nginx编译和配置
- nginx配置编译学习
- nginx编译路径配置
- nginx编译配置
- [快速配置]Nginx编译+配置
- Nginx源码结构和编译配置configure shell
- Nginx 的编译配置项和命令项(小记)
- nginx编译和调试
- 编译配置nginx-rtmp-moule
- nginx 编译安装与配置
- nginx编译安装与配置-配置篇
- nginx安装和配置
- 安装和配置nginx
- nginx安装和配置
- 安装和配置nginx
- nginx安装和配置
- nginx和uwsgi配置
- apache和nginx配置
- Volley的使用笔记
- Installing Wireshark on Ubuntu 12.04 LTS
- android versionCode versionName的获取
- Nutch1.9安装
- A tricky way to create a lookup field in Visualforce page
- nginx编译和配置
- C程序中对时间的处理——time库函数详解以及系统时间结构体类型
- 联系方式!
- iOS 后台
- 如果是JS文件限制了你的页面加载速度,不用再担心了
- navcat for mysql 注册码
- html,添加iframe后,其他div看不见了
- C语言运算符优先级 详细列表
- 花洒的保养花洒正确方法