nginx 快速搭建
来源:互联网 发布:网络接口教程 编辑:程序博客网 时间:2024/06/06 03:13
2. 编辑可执行文件 并运行
#!/bin/bash
groupadd -g600 nginx
useradd -u600 -g600 nginx
user=nginx # change to user who run nginx
dir_prefix=/home/deploy/nginx #定义安装目录
script_path=`readlink -f $0`
script_dir=`dirname $script_path`
opath=`pwd`
yum install -y gd-devel pcre-devel libgcrypt-devel libxml2-devel libxslt-devel GeoIP-devel
tar zxvf $script_dir/zlib-1.2.8.tar.gz -C $script_dir
tar zxvf $script_dir/openssl-1.0.1m.tar.gz -C $script_dir
tar zxvf $script_dir/nginx-1.8.0.tar.gz -C $script_dir
cd $script_dir/nginx-1.8.0
./configure --prefix=$dir_prefix --user=$user --group=$user --http-log-path=$dir_prefix/log/access.log --error-log-path=$dir_prefix/log/error.log --pid-path=$dir_prefix/pid/nginx.pid --lock-path=$dir_prefix/lock/nginx.lock --with-http_ssl_module --with-http_spdy_module --with-http_realip_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_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-pcre --with-zlib=$script_dir/zlib-1.2.8 --with-openssl=$script_dir/openssl-1.0.1m
make
make install
mkdir -p $dir_prefix/sites-enabled
mkdir -p $dir_prefix/lock
\cp -f $script_dir/etc.initd.nginx-$user /etc/init.d/nginx-$user
\cp -f $script_dir/conf.nginx.conf $dir_prefix/conf/nginx.conf
\cp -f $script_dir/sites-enabled.$user.conf $dir_prefix/sites-enabled/$user.conf
chown -R $user: $dir_prefix
service nginx-$user start
chkconfig nginx-$user on
rm -Rf $script_dir/zlib-1.2.8
rm -Rf $script_dir/openssl-1.0.1m
rm -Rf $script_dir/nginx-1.8.0
cd $opath
- nginx 快速搭建
- Nginx快速搭建
- debian环境下快速搭建nginx+php
- Logstash+Redis+Elasticsearch+Kibana 快速搭建Nginx日志查询系统
- Nginx入门指南,快速搭建静态文件服务器和代理服务器
- 【docker】使用docker快速搭建nginx+php开发环境
- window10下php7 nginx mysql redis 开发环境快速搭建
- Nginx入门指南,快速搭建静态文件服务器和代理服务器
- Mac下快速搭建PHP开发环境,Apache,Nginx,MySQL
- Nginx搭建
- nginx搭建
- [nginx]搭建
- Nginx搭建
- nginx搭建
- Nginx搭建
- nginx搭建
- centos linux 下LNMP 环境快速yum搭建(nginx+mysql+memcached+iptables+php)
- 基于centos6.5快速搭建jdk,tomcat,nginx,显示个人静态页面(基于yum)
- Android 蓝牙(概述)
- 实验1.1
- 对js中的引用类型的理解(5)——Date类型
- ios 中键盘自动隐藏
- cocos2d-x v3.9 关于RotateTo和SkewTo的疑问
- nginx 快速搭建
- Shell脚本:求命令行上所有的整数和
- Android Studio adb无法响应的解决方法
- 前端开发者都应知道的 jQuery 小技巧
- Cocos2dx-OpenGL ES2.0教程:纹理贴图(6)
- 工程问题:fatal error C1071
- 基金基础知识
- 参考文献中的字母含义
- UITableView样式的自定义