Skip to content

Instantly share code, notes, and snippets.

@bvajda
Created August 22, 2011 07:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bvajda/1161859 to your computer and use it in GitHub Desktop.
Save bvajda/1161859 to your computer and use it in GitHub Desktop.
Java app server on CentOS 5.6

Install JDK 7 on CentOS 5.6

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment