Configuring Multiple Instances of Railo on Linux

Similar documents
SELinux Workshop Redux Jamie Duncan, Red Hat RVaLUG 19 April 2014

LAMP Stack with VirtualHosts On Centos 6.x

Lab 3a Using the vi editor

Apparo Fast Edit. Installation Guide 3.1

Se#ng up your mul.- engine environment Apache, Railo and ColdFusion

MODEM on HP-UX. Guy Van Sanden.

1 Installation 2 "Add New Printer"... Window 3 "Device for" Window "Device URI for"... Window. 7 Specify Printer... Model

CTEC1863/2017F Lab #11, Part 1 Page 1 of 11. In this lab, we will be installing a popular solution for database-driven web sites.

Certification. The HTTP Service

ameh Documentation Release Eric Pierce

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:

macos High Sierra Apache Setup: Multiple PHP Versions First part in a multi-part blog series for Mac developers

Tomcat Load Balancing for Progress Application Server for OpenEdge

This tutorial will guide you how to setup and run your own minecraft server on a Linux CentOS 6 in no time.

Definition Center Installation for Linux

Tungsten Dashboard for Clustering. Eric M. Stone, COO

7.3 Install on Linux and Initial Configurations

#Uncomment the second line to enable any form of FTP write command. #write_enable=yes

Purpose. Target Audience. Install SNMP On The Remote Linux Machine. Nagios XI. Monitoring Linux Using SNMP

[UNIT 1 <Continued>]: <Understanding Apache>

Installation Guide. Apparo Fast Edit. For Linux / IBM AIX. IBM Cognos Analytics. Version Single Instance

Installation Guide. Apparo Fast Edit. Version 3.1

Nagios User Guide. You can use apt-get to install these packages by running the following commands:

GNU/Linux: An Essential Guide for Students Undertaking BLOSSOM

Load balancing configuration. Technical specification

Configure HOSTNAME by adding the hostname to the file /etc/sysconfig/network. Do the same to all the all nodes.

Masternode Setup Guide

Managing Xen With Xen-Tools, Xen-Shell, And Argo

Apache Httpd Manual Conf Virtualhost Redirect

Configure HOSTNAME by adding the hostname to the file /etc/sysconfig/network. Do the same to all the other 3(4) nodes.

Post Ubuntu Install Exercises

ViMP 2.0. Installation Guide. Verfasser: ViMP GmbH

Some Ubuntu Practice...

L.A.M.P. Stack Part I

A PAtCHy server: developed by the Apache group formed 2/95 around by a number of people who provided patch files for NCSA httpd 1.3 by Rob McCool.

Installation Guide. Apparo Fast Edit. Multi Instance. Version 3.0

Metasploit. Installation Guide Release 4.4

ULTEO OPEN VIRTUAL DESKTOP CENTOS 6.0 SUPPORT

Two factor authentication for Apache using mod_auth_xradius

Apache + PHP + MySQL. bdnog November 2017 Dhaka, Bangladesh

How To Start Mysql Use Linux Command Line Windows 7

VCP-DCV5, OCP (DBA), MCSA, SUSE CLA, RHCSA-7]

Implementing load balancing for PAS for OpenEdge based on Tomcat Load Balancing

Bitnami Ruby for Huawei Enterprise Cloud

CSN09101 Networked Services. Module Leader: Dr Gordon Russell Lecturers: G. Russell

MAPLE 2017 STEP BY STEP INSTALLATION INSTRUCTIONS

ModSecurity2 Installation, and Configuration

Servers for Hackers. Server Administration for Programmers. Chris Fidao. This book is for sale at

Digital Free Library. Created by Kirby Griese. Last updated on :35:15 PM UTC

[ Due: N.A ] [ Points: PRICELESS ] [ Date: 2/9/2016] [ Goings, Jesse ] Computer Network Specialist Center For Arts and Technology College Kelowna BC

Protection! User Guide. A d m i n i s t r a t o r G u i d e. v L i c e n s i n g S e r v e r. Protect your investments with Protection!

Getting Started with PetaLinux SDK

