Resin Documentationapp server |
resin installation quick start
If you're using Resin for the first time, this section will show you how to install Resin, start it, and deploy your application.
Oracle's JDK for Windows, Solaris, and Linux can be found at http://www.oracle.com/technetwork/java/javase/downloads/index.html. Oracle also has links to some other ports of the JDK. Resin will not be fully functional while using a JRE. When Resin is installed on a Unix system:
/etc/resin/resin.properties # configuration properties /etc/resin/resin.xml # configuration file /etc/resin/licenses/ # license location /etc/resin/conf/keys/ # openssl keys /var/resin/ # resin.root (content) /var/resin/webapps/ # default deployment directory /var/log/resin/ # resin logs /usr/local/share/resin/ # resin.home (binaries and libraries) When Resin is installed on a Windows system:
resin-4.0.x/ # installation directory: resin.home, resin.root conf/resin.properties # configuration properties conf/resin.xml # configuration file conf/licenses/ # license location conf/keys/ # openssl keys webapps/ # default deployment directory logs/ # resin logs Installation steps for the major operating systems are outlined below: Debian Unix .deb and apt-getDebian users can download a .deb packaged version of Resin or use apt-get to install Resin. The Debian package performs all of the installation steps above for you and creates all the recommended server and content directories. Simply download from the Resin download page and install using dpkg. Alternatively, you can add Caucho's Debian repository to your system's repositories to use automated update tools like Synaptic and apt-get. To do this, you can add the debian repository as follows: unix# add-apt-repository http://caucho.com/download/debian unix# apt-key adv --fetch-keys http://caucho.com/download/debian/archive.key After adding this line, update your local repository cache by running: unix# apt-get update Install Resin Professional with this command: unix# apt-get install resin-pro Or install Resin Open Source with this command: unix# apt-get install resin RedHat and CentOS .rpm filesRPM files are available at http://caucho.com/download. The RPM public key is at http://caucho.com/download/rpm/RPM-GPG-KEY-caucho. unix# rpm --import http://caucho.com/download/rpm/RPM-GPG-KEY-caucho unix# yum install http://caucho.com/download/rpm/4.0.30/x86_64/resin-pro-4.0.30-1.x86_64.rpm Other Unix, Linux, Solaris, and Mac OS X
Windows
After installing Resin Professional, you need to install the license file. If you have a license file for Resin, save it in . You can also install the license from the command line with:unix> resinctl license-add mylicense.license Resin includes a high-performance HTTP server that outperforms NginX and Apache httpd. The easiest and fastest Resin configuration uses Resin as the web server as well as the application server. We highly recommend you start with this configuration although you are free to use other web servers like Apache or IIS with Resin. Resin Web Server has been tested to serve 100,000 requests per second, making it comparable in performance to top C-based web servers. See Wiki: Resin Web Server: Resin 4.0.x vs nginx 1.2 performance for a comparison of Resin's performance vs nginx, a fast C-based HTTP server. Keep in mind, Resin can be used for development or evaluation in addition to using it in production. If desired, you can easily apply for a development license to enable Resin Pro features. You can also simply use Resin Open Source to start development. The built-in HTTP server listens on port 8080 in the default configuration and can be changed to listen on the HTTP port 80 instead during deployment. unix> resinctl start c:\windows> resin start For troubleshooting your installation, you can also run Resin in "console" mode, which will let you see the logging messages in your console. unix> resinctl console For more details, see the Resin Web Server configuration page. To enable the /resin-admin browser-based administration, you'll need to create an admin user and password. You can either create the user in resin-admin itself, or if you are using the standard resin.xml and resin.properties you can generate the key from the command line resinctl Installation with resin.properties and generate-passwordYou can generate the user and password properties from the command-line. Resin's password must be hashed for security. unix> resinctl generate-password my-user my-password admin_user : my-user admin_password : {SSHA}HTfP60Ceq0K0IAvN31wQtBxtql9D+8Wo Add the admin_user and admin_password lines to the end of the /etc/resin/resin.properties file. You may also use those values to change your admin-users.xml file. You can update the resin.properties in one step on unix by using a pipe: unix# resinctl generate-password my-user my-password >> /etc/resin/resin.properties Installation with /resin-admin
On Linux, is typically generated in /etc/resin/.The steps are for security reasons. Copying the admin-users.xml verifies that you have access to the server. And the default resin_admin_external=false makes sure you're not exposing the /resin-admin to the internet. For more information, see the /resin-admin documentation. Once you've made sure Resin is working, you can start to run applications and add content. Local network command-line deploymentCommand-line deployment on a local network deploys a .war file to a running Resin server, using the .war file's name as the context-path. It looks like the following example. unix> resinctl deploy hello.war unix> resinctl undeploy hello.war The URL for the application would be: http://localhost:8080/hello. To deploy to the root context-path, use a file name ROOT.war or use the --name attribute. unix> resinctl deploy --name ROOT mywar.war unix> resinctl undeploy --name ROOT Remote network command-line deploymentDeploying to a remote network requires some more configuration for security reasons:
After the changes, resin.properties will look something like: ... admin_user : my-user admin_password : {SSHA}HTfP60Ceq0K0IAvN31wQtBxtql0D+8Wo admin_remote_enable : true When you deploy, you will need to give the user and password: unix> resinctl deploy --user my-user --password my-password hello.war webapps directory deploymentYou can deploy .war files by copying them
to the webapps directory like this: You can also deploy .wars in exploded form like: You can use a web.xml file to configure the 'hello' web application:
For more information on deployment, see the deployment documentation. Most production environments will run Resin as a background daemon. When running as a daemon, Resin detaches from the console and continues running until it is stopped. The following are the basic steps to running Resin as a daemon:
The .rpm and .deb files install Resin in /etc/init.d/resin, which will start Resin when the system boots. PDF reports about the Resin server can be generated with the command-line, the /resin-admin browser-based GUI, or as automatic health system tasks. From the command-line you can generate a pdf-report with the following: unix> resinctl pdf-report generated /var/resin/log/default-Watchdog-20111010T1426.pdf You can also generate a report for the most recent restart event saved by the watchdog. The watchdog report will give information about why Resin was last stopped. unix> resinctl pdf-report -watchdog generated /var/resin/log/default-Watchdog-20111010T1426.pdf Resin includes excellent support for Eclipse. In fact, using the Eclipse support may be the easiest way get started with Resin. Resin plugin support is included in Indigo (Eclipse 3.7) and above (you can install the Resin plugin manually for earlier Eclipse versions). The Resin plugin allows you to create new server instances, configure servers, start servers, stop servers, restart instances, deploy/undeploy applications, debug on the server and so on. You can even automatically download and install the latest version of Resin using the plugin or apply for a development license for Resin Pro. Further details on the Resin Eclipse plugin is available here. More installation and configuration are available at installation options.
|