六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 91|回复: 0

配置安装nginx

[复制链接]

升级  12.67%

70

主题

70

主题

70

主题

举人

Rank: 3Rank: 3

积分
238
 楼主| 发表于 2013-2-7 15:28:50 | 显示全部楼层 |阅读模式
配置安装nginx

1.下载nginx软件包: #wget http://sysoev.ru/nginx/nginx-0.6.8.tar.gz// 下载最新的版本 安装前还需要安装openssl
2. 解压后进入根文件夹 #./configure --with-http_ssl_module --without-http_rewrite_module
3.#make
4.#make install
5.修改nginx的配置文件,默认是放在/usr/local/nginx/conf/nginx.conf 存放html的根目录是/usr/local/nginx/html
6.启动nginx, #/usr/local/nginx/sbin/nginx
7.访问http://localhost/就可以看到默认的nginx自带的index.htm
如果要在nginx中配置ssl,首先要生成密钥对,注意,这里生成的密钥不是用ssh-keygen,而是用openssl,见https://dswork.vicp.net/prj/tech/wiki/webtech/openssl
http {   ......server {        listen               443;        ssl                  on;        ssl_certificate      /usr/local/nginx/conf/ca.crt;        ssl_certificate_key  /usr/local/nginx/conf/ca.key;        keepalive_timeout    70;        ...    }    ......}
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表