WA2572 Introduction to Responsive Web Development for Mac. Classroom Setup Guide. Web Age Solutions Inc.

Ubuntu Practice and Configuration Post Installation Exercises interlab at AIT Bangkok, Thailand

Precursor Steps & Storage Node

Linux Administration

EX200 Q&A. DEMO Version

Communication protocols and services

SETTING UP 3 WORDPRESS SITES ON APACHE AND UBUNTU BY RAMI

Linux Systems Administration Getting Started with Linux

This material is based on work supported by the National Science Foundation under Grant No

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

Buzztouch Server 2.0 with Amazon EC2

Physics REU Unix Tutorial

Apache MySQL PHP PHPAdmin Install

An internal CA that is part of your IT infrastructure, like a Microsoft Windows CA

Open a browser and download the Apache Tomcat 7 and Oracle JDBC 6 JAR from these locations. The Oracle site may require that you register as a user.

Installation Guide. Apparo Fast Edit. Version 3.1

Download the current release* of VirtualBox for the OS on which you will install VirtualBox. In these notes, that's Windows 7.

Linux Quick Installation Guide

Installing LAMP on Ubuntu and (Lucid Lynx, Maverick Meerkat)

IDOL Site Admin. Software Version Installation Guide

GMU Specifications And Installation Procedures Page 1 04/04/08. JBM Gateway Management Utility Server Specifications And Installation Procedures

More on file systems, Booting Todd Kelley CST8177 Todd Kelley 1

Installing FreePBX 14 on CentOS 7

PHEWR Installation Guide (version 3)

Setting Up PHPlist (Open-Source Newsletter Manager)

(U) Hive Infrastructure Installation and Configuration Guide

Apache Manually Install Ubuntu Alongside Windows 7 Step By Step

KillTest 䊾 䞣 催 ࢭ ད ᅌ㖦䊛 ᅌ㖦䊛 NZZV ]]] QORRZKYZ TKZ ϔᑈܡ䊏 ᮄ ࢭ

Bitnami Re:dash for Huawei Enterprise Cloud

INSTALLATION GUIDE.

DAY 2! Logs, Aliases, Redirects, Rewrites, and More! Oh My! Thursday, November 8, 12

Bacula Server Installation and Configuration on Centos 6.2

NeXpose Software Installation Guide

Services, logging, accounting Todd Kelley CST8177 Todd Kelley 1

Raspberry Pi as an Ad Blocking Access Point

: the User (owner) for this file (your cruzid, when you do it) Position: directory flag. read Group.

EX200 EX200. Red Hat Certified System Administrator RHCSA

شرکت توسعه ارتباطات پردیس پارس. owncloud. The last file sharing platform you'll ever need

Genesys Administrator Extension Deployment Guide. Prerequisites for Genesys Administrator Extension Modules

Shell Script Not Running Via Cron Runs Fine Manually

Deltek Maconomy. Installation Guide For Standard and PSO Installations

APACHE INSTALLATION & BASIC CONFIGURATION. Thursday, November 8, 12

DxR clinician INSTRUCTOR MANUAL STUDENT USER MANUAL TECHNICAL APPENDIX

Install and Configure Samba - CentOS 7

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Getting Started With Cpsc (Advanced) Hosted by Jarrett Spiker

Exam Questions Demo LPI. Exam Questions Linux Networking Administration.

1 Installation (briefly)

Transcription:

Configuring Multiple Instances of Railo on Linux The purpose of this guide is to explain how to set up multiple instances of Railo on a single instance of Linux. The instances can then be used for redundancy, development environments, etc. This guide was written specifically for CentOS 6, but setting up multiple instances on other versions of Linux should be quite similar. Feel free to adapt the commands and methods described here as necessary in order to accomplish the same processes for your specific environment. We will be using the Railo 4.1.1.009 Linux 64-bit installers, as they are the most recent at the time this document was created. System Shortlist: CentOS 6 Linux 64-bit Apache 2.2 Railo 4.1.1.009 (railo-4.1.1.009-pl0-linux-x64-installer.run) Logged in as root Preplanning It will be necessary to do a small amount of pre-planning in order to organize our multiple instances of Railo using file names, directory names, and port numbers that we can easily identify as we use our system. In the following scenario, I will be naming my instances simply using numbers (railo instance 01, and so on). Using this naming convention makes it easy to identify which shared resource belongs to which instance. For example, the home folder of /opt/railo01/ is easily identified as the home folder for Railo instance 01. The control script is likewise easily identified as /etc/init.d/railo01_ctl. Using a numbering method is also useful in identifying ports: Tomcat HTTP default port: 8888 Tomcat AJP default port: 8009 Tomcat SHUTDOWN default port: 8005 We can rename these to match our numbering mechanism: Tomcat http custom port: 88nn Tomcat ajp custom port: 89nn Tomcat shutdown custom port: 85nn

