5. Creating or Migrating ERS Instances

You use the ers-server.pl Perl script to create new instances of both ERS Tomcat and ERS httpd and to migrate existing ERS httpd instances.

Note that the exact same script is included in the two ERS component packages (ERS httpd and ERS Tomcat). For this reason, this section applies to both ERS components. If, for example, you have installed only ERS Tomcat, then you can ignore the option of the script that applies only to ERS httpd (--apachever). This section provides examples for both ERS Tomcat and ERS httpd.

The ers-server.pl script creates new ERS Tomcat or ERS httpd instances in the ERS-HOME/servers directory.

The following output from the script shows all the available options:

ers-server.pl - install an ERS 4.0 server instance
                from the default (_instance/ trees) template

Syntax:

        --ersdir=/path/to/ers-root        default is current dir
        --server=servername               hostname and default path to create
        --serverdir=/path/to/instance     override servers/{servername} destdir
        --overlay                         overlay existing {serverdir} files

        --apachever=[1.3|2.0|2.2[-64]]    deploy new server using Apache httd
        --tomcatver=[5.0|5.5|6.0]     deploy new server using Apache Tomcat
        --javapath=[j5sdk[64]|j6sdk[64]]  abs or rel path to jdk/jre for Tomcat

        --erssrc=/path/to/old-root        migrate ers; default is current dir
        --migrate=oldname                 existing servers/{oldname} instance
        --migratedir=/path/to/instance    override servers/{oldname} source dir

        --quiet                           bypass all interactive prompts

5.1 Creating New ERS httpd or ERS Tomcat Instances

New server instances do not have examples enabled, have no preconfigured content other than a default welcome page, and are intended for production usage.

You specify on the command-line which type of instance you want to create (ERS httpd or ERS Tomcat) using the --apachever and --tomcatver options, respectively. You specify the name of the server using the --server option. Finally, when creating an ERS Tomcat instance, you must also use the --javapath option to specify the full pathname of your JDK or JRE.

When you use ers-server.pl to create a new instance you will be asked a series of questions which will control the configuration of the instance you create. For example, if you create an ERS Tomcat instance, you will be asked for the various listen ports, such as shutdown, HTTP, and AJP. When you create a new ERS httpd instance, you will be asked whether you want to enable certain modules (such as mod_perl or mod_php5) as well as values for various listen ports, server host and email information, and security information such as whether to enable SSL, and if so, you will be asked to provide an initial user account and password and optionally create a temporary SSL certificate, signing request, and key as part of the installation.

For clarity, it is assumed in the examples of this section that you installed ERS in /opt/ers.

The following example shows how to create a new ERS httpd instance:

prompt$ cd /opt/ers
prompt$ perl ers-server.pl --server=myHttpServer --apachever=2.2 

Note: It is assumed in the preceding command that Perl is in your PATH; if it is not, specify the full pathname. For example, on Windows, if you installed Perl in c:\home\perl5.8:

prompt> c:\home\perl5.8\bin\perl ers-server.pl --server=myHttpServer --apachever=2.2 

The preceding example shows how to create a new ERS httpd server called myHttpServer that uses version 2.2 of Apache HTTP.

The following example shows how to create a new ERS Tomcat instance:

prompt$ cd /opt/ers
prompt$ perl ers-server.pl --server=myTomcatServer --tomcatver=6.0 --javapath=/opt/java/jdk1.6.0_18

The preceding example shows how to create a new ERS Tomcat server called myTomcatServer that uses version 6.0 of Apache Tomcat and the JDK installed in /opt/java/jdk1.6.0_18.