如何使用源码编译安装Nginx服务器
2015-06-24 17:10
846 查看
安装 PCRE :
网站:http://pcre.org/
下载:
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.bz2
安装 Nginx :
安装命令:
下载: wget http://nginx.org/download/nginx-1.8.0.tar.gz tar zxf nginx-1.8.0.tar.gz cd nginx-1.8.0 ./configure --prefix=/usr/local/nginx make sudo make install ./configure --prefix=/usr/local/nginx \ --sbin-path=/usr/local/nginx/nginx \ --conf-path=/usr/local/nginx/nginx.conf \ --pid-path=/usr/local/nginx/nginx.pid \ --with-http_ssl_module \ ps -ef |grep nginx 启动Nginx: sudo /usr/local/nginx/sbin/nginx 重新加载配置文件: sudo /usr/local/nginx/sbin/nginx -t sudo /usr/local/nginx/sbin/nginx -s reload
查看Nginx版本:
/usr/local/nginx/sbin/nginx -V Mac-mini:nginx-1.8.0 WangTom$ /usr/local/nginx/sbin/nginx -V nginx version: nginx/1.8.0 built by clang 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) configure arguments: --prefix=/usr/local/nginx Mac-mini:nginx-1.8.0 WangTom$ /usr/local/nginx/sbin/nginx -v nginx version: nginx/1.8.0
检查是否安装成功:
访问: http://localhost/
页面出现:
Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required. For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com. Thank you for using nginx.
查看 Nginx 版本:
Mac-mini:html WangTom$ sudo /usr/local/nginx/sbin/nginx -v
nginx version: nginx/1.8.0
检测 Nginx 配置文件
Mac-mini:html WangTom$ sudo /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
To apply the new configuration, start nginx if it is not yet started or send the reload signal to the nginx’s master process, by executing:
Mac-mini:html WangTom$ sudo /usr/local/nginx/sbin/nginx -s reload
Mac-mini:html WangTom$
参考地址:
Building nginx from Sources:
http://nginx.org/en/docs/configure.html
[END]
相关文章推荐
- LNMP第二部分nginx、php配置(用户认证、域名重定向、日志、配置缓存、防盗链) 推荐
- 构建基于Nginx的文件服务器思路与实现
- Nginx在windows下使用为什么死掉
- nginx与Elasticsearch结合使用
- 使用Nginx做邮件代理服务器配置(参考配置二)
- 使用Nginx做邮件代理服务器配置
- NGINX引入线程池 性能提升9倍
- Windows下Nginx+PHP5(FastCgi)安装配置详解
- nginx笔记:nginx安装
- Thinkphp 伪静态Nginx配置方式
- Nginx+mysql+php-fpm负载均衡配置实例
- Nginx+PHP-FPM优化技巧总结
- nginx启动,重启,关闭命令 (另:kill -USR2 的作用)
- 更换apache到nginx的操作过程全记录
- CentOS上如何把Web服务器从Apache换到nginx
- nginx重新编译安装upload模块
- nginx FastCGI错误Primary script unknown解决办法
- 深入探讨:Nginx 502 Bad Gateway错误的解决方法
- nginx+php-fpm出现502 bad gateway错误解决方法
- nginx+php-fpm出现502 bad gateway错误解决方法