Ubuntu 安装 resin

来源:互联网 发布:人工智能 基金 编辑:程序博客网 时间:2024/06/06 02:26

resin installation


starting resincommand line

Resin Step-by-Step Installation Guide If you've decided that you're ready to deploy Resin for production, this page will guide you through the steps to install this powerful application server system-wide. You'll see where we recommend installing the various components of Resin as well as some basic production tuning tips.

  1. Resin Server Installation
    1. Preparing for installation
    2. Installing Resin on Unix or Mac OS X
      1. Configuring the build process for Resin
      2. Building and Installing Resin
      3. Installing Resin using the .deb package on Ubuntu and Debian
    3. Installing Resin on Windows
  2. Resin Content Installation
    1. Content from the top down
    2. Permanent content locations
  3. Starting Resin
    1. Creating Unix startup scripts for Resin
    2. Installing Resin as a Windows Service
  4. Creating a password for the Resin Administration Console
  5. Troubleshooting

Resin Server Installation

This page is for you if you:

  • Are evaluating Resin
  • Want to do local application development with Resin
  • Have evaluated Resin and are ready to install system-wide

This page leads you step-by-step through the installation of Resin. After going through these steps, you'll have a full Java and PHP Application Server able to serve even the most demanding web sites.

You'll learn:

  • How to install Resin system-wide
  • The recommended installation locations for Resin
  • How to run the Resin administration application

Preparing for installation

  1. Install JDK 1.5 or later. You'll need to set the JAVA_HOMEvariable in your shell or link /usr/java to the Java homedirectory.
  2. Download the latest version of Resin 4 from the Resin download page.Grab the Professional version if:
    • You have purchased a Resin Professional license.
    • You have obtained an evaluation Resin Professional license.
    • You are considering purchasing Resin Professional (without a license, Resin Professional simply downgrades to the open source functionality). This will make it easier to upgrade in the future.
  3. Unzip or untar the Resin download. If you downloaded ResinProfessional, it will unzip into resin-pro-4.x.x/, otherwise itwill download into resin-4.x.x/.

Installing Resin on Unix or Mac OS X

If you're installing Resin on Windows, you can skip to the next section.If you're installing Resin on Ubuntu or Debian and want to use the .debpackaged version of Resin, skip to the end of this section.

Configuring the build process for Resin

Next we'll change into the Resin directory we just unpacked toconfigure and build the server. The Java portions of Resin arealready compiled, but this step will build additional C-basedcomponents of Resin that provide additional functionality such as:

  • A faster IO library, including massive keepalive support *
  • Support for OpenSSL *
  • The ability to run as a non-priviledged user for security
  • Connector modules for Apache

(* only available in Resin Professional)

The following command installs Resin and its files into the recommendedlocations on the file system:

./configure --prefix=/usr/local/resin /
--with-resin-root=/var/www /
--with-resin-log=/var/log/resin /
--with-resin-conf=/etc/resin

This will configure Resin to install in /usr/local/resin,with support for OpenSSL if it was detected, but without supportfor Apache. If you want to use Apache or another 3rd party HTTPserver in front of Resin (unrecommended), please take a lookat our third-party HTTP serversetup documentation. If you need to configure other optionswith Resin, now is the time to do it. Please consult the reference to all the configuration options.

Once you've run the configuration successfully, the configure scriptwill display a summary like the following:

Resin Configuration summary:

RESIN_HOME: /usr/local/resin
root: /var/www
conf: /etc/resin/conf
log : /var/log/resin
init: /etc/init.d/resin

+ epoll() for keepalives
+ OpenSSL 0.9.8g 19 Oct 2007
OpenSSL include: /usr/include
OpenSSL lib: /usr/lib
OpenSSL libraries: -lssl -lcrypto

JAVA_HOME: /usr/lib/jvm/java-6-sun
+ 32-bit JNI in -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux
JNI CFLAGS: -g -O2 -DPOLL -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -DHAS_SOCK_TIMEOUT -DHAS_JVMTI

Building and Installing Resin

Now that you've configured the Resin build process, all you need todo is build and install! To build, just run

make

If this step went well, you'll now need to install the Resin files asthe root user:

sudo make install

Where ever you install Resin to, we'll refer to that directory asresin.home.

If you have a license file for Resin, save it in /usr/local/resin/licenses

Installing Resin using the .deb package on Ubuntu and Debian

We provide a Debian packaged version of Resin that Debian and Ubuntuusers can take advantage of. It performs all of the installationsteps above for you and creates all the recommended server andcontent directories. Simply download from the Resin download page and installusing dpkg.

Alternatively, you can add Caucho's Debian repository to your system'srepositories to use automated update tools like Synaptic and apt-get.To do this, add the following line to your /etc/apt/sources.list

deb http://caucho.com/download/debian unstable multiverse

After adding this line, update your local repository cache by running:

apt-get update

Finally, install Resin Professional using the following:

