Archive for the 'Linux' Category
Source : http://stackoverflow.com/questions/10268583/how-to-automate-download-and-installation-of-java-jdk-on-linux
UPDATED FOR JDK 8u45
RPM:
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.rpm
TAR GZ:
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u40-b26/jdk-8u40-linux-x64.tar.gz
RPM using curl:
curl -v -j -k -L -H "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.rpm > jdk-8u45-linux-x64.rpm
- -j -> junk cookies
- -k -> ignore certificates
- -L -> follow redirects
- -H [arg] -> headers
curl can be used in place of wget .
UPDATED ANSWER ON 6th September 2014 (JDK 7u67)
I am updating this answer to take into account the fact that Oracle has changed their cookie policy. Thanks to Det for pointing out a simpler method than what I had originally specified.
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.tar.gz
Once again, make sure you specify the correct URL for the version you are downloading. You can find the URL here: Oracle JDK download site
ORIGINAL ANSWER FROM 9th June 2012
If you are looking to download the Oracle JDK from the command line using wget , there is a workaround. Run the wget command as follows:
wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz"
Be sure to replace the download link with the correct one for the version you are downloading.
To use this repository we need to add following lines to /etc/apt/sources.list file:
deb http://oss.oracle.com/debian/ unstable main non-free
deb-src http://oss.oracle.com/debian/ unstable main
we also need to get and install the package key from oracle web site
wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle
apt-key add RPM-GPG-KEY-oracle
Next, you need to update your package files (as root)# apt-get update
…
Reading Package Lists… Done
#
Now, you able to install your new Oracle XE! Just run following commands as a root user and answer for some questions about admin passwords and Oracle starting at boot:# apt-get install oracle-xe-universal
…
(Reading database … 62016 files and directories currently installed.)
Unpacking oracle-xe (from oracle-xe_10.2.0.1-0.060128_i386.deb) …
Setting up oracle-xe (10.2.0.1-0.060128) …
Oracle Database 10g Express Edition is not configured. You must run
‘/etc/init.d/oracle-xe configure’ as the root user to configure the database.
Executing Post-install steps…
You must run ‘/etc/init.d/oracle-xe configure’ as the root user to configure the database
# /etc/init.d/oracle-xe configure
Specify the HTTP port that will be used for Oracle Application Express [8080]:
Specify a port that will be used for the database listener [1521]:
Specify a password to be used for database accounts. Note that the same
password will be used for SYS and SYSTEM. Oracle recommends the use of
different passwords for each database account. This can be done after
initial configuration:
Confirm the password: (* make sure you remember this password *)
Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]: y
Starting Oracle Net Listener…Done
Configuring Database…Done
Starting Oracle Database 10g Express Edition Instance…Done
Installation Completed Successfully.
To access the Database Home Page go to “http://127.0.0.1:8080/apex”
Now you have installed Oracle Express Edition on your Debian Etch server.
Disabling/enabling the Oracle XE Service
Your Debian based system should meet the minimum requirements for swap space, otherwise installation would fail.
Based on the amount of physical memory available on the system, Oracle Database 10g Express Edition requires 1006 MB of swap space (YMMV). In order to overcome this issue you can always extend your partitions with Knoppix or Gparted.
The alternative solution, avoiding a reboot, would be:
# dd if=/dev/zero of=/myswapfile bs=1M count=1000
# mkswap /myswapfile
# swapon /myswapfile
You can always disable Oracle XE startup in boot time with (no update-rc.d method here):
# chmod -x /etc/init.d/oracle-xe
The alernative way to the same is to edit /etc/default/oracle-xe and change:
#ORACLE_DBENABLED=true
ORACLE_DBENABLED=false
Web console management
If you have installed OracleXE? database on remote *nix server, you can easily setup a SSH tunnel in order to gain access to a web administration console (since web console is bound to loopback device and therefore unavailable outside to the network):
# ssh oracle-xe-server -L 8081:localhost:8080
While keeping this proces running (or keep it on background via screen or nohup), you may now login to Oracle XE web administrations console on your local computer: http://localhost:8081/apex/
Please notice that your ssh daemon on your local computer should allow TCP forwarding. (ie. “AllowTcpForwarding? yes” should be present in “/etc/sshd/sshd_config”.)
SQL Remote connection management
By default OracleXe? installation does not allow SQL network connections to your XE database. To enable remote connections, logon to web management console and enable “Remote connections”: “Administration->enable Available from local server and remote clients”-> press “Apply Changes”. The same procedure can also be done from the commandline:
# sqlplus -S system/password@//localhost/XE < @this_script.sql
SQL> exit;
Alternatively use the web managment console to add new Oracle XE users accordingly.
Deleting users
For deleting an SQL user from OracleXE? use the web management console, or execute following commands from the commandline:
# su – oracle
[email protected]:~$ sqlplus / as sys
SQL> drop user myuser cascade;
SQL>exit;
< < ClockProblemOnVM | Linux | >>
References:
http://www.debianhelp.co.uk/oracle.htm
Testé avec find (GNU findutils) 4.4.2 .
Trouver les fichiers dans <répertoire_où_sont_les_fichiers> avec une date de modifications plus récente qu’une date spécifique Full Story »
cd /etc/sshd
vi sshd_config
PermitRootLogin yes
/etc/rc.d/sshd restart
Voici un copié-collé d’une procédure de compilation/configuration/installation d’Apache 2.2 en concert avec Tomcat 5.5 que j’ai à utilisé de temps en temps dans mon travail. Si ça peux vous être utile.
Si vous êtes l’auteur de cette procédure n’hésitez pas à me le dire pour que je vous cite, j’ai oublié d’où provient ces informations. (If you are this procedure’s author, please do not hesitate to tell me so I can quote you).
Here is what you need to do to have a running webserver using Apache and Tomcat:
If you’ve already installed required packages and are ready to install Apache and Tomcat, go to STEP1?. If you are starting after installing the OS and you still have no packages installed at all, you might want to use apt-get install to get the following packages:
bison,flex,g++,make (If you’re going to be building anything from source, these will help)
bzip2,unzip (Useful for compressing/uncompressing archives)
dnsutils (DNS utilities including nslookup)
lynx (Text Based Browser – useful for testing your websites if you need to)
nmap,tcpdump,tethereal,traceroute (More advanced layer 1-3 troubleshooting utilities)
ntpdate (Make sure you install this so all your machines have the same system time)
libssl-dev,openssl (Necessary if you’re installing apache with SSL)
ssh (NEVER FORGET TO INSTALL THIS)
vim (Better text editor, after you install this, make sure you edit /etc/vim/vimrc and uncomment the line that says syntax=on)
First, install this:
apt-get install ssh vim ntpdate
Here is what the line that you would type to get all of this on a new server.
apt-get install bison bzip2 dnsutils flex g++ libssl-dev lynx make nmap openssl tcpdump tethereal traceroute unzip
STEP1 – downloads
Downloading Java, Apache2.2, Tomcat 5.5
go to /usr/src on your machine and run wget on the following files. (you can use “copy link location” in Firefox on the links that say “This is the latest version […]” then paste the links in your console)
Java 1.4.2_11 from http://java.sun.com/j2se/1.4.2/download.html. Get the J2SDK non-rpm linux installer.
Another alternative is to copy the file from zeus:
scp [email protected]:/usr/src/j2sdk-1_4_2_11-linux-i586.bin /usr/src
Latest Apache2 from http://httpd.apache.org. Get the tar of the source. This is the latest version (2.2.0) on 20060403
Latest Tomcat 5.5.16 from http://tomcat.apache.org/download-55.cgi#5.5.16. Get the tar of the binary. This is the latest version (5.5.16) on 20060403
STEP 2 – installation
Installing everything you downloaded above
installing Apache
Go to /usr/src/ and untar the apache archive (use tar -xvf and add either z for gunzip or j for bzip2) go into the apache installation directory (usually this is /usr/src/httpd-2.2.0) and do the following:
./configure –prefix=/usr/local/apache-2.2.0 –enable-ssl –enable-cgi –enable-so –enable-rewrite –enable-proxy –enable-proxy-ajp
If you want to know what the options do, run ./configure –help Also, please make sure that the prefix fits your version of apache and that you are NOT overwriting anything. Finally, make sure that the configure command completed successfully and that you are not lacking any libraries (see above for libraries you might need).
Now type:
make
make install
Now, go to /usr/local/ and make a Symbolic Link on the new apache install called apache:
ln -s apache-2.2.0 apache
installing Tomcat
Go to /usr/local/ and untar the tomcat installer:
tar -zxvf /usr/src/jakarta-tomcat-5.5.16.tar.gz
This will create a new directory called jakarta-tomcat-5.5.16 in /usr/local/. You want to make a Symbolic Link to that directory called tomcat (look at the example in step a to see how to create a symlink)
You also need to edit /usr/local/tomcat/bin/catalina.sh to include the following:
JAVA_HOME=/usr/local/java
TOMCAT_HOME=/usr/local/tomcat
CATALINA_HOME=/usr/local/tomcat
JAVA_OPTS=”-server -Xmx200m -Dfile.encoding=ISO8859-1″
export LD_ASSUME_KERNEL=2.4.1
It is sometimes necessary to add but you should be sure you need it! Don’t add this unless you are sure you have to.
installing Java
Go to /usr/src/ and make the installer executable:
chmod +x j2sdk-1_4_2_11-linux-i586.bin
Now go to /usr/local/ and run the executable by typing the following (don’t change directories!):
/usr/src/j2sdk-1_4_2_11-linux-i586.bin
This will create a new directory called j2sdk1.4.2_11 in /usr/local/.
You want to make a symlink to that directory called java
Don’t forget to add startup scripts or links in /etc/init.d/ to make sure the applications start when the machine starts.
Et voilà! You are now done installing Apache and Tomcat! All you have to do at this point is add the configuration for the sites in /usr/local/apache/conf/httpd.conf and /usr/local/tomcat/conf/server.xml
|