In this way, we can easily identify which ports belong to which instance and what the port is connected to. You may also want to consider a naming mechanism for the home directories of each site that each instance will use. For example, sites that are run from the 01 instance, you may want to store in a directory that is named something similar to /var/www01/, however, this is less important as these files are not necessarily tied to a specific Railo instance. It would be purely for organizational purposes and would not be needed for anything functional like custom ports and railo home directories are. Installing the First Instance of Railo/Tomcat Installing the first instance of Railo is pretty strait-forward, with a few customizations: 1. Download the installer from http://railo.viviotech.net/ 2. Change the permissions on the newly downloaded file to be executable by running the command: root@local# chmod 700 railo-4.1.*.run

3. Launch the installer, and set the installation directory to /opt/railo01/ - this will help us properly identify our separate installations later on. root@local#./railo-4.1.1.009-pl0-linux-x86-installer.run 4. On the Tomcat Ports prompts, set the ports to the customized port numbers that we talked about earlier. Since this is our first install, I will use ports 8801, 8901, and 8501, to match our numbering convention: 5. You can customize the user Railo runs as also, but that is entirely up to you. In this example, since this is jut a dev machine, we'll keep things easy and run as root. 6. Do NOT select to start at boot time; we need to customize it first. 7. Do NOT install the Apache Connector at this time; we need to install it manually. Now that we have the first instance up and running, we should be able to run the netstat command to see our first Railo instance running happily on it's custom ports: root@local# netstat -ltpn

Customizing the Railo/Tomcat Daemon The next thing we need to customize is the Railo/Tomcat Daemon by customizing the railo_ctl file a little bit. Thankfully, the bulk of the customization is done by the installer, and we just need to tweak a couple small things in the file along with the file name: 1. Update the railo_ctl service description: 1. Open the railo_ctl file using the editor of your choice. I'll use vim here, but nano is also pretty popular due to it's easy control reference: root@local# cd /opt/railo01/ root@local# vim railo_ctl 2. At the top of the file, update the Provides file name to be railo01_ctl (or whichever instance you're working on) and update the description to be more specific. Updating these will ensure the service will be reported correctly if you're using a system that displays INIT INFO values.

2. Rename and Copy railo_ctl 1. Next we need to rename our railo_ctl file to match our Railo instance number. You can do that with the following command: root@local# mv railo_ctl railo01_ctl 2. After we've renamed the file, let's put a copy in the init.d directory so we can have that instance of Railo start at boot time: root@local# cp railo01_ctl /etc/init.d/ 3. Create the Railo Daemon 1. Last we need to add Railo to the list of deamons that start at boot time. We do this on CentOS using the chkconfig command: root@local# chkconfig railo01_ctl on 2. We can make sure the daemon was added by having chkconfig list out the runlevels that the daemon is set to start on using the --list parameter: # chkconfig railo01_ctl list root@local# chkconfig railo01_ctl --list Test that your new service starts correctly by giving your machine a quick restart. Repeat the above installation and deamon configuration steps for each instance you create on your server. Connecting an Apache VirtualHost to a Railo Instance Now that you have multiple Railo instances to work with, you need to connect your Apache VirtualHosts a specific Railo instance. I'm going to show you how to do that specifically in mod_proxy, since it's currently the default connector method of the Railo Installer,

