VPS侦探论坛

 找回密码
 注册
查看: 6683|回复: 7

Nginx如何开启TLS SNI support??

[复制链接]
发表于 2012-7-28 08:27:02 | 显示全部楼层 |阅读模式

求让Nginx开启TLS SNI support的方法,网上找的文章都不行啊!有没有教程?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-7-28 09:23:14 | 显示全部楼层


需要在nginx编译参数里加上 --with-http_ssl_module ,然后重新编译,简单点就是修改升级脚本编译里加上--with-http_ssl_module,用升级脚本升级一下就行了。
http://wiki.nginx.org/HttpSslModule 这个加上个ssl的server就行了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2012-7-28 10:22:25 | 显示全部楼层

原帖由 licess 于 2012-7-28 09:23 发表
需要在nginx编译参数里加上 --with-http_ssl_module ,然后重新编译,简单点就是修改升级脚本编译里加上--with-http_ssl_module,用升级脚本升级一下就行了。
http://wiki.nginx.org/HttpSslModule 这个加上个ssl的serve ...


升级脚本在那里下载哦?那个--with-http_ssl_module加到什么位置?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2012-7-28 11:43:27 | 显示全部楼层



原帖由 licess 于 2012-7-28 09:23 发表
需要在nginx编译参数里加上 --with-http_ssl_module ,然后重新编译,简单点就是修改升级脚本编译里加上--with-http_ssl_module,用升级脚本升级一下就行了。
http://wiki.nginx.org/HttpSslModule 这个加上个ssl的serve ...

能否提供详细点的教程?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2012-7-28 12:26:47 | 显示全部楼层

军哥希望能提供点详细的教程,菜鸟不懂啊!谢谢了!

军哥运维代购:http://shop63846532.taobao.com/

发表于 2012-7-28 13:18:31 | 显示全部楼层

./configure 行尾,注意,--with-http_ssl_module前要加一空格
 楼主| 发表于 2012-7-28 13:57:22 | 显示全部楼层

原帖由 licess 于 2012-7-28 13:18 发表
./configure 行尾,注意,--with-http_ssl_module前要加一空格
是不是下载wget soft.vpser.net/lnmp/upgrade_nginx.sh;sh upgrade_nginx.sh这个脚本,然后用TXT方式打开这个脚本,看到代码 --with-ipv6 添加到他后面?我下面添加了下,看下对吗?这样弄了之后OPENSSL还需要会从新安装不?

#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

# Check if user is root
if [ $(id -u) != "0" ]; then
    echo "Error: You must be root to run this script, please use root to install lnmp"
    exit 1
fi

clear
echo "========================================================================="
echo "Upgrade Nginx for LNMP,  Written by Licess"
echo "========================================================================="
echo "LNMP is tool to auto-compile & install Nginx+MySQL+PHP on Linux "
echo ""
echo "For more information please visit http://www.lnmp.org/"
echo "========================================================================="

nv=`/usr/local/nginx/sbin/nginx -v 2>&1`
old_nginx_version=`echo $nv | cut -c22-`
#echo $old_nginx_version

if [ "$1" != "--help" ]; then

#set nginx version

        nginx_version=""
        echo "Current Nginx Versionold_nginx_version"
        echo "lease input nginx version you want:"
        echo "You can get version number from http://nginx.org/en/download.html"
        read -p "(example: 0.8.54 ):" nginx_version
        if [ "$nginx_version" = "" ]; then
                echo "Error: You must input nginx version!!"
                exit 1
        fi
        echo "==========================="

        echo "You want to upgrade nginx version to $nginx_version"

        echo "==========================="

        get_char()
        {
        SAVEDSTTY=`stty -g`
        stty -echo
        stty cbreak
        dd if=/dev/tty bs=1 count=1 2> /dev/null
        stty -raw
        stty echo
        stty $SAVEDSTTY
        }
        echo ""
        echo "ress any key to start...or Press Ctrl+c to cancel"
        char=`get_char`

echo "============================check files=================================="
if [ -s nginx-$nginx_version.tar.gz ]; then
  echo "nginx-$nginx_version.tar.gz [found]"
  else
  echo "Error: nginx-$nginx_version.tar.gz not found!!!download now......"
  wget -c http://nginx.org/download/nginx-$nginx_version.tar.gz
  if [ $? -eq 0 ]; then
        echo "Download nginx-$nginx_version.tar.gz successfully!"
  else
        echo "WARNING!May be the nginx version you input was wrong,please check!"
        echo "Nginx Version input was:"$nginx_version
        sleep 5
        exit 1
  fi
fi
echo "============================check files=================================="
rm -rf nginx-$nginx_version/

tar zxvf nginx-$nginx_version.tar.gz
cd nginx-$nginx_version/
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 --with-http_ssl_module
make

mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
cp objs/nginx /usr/local/nginx/sbin/nginx
/usr/local/nginx/sbin/nginx -t
make upgrade
echo "Upgrade completed!"
echo "rogram will display Nginx Version......"
/usr/local/nginx/sbin/nginx -v
cd ../

echo "========================================================================="
echo "You have successfully upgrade from $old_nginx_version to $nginx_version"
echo "========================================================================="
echo "LNMP is tool to auto-compile & install Nginx+MySQL+PHP on Linux "
echo "========================================================================="
echo ""
echo "For more information please visit http://www.lnmp.org/"
echo ""
echo "========================================================================="
fi

[ 本帖最后由 wozhidao 于 2012-7-28 13:58 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2012-7-28 19:41:58 | 显示全部楼层

我在升级脚本行尾加了--with-http_ssl_module。并执行sh upgrade_nginx.sh 升级nginx  然后我用/usr/local/nginx/sbin/nginx -V这个命令查看了下还是不行啊


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-17 23:46 , Processed in 0.028941 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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