Archive

Posts Tagged ‘CentOS’

CentOS Tomcat install quick guide

March 20th, 2012

Prerequisite: Java/JDK has been installed.

Download your preferred Tomcat version from http://tomcat.apache.org/

The mapping between the specifications and the respective Apache Tomcat versions is:

Servlet/JSP Spec Apache Tomcat version Actual release revision Minimum Java Version
3.0/2.2 7.0.x 7.0.26 1.6
2.5/2.1 6.0.x 6.0.35 1.5
2.4/2.0 5.5.x 5.5.35 1.4
2.3/1.2 4.1.x (archived) 4.1.40 (archived) 1.3
2.2/1.1 3.3.x (archived) 3.3.2 (archived) 1.1

Extract the gzip file

gunzip apache-tomcat-<version>.tar.gz

and then untar it to your preferred location

tar xvf apache-tomcat-<version>.tar

Set service

Credits to Satollo.net: Look for the tomcat service script here.

The file needed to be copied in /etc/init.d, and then

chown root:root /etc/init.d/tomcat

chmod a+x /etc/init.d/tomcat

To install the script for various runlevels, run

/sbin/chkconfig –add tomcat

it will be marked as “on” for runlevel 3, 4, 5 . To see the configuration of all services, you can run

/sbin/chkconfig –list

To start and stop Tomcat:

/etc/init.d/tomcat start

/etc/init.d/tomcat stop

To make a shortcut  or soft link:

ln -s apache-tomcat-5.5 tomcat

Software, Technology , ,

CentOS Java JDK install quick guide

March 18th, 2012

It is recommended to install JDK from Sun Oracle.

Download the latest from Oracle’s website by selecting the correct version for your server.

Eg. latest version available now is jdk-7u3

Linux x86 (32-bit) 63.65 MB jdk-7u3-linux-i586.rpm
Linux x64 (64-bit) 64.53 MB jdk-7u3-linux-x64.rpm

Check your OS version with the following command:

uname -a

x86_64 GNU/Linux  is a 64 bit OS

ia64 GNU/Linux is a 64 bit OS

i386 GNU/Linux is a 32 bit OS

Once download, you can install it by running the file

rpm -iv jre-<version>-linux-<os>.rpm

JDK will be installed under /usr/java

If you have downloaded the binary installer and not a rpm file, refer to this.

Software, Technology , , , ,

CentOS LAMP quick guide

March 17th, 2012

Quick guide to install LAMP – Linux Apache MySQL PHP on CentOS server.

Install LAMP

yum -y install httpd php mysql mysql-server php-mysql

This will take a few minutes to download (total package size is 16Mb)

Once its done Yum will say “Complete!” and you will be returned to shell.

Next, you need to set a MySQL root password. Without this, your MySQL server is open to attack, and it WILL happen! Use the following command (WITH QUOTES) to set your root password:

mysqladmin -u root password 'ENTER-PASSWORD-HERE'

NOTE: Single quotes are required

Finally, we are going to set Apache & MySQL to run on startup. This is useful if your server has a power outage or needs to be rebooted as it will automatically restart Apache & MySQL for you.

  /sbin/chkconfig httpd on
  /sbin/chkconfig --add mysqld
  /sbin/chkconfig mysqld on
  /sbin/service httpd start
  /sbin/service mysqld start

To check everything worked, browse to the web servers directory (on CentOS its /var/www/html) and create a new file using text editor called phpinfo.php.

Enter the following code into that file to check PHP is working:

<php echo phpinfo(); ?>

Credit : Ricky Mills

Install MySQL Admin tools

Download from MySQL website at http://dev.mysql.com/downloads/gui-tools/5.0.html

You will find these useful : MySQL Administrator and MySQL Query Browser.

Select your version for download:

RedHat Enterprise Linux 3 (x86) RPM (bundled dependencies) 5.0r12 19.4M
RedHat Enterprise Linux 4 (x86) RPM (bundled dependencies) 5.0r12 17.8M

Or you could try the newer Workbench.

Software, Technology , , , , ,