however, every connection method I'm aware of has the ability to customize which port it connects to, and that's pretty much all we'll be doing here customizing the ports that each VirtualHost connects to. Install mod_cfml Mod_cfml is a helper module, which means it doesn't do any connecting on it's own. This is nice, in a way, because it gives us some flexibility in what actual Apache connector we use. Further, it also means that we only need to install mod_cfml ONCE. Since mod_cfml does not do any actual connecting on its own, the standard, global install of mod_cfml will work just fine when it comes to multiple instances of Railo. Each Railo instance you installed comes with a mod_cfml installation script. We can use any one of them in order to install it. For this example, I'll be using the mod_cfml install script that we installed with our first Railo01 instance. IMPORTANT: Try to use a Railo instance that you will not remove from your server, as mod_cfml will be point to files within that instance. If you ever remove that Railo instance from your system that mod_cfml is pointing to, your sites will not load and you will get errors from Apache until you re-point your mod_cfml config to files from an existing Railo install. The mod_cfml install script is located in the sys folder of any Railo install: root@local# cd /opt/railo01/sys/ The install script will need to know a few things, like where the Apache config file is, etc. Just run the script without any parameters to get usage information: We'll use the CentOS defaults in our command: root@local# /opt/railo01/sys/install_mod_cfml.sh -m install -l /opt/railo01 -f /etc/httpd/conf/httpd.conf -c /usr/sbin/apachectl

Well, the output could have been prettier, but it looks like it worked just fine. The install script is nice because it makes sure you have mod_perl installed as well. If you don't already have mod_perl installed, it will attempt to install it for you. Let's go check out our Apache config. Our mod_cfml code should be at the very bottom of it. Looks good. Notice how the mod_cfml.pm file it points to is in the Railo01 directory. This is important. If you ever remove the Railo01 instance, you will need to update this to either point to a Railo instance that exists, or put the mod_cfml.pm file in a more permanent location. Configure the Apache VirtualHosts Now that mod_cfml is installed, we need to configure our sites to connect to a specific Railo instance. As stated earlier, all we need to do to accomplish is customize our connector method to use the specific port of whichever instance we want it to use. In the following example, I've used the 8801 port to connect my railo01-testsite to my Railo 01 instance: <VirtualHost *:80> ServerName railo01-testsite

DocumentRoot /var/www/railo01-testsite/ DirectoryIndex index.cfm index.html ErrorLog logs/railo01-testsite-error_log CustomLog logs/railo01-testsite-access_log common <IfModule mod_proxy.c> <Proxy *> Allow from 127.0.0.1 </Proxy> ProxyPreserveHost On ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ http://127.0.0.1:8801/$1$2 ProxyPassMatch ^/(.+\.cfchart)(/.*)?$ http://127.0.0.1:8801/$1$2 ProxyPassMatch ^/(.+\.cfml)(/.*)?$ http://127.0.0.1:8801/$1$2 ProxyPassReverse / http://127.0.0.1:8801/ </IfModule> </VirtualHost> Works like a charm! Customize your mod_proxy config and ports for each site/instance you want to connect to.

Note About Firewall Exceptions During install, CentOS will prompt you if you want to install a firewall. Most folks say yes because they want to be secure, and this is a good thing. However, this can block you from seeing your sites. To fix this, you may need to add an exception to your firewall rules. You can do this by modifying your /etc/sysconfig/iptables (on CentOS) file and adding an exception similar to the one in the attached screen shot:

Once you've added the exception, restart your firewall so your new exception takes effect: root@local# /etc/init.d/iptables restart Note on SELinux SELinux or, Security Enhanced Linux is suggested to be installed during the install process. While it is possible to run Railo with SELinux enabled and running, it is time-consuming to manage and generally not required for development environments. If you have difficulty getting your sites to work (IE: getting permission denied errors in your apache logs for mod_proxy, and Service Temporarily Unavailable from Apache), it is probably due to SELinux restricting access to your files. Managing your sites with SELinux enabled is outside the scope of this document, but you can disable SELinux and see if it is SELinux that is causing your problem by running the following command as root: root@local# echo 0 >/selinux/enforce If you want to permanently disable SELinux, you can modify the following file: /etc/selinux/config with SELINUX=disabled.