apt-get install resin-pro

If you have a license file for Resin, save it in /usr/share/resin/licenses

Or install Resin Open Source with this command:

apt-get install resin

Installing Resin on Windows

The native libraries that are included with Resin are precompiledfor Windows in both 32-bit and 64-bit mode. These libraries provide:

  • A faster IO library, including massive keepalive support *
  • Support for OpenSSL *
  • Connector modules for Apache/IIS

(* only available in Resin Professional)

  1. Download the latest version of Resin 4 from the Resin download page.Grab the Professional version if:
    • You have purchased a Resin Professional license.
    • You have obtained an evaluation Resin Professional license.
    • You are considering purchasing Resin Professional (without a license, Resin Professional simply downgrades to the open source functionality). This will make it easier to upgrade in the future.
  2. Unzip or untar the Resin download. If you downloaded ResinProfessional, it will unzip into resin-pro-4.x.x/, otherwise itwill download into resin-4.x.x/.
  3. Move the directory from the previous step to C:/Resin
  4. Run C:/Resin/setup.exe
  5. If you have a license file for Resin, save it in C:/Resin/licenses

Resin Content Installation

Once your have the Resin server installed, you can start installing yourcontent.

Content from the top down

Resin and JavaEE organize content into "web applications" orwebapps. As an administrator, your developers have probably providedyou with a webapp in the form of a .war file or a webapp directory.In the Resin root directory is a special subdirectory namedwebapps which is a webapp deploy directory.Deploying applications in Resin is as easy as copying a .warfile or web application directory to one of these webapp deploydirectories. Resin detects the applications and deploys themautomatically.

In the directory structure above, notice the special webappdirectories named "ROOT". These will map to the "/" (root)application. Other webapps will map to their name. For example,"wordpress" will map to "http://www.example.com/wordpress".

Permanent content locations

Resin is configured to use the content directory structure show aboveby default. In the examples, the Resin root directory is /var/www. This directory is also the recommended content rootfor Unix. For Windows, the recommended content root is C:/www.To specify the root directory to Resin, you pass it on thecommand line when starting the server. For example:

java -jar ${resin.home}/lib/resin.jar --root-directory /var/www

If you use the Unix startup scripts mentioned in the next section, theyautomatically specify the root and log directories.

Starting Resin

Creating Unix startup scripts for Resin

When you installed using the .deb package or when you ran "make install"earlier, the installer created a file named /etc/init.d/resinwhich contains a standard Unix init.d startup file. This file will startResin when invoked as:

/etc/init.d/resin start

Use the tools that came with your system to execute the scripton startup.

Installing Resin as a Windows Service

Resin can be instaled as a Windows Service by executing theSetup.exe. Setup.exe is a GUI utiltity that allowsto install and un-install Resin windows service.

Creating a password for the Resin Administration Console

One of the most useful tools provided with Resin is the built-in,web-based administration console. This tool provides detailedinformation about the operation of the server, a feature that is very useful to administrators, but one which must be kept secure fromunauthorized users.

If you are deploying Resin to a production machine, it's likelythat you won't be running your browser on the same system as theserver. In this case, you'll need to configure Resin to allowyou to access the server remotely.

  1. Edit /etc/resin/resin.xml
  2. Change the line:
    <resin:set var="resin_admin_external" value="false"/>

    to

    <resin:set var="resin_admin_external" value="true"/>
  3. Save /etc/resin/resin.xml and restart the server.
  4. Replace "localhost" with the name of your host in the URLs below.

Now that you're able to access the administration application,you have to set up a password and install it. In order to provethat you have access to the machine on which Resin is running,the only way to change the password is to create a file with theauthentication information on that machine.

  1. Browse to http://localhost:8080/resin-admin/
  2. Enter a username and password in the lower half of the page, then click "Create Configuration File". The recommended username is "admin".
  3. After going to the next page, a new "admin-users.xml.generated"file has been created for you in the same directory as yourresin.xml file is located. (If you followed the directions above,this should be in /etc/resin for Unix and C:/Resin/conf for Windows.)Just rename this file to admin-users.xml and Resin will use it to
  4. Browse back to http://localhost:8080/resin-admin/. Thechange you made should force Resin to restart and return a 503 error. Just hit refresh in a few moments to bring up the page again.
  5. You should now be able to login using the username and passwordthat you gave above.

Troubleshooting

If something went wrong above, the first place to check for problems isthe log.

  • If you are using Unix, look in /var/log/resin/jvm_default.log
  • If you are using Windows, look in C:/Resin/log/jvm_default.log

Hopefully, the log message will be clear enough for you to figure out theproblem. If not, you have a number of resources available to you to helpyou figure out what's going wrong:

  • The Resin mailing list.
  • The Resin Forums.
  • Presales technical support for those considering purchasing Resin Professional.
  • Paid technical support directly from the Resin developers.
原创粉丝点击