nginx1.8.0安装

#!/bin/bash#install nginx-1.8.0.tar.gz
//源码包放在/usr/local/src目录下
cd /usr/local/src
tar xzvf nginx-1.8.0.tar.gz
cd nginx-1.8.0
./configure --prefix=/usr/local/nginx --with-http_realip_module --with-http_sub_module\
--with-http_gzip_static_module --with-http_stub_status_module --with-pcre
make
make install//添加nginx.conf配置文件
cat /usr/local/nginx/conf/nginx.conf
user nobody nobody;
worker_processes 2;
error_log /usr/local/nginx/logs/nginx_error.log crit;
pid /usr/local/nginx/logs/nginx.pid;
worker_rlimit_nofile 51200;events
{use epoll;worker_connections 6000;
}http
{include mime.types;default_type application/octet-stream;server_names_hash_bucket_size 3526;server_names_hash_max_size 4096;log_format combined_realip '$remote_addr $http_x_forwarded_for [$time_local]''$host "$request_uri" $status''"$http_referer" "$http_user_agent"';sendfile on;tcp_nopush on;keepalive_timeout 30;client_header_timeout 3m;client_body_timeout 3m;send_timeout 3m;connection_pool_size 256;client_header_buffer_size 1k;large_client_header_buffers 8 4k;request_pool_size 4k;output_buffers 4 32k;postpone_output 1460;client_max_body_size 10m;client_body_buffer_size 256k;client_body_temp_path /usr/local/nginx/client_body_temp;proxy_temp_path /usr/local/nginx/proxy_temp;fastcgi_temp_path /usr/local/nginx/fastcgi_temp;fastcgi_intercept_errors on;tcp_nodelay on;gzip on;gzip_min_length 1k;gzip_buffers 4 8k;gzip_comp_level 5;gzip_http_version 1.1;gzip_types text/plain application/x-javascript text/css text/htm application/xml;server{listen 80;server_name localhost;index index.html index.htm index.php;root /usr/local/nginx/html;location ~ \.php$ {include fastcgi_params;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;}}}//添加/etc/init.d/nginx文件
cat /etc/init.d/nginx
#!/bin/bash
#/etc/init.d/nginx
# chkconfig: - 30 21
# description: http service.
# Source Function Library
. /etc/init.d/functions
# Nginx SettingsNGINX_SBIN="/usr/local/nginx/sbin/nginx"
NGINX_CONF="/usr/local/nginx/conf/nginx.conf"
NGINX_PID="/usr/local/nginx/logs/nginx.pid"
RETVAL=0
prog="Nginx"start() {echo -n $"Starting $prog: "mkdir -p /dev/shm/nginx_tempdaemon $NGINX_SBIN -c $NGINX_CONFRETVAL=$?echoreturn $RETVAL
}stop() {echo -n $"Stopping $prog: "killproc -p $NGINX_PID $NGINX_SBIN -TERMrm -rf /dev/shm/nginx_tempRETVAL=$?echoreturn $RETVAL
}reload(){echo -n $"Reloading $prog: "killproc -p $NGINX_PID $NGINX_SBIN -HUPRETVAL=$?echoreturn $RETVAL
}restart(){stopstart
}configtest(){$NGINX_SBIN -c $NGINX_CONF -treturn 0
}case "$1" instart)start;;stop)stop;;reload)reload;;restart)restart;;configtest)configtest;;*)echo $"Usage: $0 {start|stop|reload|restart|configtest}"RETVAL=1
esac//给/etc/init.d/nginx添加权限
chmod +x /etc/init.d/nginx//添加nginx开机启动
chkconfig --add nginx
chkconfig nginx on//启动nginx
service nginx start

验证nginx安装成功,在浏览器中输入server ip

转载于:https://blog.51cto.com/thankinglove/1792183

nginx1.8.0安装相关推荐

  1. nginx1.18.0 安装vts

    wget https://codeload.github.com/yaoweibin/nginx_upstream_check_module/zip/master nginx-module-vts-m ...

  2. 编译安装nginx-1.6.0

    一.环境 系统:CentOS6.4x64最小化安装 IP:    192.168.3.48 二.安装基础软件 [root@lnmp-test ~]# yum install make gcc gcc- ...

  3. mysql+1.6安装,CentOS 7.0编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14方法

    这篇文章主要介绍了CentOS 7.0编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14方法分享,需要的朋友可以参考下准备篇: 一.配置防火墙,开启80端口.3306端口 Cen ...

  4. centos6.8下安装部署LNMP(备注:nginx1.8.0+php5.6.10+mysql5.6.12)

    在平时运维工作中,经常需要用到LNMP应用框架. 以下对LNMP环境部署记录下: 1)前期准备:为了安装顺利,建议先使用yum安装依赖库 [root@opd ~]#yum install -y mak ...

  5. 编译安装LNMP Centos 6.5 x64(6.6 x64) + Nginx1.6.0 + PHP5.5.13 + Mysql5.6.19

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G) 系统版本:CentOS-6.5-x86_64-minimal.iso 安装步骤: 0.虚拟系统安装 0.1 使用VMwa ...

  6. CentOS7.0 安装nginx-1.9.10

    2019独角兽企业重金招聘Python工程师标准>>> 下载模块依赖性Nginx需要依赖下面3个包 1.gzip 模块需要 zlib 库 ( 下载: http://www.zlib. ...

  7. Centos7安装Nginx1.14.0

    一.官网下载 http://nginx.org/en/download.html 版本说明: Nginx官网提供了三个类型的版本 Mainline version:Mainline 是 Nginx 目 ...

  8. centos 6.2 编译安装mysql_CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13

    CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13 2013-10-24 15:31:12 标签:服务器 防火墙 file 配置文件 written 一.配置 ...

  9. CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13+博客系统WordPress3.3.2

    说明: 操作系统:CentOS 6.2 32位 系统安装教程:CentOS 6.2安装(超级详细图解教程): http://www.osyunwei.com/archives/1537.html 准备 ...

  10. linux编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14

    linux编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14的方法对于 我这个小菜菜来讲是非常的复杂的还好有这篇文章,下面一起来看看吧. 一.使用系统镜像文件配置本地yum源 1 ...

最新文章

  1. Eigen:C++中Eigen库的安装与学习
  2. LDialog基于DialogFragment封装的库,也许是一个Nice的库
  3. 在tomcat中部署web项目
  4. Delphi XE7的Splash 功能
  5. 数据库优化 - 多列索引经典题目
  6. python模式匹配算法_【python算法书】单词模式匹配?
  7. python利用pygame框架实现类似大鱼吃小鱼游戏 (松鼠吃松鼠) code from making games with python and pygame
  8. python 求点集的距离矩阵
  9. linux 常用压缩命令,Linux常用的压缩及解压缩命令
  10. java uint16 t_uint8_t / uint16_t / uint32_t /uint64_t 的简单介绍
  11. 如何面对不讲信用的人
  12. JSP内置对象session和application
  13. wordpress 上传图片时提示“无法建立目录wp-content/uploads/2019/03。有没有上级目录的写权限?
  14. 菊风携手麦瑞思与Takumi实现中国首个北美运营商Verizon的RCS入库成功案例
  15. 【与奥斯丁的二十种邂逅】-- 得克萨斯首府的小情调城市游 (介绍你在奥斯丁必须做的,推荐做的,和做了你就牛掰了的20件事)...
  16. oracle中锁机制,Oracle锁的基本机制
  17. linux删除缓存文件swp,Vi下删除SWP文件
  18. php doctrine,php – Doctrine上的复杂SQL查询
  19. 【数据库系统综合实验】教学管理信息系统—学生选课及课程安排数据库综合实验
  20. 关于股票的一些学习书籍

热门文章

  1. java数据库查询类
  2. 电脑课堂:U盘“无法停止通用卷设备时”的解决方法
  3. 一个linux下g++使用的 makefile 模板
  4. 窗口启动特效,使用win32 api
  5. 恢复出厂设置 卡住10分钟问题
  6. 拜托,面试别再问我基数排序了!!!
  7. (五)洞悉linux下的Netfilteriptables:如何理解连接跟踪机制?(1)
  8. 深入解读Docker底层技术Cgroup系列(5)——cgroup子系统cpuset
  9. stm32死机问题的处理
  10. linux文件系统之mount流程分析