download Linux x64 RPM jdk 7 installer from oracle to /tmp
wget http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.rpm
list rpm contents
rpm -qpil *file_name*
check if java is already installed
rpm -qa | grep -i java
rpm -qa | grep -i java
rpm -qa | grep -i java
# if no match on all => no java is installed
force install the rpm
yum install /tmp/jdk-7-linux-x64.rpm --nogpgcheck
check that java or jdk or jre is installed
rpm -qa | grep -i -e java -e jre -e jdk
where is java?
type java
java version
java -version
java compiler version
javac -version
check if tomcat is installed or httpd
rpm -qa | grep -i -e http -e tomcat
# => httpd-2.2.3-45.el5.centos.1
check version
rpm -qil httpd-2.2.3-45.el5.centos.1 | more
download a newer version if exists
wget http://apache.dataphone.se//httpd/httpd-2.2.19.tar.gz
check the package (what directories it creates, etc)
tar tvfpz httpd-2.2.19.tar.gz
unpack
tar xvfpz httpd-2.2.19.tar.gz
install
./configure
# if it fails => install the missing packages with yum
type ar ld nm # these 3 should be available, if not => yum install
make
make install
check if there is a start config
chkconfig --list | grep -i http
start httpd in start levels 3, 4, 5 (this takes effect the next time the server is restarted)
chkconfig --level 345 httpd on
start the service manually (if the server is not restarted)
service httpd start
check the status
service httpd status
# => httpd (pid ####) is running...
open the server from a browser => the server should respond
make sure the right version of httpd is running
httpd -version
# if incorrect version is running:
cd /use/local/apache2/bin
./httpd -version # => this is the one that should be started
cd rc.d/init.d # all start scripts
more ./httpd # => check which httpd is used
# even /etc/sysconfig/httpd is referenced, but everything is commented out inside it => nothing to do with this file
vi rc.d/init.d/httpd
# edit apachectl= to point to /usr/local/apache2/bin/apachectl
# edit httpd= to point to /usr/local/apache2/bin/httpd
# edit CONFFILE= to point to /usr/local/apache2/conf/httpd.conf
# :wq
service httpd start