So Tired !_! 逆水行舟, 不进则退!

28Apr/14

Download Oracle Java JRE & JDK using a script

Posted by Nick Xu

Oracle has recently disallowed direct downloads of java from their servers (without going through the browser and agreeing to their terms, which you can look at here: http://www.oracle.com/technetwork/java/javase/terms/license/index.html). So, if you try:

wget "http://download.oracle.com/otn-pub/java/jdk/7u4-b20/jdk-7u4-linux-x64.tar.gz"

you will receive a page with "In order to download products from Oracle Technology Network you must agree to the OTN license terms" error message.

This can be rather troublesome for setting up servers with automated scripts.

Luckily, it seems that a single cookie is all that is needed to bypass this (you still have to agree to the terms to install):

Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie

So, if you want to download jdk7u4 for 64-bit Linux (e.g., Ubuntu) using wget, you can use:

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u4-b20/jdk-7u4-linux-x64.tar.gz"

Just for reference, here are the links to the current (at the time of posting) downloads of JDK and JRE

UPDATE: instead of having new post for each JDK/JRE update I'll just keep updating this one

UPDATE 2: Seems that you now need the --no-check-certificate flag for wget or you'll get a "cannot verify edelivery.oracle.com's certificate" error.

UPDATE 3: Starting with 7u51 they changed the cookie name, it's now "oraclelicense", thank you Yngve for posting in the comments - I updated the commands to include both cookies.

JDK 7u51

  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-arm-vfp-hflt.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-arm-vfp-sflt.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.rpm
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-macosx-x64.dmg
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-solaris-i586.tar.Z
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-solaris-i586.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-solaris-x64.tar.Z
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-solaris-x64.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-solaris-sparc.tar.Z
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-solaris-sparc.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-solaris-sparcv9.tar.Z
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-solaris-sparcv9.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-windows-i586.exe
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-windows-x64.exe

JDK 6u45

  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586-rpm.bin
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64-rpm.bin
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-solaris-i586.sh
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-solaris-i586.tar.Z
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-solaris-sparc.sh
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-solaris-sparc.tar.Z
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-solaris-sparcv9.sh
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-solaris-sparcv9.tar.Z
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-solaris-x64.sh
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-solaris-x64.tar.Z
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-windows-i586.exe
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-windows-x64.exe
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-ia64-rpm.bin
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-ia64.bin
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-windows-ia64.exe

JRE 7u51

  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-linux-i586.rpm
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-linux-i586.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-linux-x64.rpm
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-linux-x64.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-macosx-x64.dmg
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-macosx-x64.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-solaris-i586.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-solaris-x64.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-solaris-sparc.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-solaris-sparcv9.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-windows-i586-iftw.exe
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-windows-i586.exe
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-windows-i586.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-windows-x64.exe
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-windows-x64.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/server-jre-7u51-linux-x64.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/server-jre-7u51-solaris-i586.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/server-jre-7u51-solaris-x64.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/server-jre-7u51-solaris-sparc.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/server-jre-7u51-solaris-sparcv9.tar.gz
  • http://download.oracle.com/otn-pub/java/jdk/7u51-b13/server-jre-7u51-windows-x64.tar.gz

JRE 6u45

  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586-rpm.bin
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586.bin
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-x64-rpm.bin
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-x64.bin
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-solaris-i586.sh
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-solaris-sparc.sh
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-solaris-sparcv9.sh
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-solaris-x64.sh
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-windows-i586-iftw.exe
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-windows-i586.exe
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-windows-x64.exe
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-ia64-rpm.bin
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-ia64.bin
  • http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-windows-ia64.exe
Tagged as: , , Comments Off
25Apr/14

5分钟完成nginx ssl配置

Posted by Nick Xu

1.准备环境

下载openssl for windows

2.生成证书

Shell代码  收藏代码
  1. openssl genrsa -des3 -out openssl.key 1024
  2. openssl req -new -x509 -key openssl.key -out openssl.crt -days 3650
  3. openssl rsa -in openssl.key -out openssl_nopass.key

具体操作

报错 :Unable to load config info from /usr/local/ssl/openssl.cnf

下载: openssl.conf  使用参数 -config openssl.conf 指定

 

证书文件

3.nginx 配置ssl


4.验证结果

完成! 

 

linux与windows配置差不多.

 

可以使用openssl自认证证书,商用需要使用第三方机构认证

openssl req -new -key openssl.key -out openssl.csr

openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr

openssl x509 -req -days 3650 -in openssl.csr -CA openssl.crt -CAkey openssl.key -CAcreateserial -out openssl.crt

 

 

 

# 生成一个RSA密钥 
$ openssl genrsa -des3 -out 33iq.key 1024

# 拷贝一个不需要输入密码的密钥文件
$ openssl rsa -in 33iq.key -out 33iq_nopass.key

# 生成一个证书请求
$ openssl req -new -key 33iq.key -out 33iq.csr

# 自己签发证书
$ openssl x509 -req -days 365 -in 33iq.csr -signkey 33iq.key -out 33iq.crt

Tagged as: , Comments Off
   
site
site