1、下载安装pcre库
  pcre是一个正则表达式库,nginx的rewrite模块需要依赖该库。
  下载地址:http://www.pcre.org/

wget https://ftp.pcre.org/pub/pcre/pcre-8.40.tar.gz
tar -zxvf pcre-8.40.tar.gz
cd pcre-8.40
./configure
make
make install

2、下载安装nginx
   下载地址:http://nginx.org/

wget http://nginx.org/download/nginx-1.8.1.tar.gz
tar -zxvf nginx-1.8..tar.gz
cd nginx-1.8.
./configure
make
make install

3、验证安装是否成功

   默认安装路径:/usr/local/nginx

建立软链接(配置启动命令,不管在哪级目录,都可以采用nginx直接操作命令):

ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/nginx(操作命令名称)

执行nginx命令验证是否安装成功:

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

注:以上来自https://segmentfault.com/a/1190000013065982

4、启动:nginx安装目录地址 -c nginx配置文件地址

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

5、停止

nginx -s stop

6、重启

nginx -s reload

最新文章

  1. Scalaz(3)- 基础篇:函数概括化-Generalizing Functions
  2. an important difference between while and foreach on Perl
  3. struts2中用xml配置文件去验证填写信息
  4. 跟我一起学WCF(7)——WCF数据契约与序列化详解
  5. noip2003复赛普及组第一题——乒乓球
  6. Codeforces Round #307 (Div. 2) E. GukiZ and GukiZiana 分块
  7. IE10 下兼容性问题
  8. 关于本人遇到的nodejs的一些错误信息
  9. Maven 工程下 Spring MVC 站点配置 (三) C3P0连接池与@Autowired的应用
  10. js 常用方法记事本
  11. Linux的错误码
  12. Android Studio的使用(十二)怎样打包项目
  13. mysql数据库索引调优
  14. Ubuntu 中文拼音输入法键入异常
  15. python3学习笔记12(变量作用域)
  16. python note 10 函数变量
  17. Linux下java开发环境配置总结
  18. ssh访问服务器端visdom
  19. xenapp 6.5 客户端插件第一次安装总是跳到官网
  20. Ajax学习(二):模仿jQuery的Ajax封装工具

热门文章

  1. 多字节与Unicode
  2. MySQL 8 备份与恢复
  3. SpringBoot整合NoSql--(二)MongoDB
  4. Python学习笔记———递归遍历多层目录
  5. 让我们纯手写一个js继承吧
  6. SURF特征检测
  7. dubbox的小案例
  8. Android日期时间控件DatePickerDialog和TimePickerDialog
  9. Android布局样式
  10. Redis的主从复制与Redis Sentinel哨兵机制