This page will show step by step how we installed and configured our linux server. As the distribution we take CentOS 5.3
The configuration is followed this guide, enhanced, cropped and adapted to our needs.
Download and burn the CentOS 5.3 DVD from
You can get it here
Boot your server from the DVD and press Enter at the boot prompt
As it can take quite long we skip the test of the installation media
On the startup screen click Next
We choose English as our main language
As for the keyboard layout we take German (Swiss German)
Choose to install a new CentOS
Choose "remove linux partitions..." and accept the warning that you will loose all data
Set a manuall IP-Adress for the server as well as the host name and the misceallaneous settings
Subnet Mask: 255.255.255.0
Primary DNS: xxx.xxx.xxx.xxx
Secondary DNS: xxx.xxx.xxx.xxx
Set the time-zone to your nearest location
root password and confirm it
Select server as the default installation (we don't really need a Desktop Environment) and select "Customize now"
Change and select the default packages which should be installed on the server
Select the following:
- Text-based Internet
- Development Libraries
- Development Tools
- MySQL Database
- Server Configuration Tools
- Web Server
- Administration Tools
- System Tools
You have to switch between the registers to do so. Deselect all the other package groups, and click next, the installation routine will then check the dependencies.
Click next to start the installation
Now the harddisk will be formatted and your packages will be installed. Wait for it to be finished, remove the installation disk and click on Reboot.
Enter the firewall configuration after reboot
You can also at anytime entering the config by using the command
Set the setting above for the moment, depending on your need you may want to make adaptions here.
Also, we disabled SELinux a security extenion comming with CentOS, but it's suggest to be turned off as it may result in more troubles then it helps to prevent.
After your done configuring reboot the server for it's changes to take effect.
Install and update software packages
Install Apache, MySQL, phpMyAdmin
Actually MySQL and phpMyAdmin are optional steps you can skip if you don't want to use MySQL as your database for magnolia (if so how to configure magnolia for using MySQL can be found here on the wiki).
Import RPMforge repository as some of the packages we need are not part of the official CentOS 5.3 repository
Download and install the needed packages
Start MySQL and set the root password
First we comment out some, for phpMyAdmin not only allowing access from localhost.
Now we change the authentication in phpMyAdmin from cookie to http.
Create system startup links for Apache and start it
At this point you can earn from your work so far and go check http://webserver.yourcompany.com for the CentOS default apache startpage and http://webserver.yourcompany.com/phpmyadmin for the PhpMyAdmin Administration startpage.
Installing JDK (Java Development Kid)
Download the latest JDK (or the one you specifically need)
You can get it here http://java.sun.com/javase/downloads/index.jsp
Copy it to your prefered download directory like
/usr/download and execute it.
Download the binary of your preferred Tomcat version to your download directory.
You can do so at http://tomcat.apache.org/ choose the tar.gz file from the core section.
Change to your download directory and extract the files.
Startup Script for tomcat
We want tomcat to start automatically when booting our server, so we add a corresponding script file.
Now we are making a softlink for being able to start/stop/restart tomcat
Finally we add the script to chkconfig for tomcat being automatically started on booting the server.
For adding more memory to the instance, and make it a bit more stable (reduced termination signal) we create and add the following to
setenv.sh as well as we define the JAVA_HOME Variable and increasing the number of open files allowed by the process (this is especially important during installation, otherwise the process will fail).
You can start/stop your tomcat server now
When you started it up you should be able to see the Tomcat default page: http://webserver.yourcompany.com:8080/
Installing and configuring mod_jk
Install APXS (Apache Extension Tools)
This will install APXS under
Download and compile the source of the tomcat connector
You can download the file here: http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/source/jk-1.2.15/jakarta-tomcat-connectors-1.2.15-src.tar.gz, save under the
Now that we compiled our
mod_jk.so we can copy it to our
First we gonna create the
Then we will change the apache configuration for using mod_jk, if defined so in the corresponding virtual hosts.
Uncomment the following line in
And finally we can create a virtual host definition file for redirecting requests to our tomcat application server.
Download and unpack magnolia
Then place your WAR-File in
/etc/tomcat/default/webapps and startup tomcat, the file will automatically be extracted into something like magnolia-enterprise-webapp-4.1 (which then also is the path where you can access your instance -> http://webserver.yourcompany.com/magnolia-enterprise-webapp-4.1)
Alternatively you can also extract the war-file manually into any folder under
/etc/tomcat/default/webapps. With out any further cofiguration the context-path of you web-application will be the name of that folder.
If you want to have a plain context path, just place your Web-Application in a folder called
ROOT (maybe remove it's content as well as the management applications if you don't really need them.
Start your tomcat and visit your server address defined in the virtual host (http://webserver.yourcompany.com). And now depending on your context path of the web application you should be able to see the magnolia's installation screen.
For security reasons you may want to run you romcat using a non priviledged user, remember in that case to edit your script in
Adding Multiple Tomcat Instances
You can easily run multiple tomcat instances on the same server. The following steps are need for doing so:
* Copying the current tomcat to a second one
* Copying and addapt the init.d script and add the copied one to chkconfig
* If needed creating another softlink with a different name (tomcat2 or something like that) in
/usr/bin* Changing the port-numbers of the copied tomcat in
/etc/httpd/conf/workers.poperties* Creating an aditional virtual host for apache using this extended worker