1. Configure Apache # vi/usr/local/Apache/CONF/httpd. conf
Search: remove the preceding comments from namevirtualhost. To:
Add a virtual host configuration after namevirtualhost *: 80:
<Virtualhost *: 80>
Serveradmin webmaster@nanu.8866.org
DocumentRoot/WWW
Servername nanu.8866.org
</Virtualhost>
At the end of the file, change it:
# Mod_caucho resin Configuration
# Loadmodule caucho_module/usr/local/Apache/modules/mod_caucho.so
Resinconfigserver localhost 6802.
Cauchostatus Yes
<Ifmodule mod_caucho.c>
<Location/Caucho-status>
Sethandler Caucho-status
</Location>
</Ifmodule>
Addhandler Caucho-request JSP
<Location/servlet/*>
Sethandler Caucho-Request
</Location>
2. Configure the resin (virtual host)
# Cd/usr/local/resin # ln-S./httpd. PID./resin. PID // create a soft link to the PID file required for resin operation.
# Cp./contrib/init. Resin/etc/rc. d/init. d/resin // copy the sysv script of resin.
# Chkconfig -- add resin // Add the resin to the sysv service and start automatically upon startup.
# Cp./CONF/resin. conf./CONF/resin. conf. Bak //. Back up the configuration file first.
# Vi./CONF/resin. conf: // configure the default host and match any host name.
<Host ID = "" Root-directory = ". "> // host ID =" "because no host name is specified, it can match any host name. This setting is only applicable to a single host, if you want to create a virtual host, you must specify the host ID = "yourdomain". Otherwise, any virtual host configured later will automatically match the host, and the virtual host will become invalid.
<Web-app id = "/" document-directory = "webapps/root"/> // replace webapps/root with your actual site root directory.
</Host>
# Service resin start
# Service httpd restart
# More/usr/local/resin/log/stdout. Log // check whether the startup or shutdown logs of resin are correct.
# More/usr/local/resin/log/stderr. Log // check the error message log of resin.
# More/usr/local/resin/log/JVM. Log // check JVM logs.
Test open browser, enter http://nanu.8866.org/caucho-status if the page showing the current running status of resin is normal.