Nginx-1.6.3源码安装、虚拟主机
源码安装nginx
cat /etc/redhat-release
uname -rm
yum install pcre-devel openssl-devel -y
rpm -qa pcre pcre-devel openssl openssl-devel
groupadd -g 888 nginx
useradd nginx -u 888 -g nginx -s /sbin/nologin -M
mkdir -p /server/tools
cd /server/tools
wget -q http://nginx.org/download/nginx-1.6.3.tar.gz
tar xf nginx-1.6.3.tar.gz
cd nginx-1.6.3
./configure --user=nginx --group=nginx --prefix=/application/nginx-1.6.3 --with-http_stub_status_module --with-http_ssl_module
make
make install
ln -s /application/nginx-1.6.3 /application/nginx
/application/nginx/sbin/nginx -t
/application/nginx/sbin/nginx
ps -ef | grep nginx
lsof -i :80
curl 10.0.0.41
虚拟主机配置
cd /application/nginx-1.6.3/conf/
egrep -v "^$|#" nginx.conf.default > nginx.conf
mkdir extra
mkdir ../html/{www,blog,bbs}
chown -R nginx.nginx ../html
vim nginx.conf worker_processes 1;
error_log logs/error.log error;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
log_format main '$remote_addr - $remote_user [$time_local] "$request"'
'$status $body_bytes_sent "$http_referer"'
'"$http_user_agent" "$http_x_forwarded_for"';
include extra/www.conf;
include extra/blog.conf;
include extra/bbs.conf;
include extra/status.conf;
} vim extra/www.conf server {
listen 80;
server_name www.peterwang.com;
root html/www;
index index.html index.htm;
error_page 500 502 503 504 /50x.html;
access_log logs/access_www.log main;
location / { }
} vim extra/blog.conf server {
listen 80;
server_name blog.peterwang.com;
root html/blog;
index index.html index.htm;
error_page 500 502 503 504 /50x.html;
access_log logs/access_blog.log main;
location / { }
} vim extra/bbs.conf server {
listen 80;
server_name bbs.peterwang.com;
root html/bbs;
index index.html index.htm;
error_page 500 502 503 504 /50x.html;
access_log logs/access_bbs.log main;
location / { }
} vim extra/status.conf server {
listen 80;
server_name status.peterwang.com;
location / {
stub_status on;
access_log off;
allow 10.0.0.0/24;
deny all;
}
} ../sbin/nginx -s reload
Nginx-1.6.3源码安装、虚拟主机的更多相关文章
- nginx使用-1(源码安装nginx)
Nginx概述 Nginx (engine x) 是一个高性能的HTTP和反向代理web服务器,同时也提供了IMAP/POP3/SMTP服务.Nginx是由伊戈尔·赛索耶夫为俄罗斯访问量第二的Ramb ...
- 关于nginx的源码安装方式
Nginx(engine x)是一款是由俄罗斯的程序设计师Igor Sysoev所开发高性能的 Web和 反向代理 服务器, 也是一个 IMAP/POP3/SMTP 代理服务器.在高连接并发的情况下, ...
- 源码安装python +NGINX 的坎坷路 +uwsgi安装 部署django 的CRM项目
一.Nginx安装(基于ubuntu17.10 版本) 首先我们是基于源码安装,主要有如下步骤 1.安装依赖包 1.安装gcc g++的依赖库 sudo apt-get install build-e ...
- 在Ubuntu Server上源码安装OpenERP 8.0,并配置wsgi和nginx运行环境
原文: How to install OpenERP 8.0 Alpha on a fresh Debian / Ubuntu server. OpenERP的安装,可以有多种方式,通过添加源,到 h ...
- nginx 的源码安装
安装nginx之前要做的准备工作有:安装如下库 (1)gzip模块需要 zlib 库 (2)rewrite模块需要 pcre 库 (3)ssl 功能需要openssl库 还有一种简单的方法就是 yum ...
- 源码安装nginx以及平滑升级
源码安装nginx以及平滑升级 ...
- Nginx源码安装及调优配置
导读 由于Nginx本身的一些优点,轻量,开源,易用,越来越多的公司使用nginx作为自己公司的web应用服务器,本文详细介绍nginx源码安装的同时并对nginx进行优化配置. Nginx编译前的优 ...
- CentOS 6.5 + Nginx 1.8.0 + PHP 5.6(with PHP-FPM) 负载均衡源码安装 之 (一)Nginx安装篇
CentOS 6.5 minimal安装不再赘述 Nginx源码安装 1.安装wget下载程序 yum -y install wget 2.安装编译环境:gcc gcc-c++ automake au ...
- redhat 5下源码安装nginx服务
首先确保机器中已安装 gcc c++,libtool等工具,保证可执行源码安装 A.为了确保能在 Nginx 中使用正则表达式进行更灵活的配置,安装之前需要确定系统是否安装有 PCRE(Perl Co ...
随机推荐
- NAT网络地址转换模拟过程
原理图,如图1 图1 以下为配置NAT网络地址转换的实验: eNSP模拟图,如图2 图2 Step1.给路由器的每个接口赋予一个地址,如图3,图4 图3 图4 AR1和AR2中添加路由表项,如图5,图 ...
- 洛谷 P3345 [ZJOI2015]幻想乡战略游戏 解题报告
P3345 [ZJOI2015]幻想乡战略游戏 题目描述 傲娇少女幽香正在玩一个非常有趣的战略类游戏,本来这个游戏的地图其实还不算太大,幽香还能管得过来,但是不知道为什么现在的网游厂商把游戏的地图越做 ...
- mysql主从配置的过程
首先参考MySQL5.5官方手册 以下章节: 6.4节如何设置复制 13.6.1节 用于控制主服务器的SQL语句 13.6.2节 用于控制从服务器的SQL语句 6.8节 复制启动选项 6.5节 不同M ...
- 【数学】【背包】【NOIP2018】P5020 货币系统
传送门 Description 在网友的国度中共有 \(n\) 种不同面额的货币,第 \(i\) 种货币的面额为 \(a[i]\),你可以假设每一种货币都有无穷多张.为了方便,我们把货币种数为 \(n ...
- valgrind检查C/C++内存泄漏
valgrind --tool=memcheck --leak-check=full ./httptest valgrind --tool=memcheck --leak-check=full -- ...
- I/O多路复用一些概念
一.前言 在事件驱动模型中,我们说当程序遇到I/O操作时,注册 一个回调到事件循环中,主程序继续做其他事情.当I/O操作完成后,再切换回原来的任务.这就是说I/O操作是和程序本身没关系的,其实I/O操 ...
- qq快速登陆
http://www.cnblogs.com/1996V/p/7481823.html qq快速登陆
- Splay 区间操作(二)
首先基本操作如下: 删除第rank个点 void Remove(int id){//删除第rank个点 rank++; int x = find(root, rank - 1); splay(x, 0 ...
- 题解 P2472 【[SCOI2007]蜥蜴】
P2472 [SCOI2007]蜥蜴 题目背景 07四川省选 题目描述 在一个r行c列的网格地图中有一些高度不同的石柱,一些石柱上站着一些蜥蜴,你的任务是让尽量多的蜥蜴逃到边界外. 每行每列中相邻石柱 ...
- [DeeplearningAI笔记]序列模型1.1-1.2序列模型及其数学符号定义
5.1循环序列模型 觉得有用的话,欢迎一起讨论相互学习~Follow Me 1.1什么是序列模型 在进行语音识别时,给定了一个输入音频片段X,并要求输出片段对应的文字记录Y,这个例子中的输入和输出都输 ...