FreeBSD integrated apache2 and resin3

xiaoxiao2021-03-06  97

Resin with Apache on UnixInstallationTo configure Resin with Apache, you must follow the following steps:. 1 Compiling Apache2 Compile mod_caucho.so3 Configure Apache4 Set up environment5 Configure resin.conf6 Restart Apache and start srunCompiling ApacheYou need a version of Apache..... with DSO support enabled. Apache has full documentation attheir website. To check if your apache has DSO support, you can check for mod_so.c in youryour httpdchecking apache httpd for mod_so.cunix> / usr / local / apache / bin / httpd -lCompiled -in modules:. ... mod_so.c ... Many distributions, eg Red Hat Linux, will have Apache preinstalled However, because thestandard distribution has files all over the place, some people prefer to recompile Apache fromscratch.Once you untar Apache , build it like: unix> ./configure --prefix = / usr / local / apache / - enable-module = sounix> makeunix> make installSolaris versions of Apache may need additional flags, otherwise you'll get some linking errorswhen trying To load resin. You ma y need to refer to the Apache documentation if you get linkingerrors Here's an example configuration on Solaris:. unix> ./configure --prefix = / usr / local / apache / - enable-rule = SHARED_CORE / - enable-rule = SHARED_CHAIN ​​/ - enable-module = so / Resin 3.0 Installation -.. p 14Copyright (c) 1998-2004 Caucho Technology All rights reserved- 14 --- enable-module = most / - enable-shared = maxCompiling mod_caucho.soTo Compile and install mod_caucho on unix, you'll nesed to run resin '

s configure and thenmake. This step will create mod_caucho.so and put it in the Apache module directory. Usually, mod_caucho.so will end up in /usr/local/apache/libexec/mod_caucho.so.If you know where your apxs executable is, you can use --with-apxs. apxs is a little Perl scriptthat the Apache configuration makes. It lets modules like Resin know how all the Apachedirectories are configured. It is generally in / usr / local / apache / bin / apxs or / usr / sbin / apxs. IT'SUSUALLY Easiest to use --with-apxs so you do't need to worry where all the apache directoriesare.unix> ./configure --with-apxs = / usr / local / apache / Bin / apxsunix> MakeEven if you don't know, the configure script can offten Find It: UNIX> ./configure --with-apxsunix> makeas an alternative to --with-apxs, if you've compiled apache yourself, or if you have a simpleconfiguration, you can generally just point to the Apache directory: unix> ./configure --with-apache = / usr / local / apacheunix> makeunix> make installThe previous --with- apxs or --with-apache should cover most configurations. For some unusualconfigurations, you can have finer control over each directory with the following arguments to./configure. In general, you should use --with-apache or --with-apxs , but the other variables arethere if you know what you're doing .-- with-apache = dir The Apache root directory .-- with-apxs = apxs Pointer to the Apache extension script - with-apache-include = dir The Apache include Directory - with-apache-libexec = dir the apache module Directory - with-apache-conf =

httpd.conf The Apache config fileConfigure the EnvironmentResin 3.0 Installation -.. p 15Copyright (c) 1998-2004 Caucho Technology All rights reserved- 15 -If you do not already have Java installed, you'll need to download a JDK and set someenvironment variables.Here's a typical environment that you might put in ~ / .profile or / etc / profile # Java LocationJAVA_HOME = / /jdk1.4export JAVA_HOME # Resin location (optional). Usually Resin can figure this out.RESIN_HOME = //resin-3.0.2export RESIN_HOME # If you're using additional class libraries, you'll need to put them # in the classpath.CLASSPATH = Configuring resin.confThe default resin.conf, looks in resin-3.0. x / doc for JSP files andresin-3.0.x / doc / WEB-INF / classes for servlets and beans. to tell Resin to use Apache'sdocument area, you configure the document-directory. Change document-directory from 'doc' tosomething Like '/usr/local/apache/htdocs'.resin.conf / USR / local / apache / htdocs ... Starting the servlet enginenow you need to start the servlet Engine. Starting Resin is The Same With apache or standalone.see the httpd page for a details description.unix>

Rights reserved.starting resin on mon, 04 AUG 2003 09:43:39 -0700 (PDT) [09: 43: 40.664] HTTP Listening to *: 8080 [09: 43: 40.664] ServletServer [] StartingResin 3.0 Installation - p. 16copyright (c) 1998-2004 Caucho Technolog. All Rights Reserved- 16- [09: 43: 40.879] HMUX Listening to *: 6802 [09: 43: 41.073] Host [] Starting [09: 43: 41.446] Application [http:// localhost: 8080 / rate - doc] Starting [http: // localhost: 8080] StartingResin Will Print Every Port It's Listening To. in The Above Example, Resin Is Listening To Port 8080using HTTP and 6802 using its servlet runner protocol. In other words, mod_caucho canconnect to Resin with 6802 only on same host, but you can browse port 8080 from any host.The following snippet shows the and configuration for the Above Example. ... Testing the servlet enginecreate a test file '/usr/local/apache/htdocs/test.jsp'2 2 = <% = 2 2%> browse http : //localhost/test.jsp Again. You Should Now Get2 2 =

4Configuring Apache by handMaking mod_caucho will automatically change your httpd.conf file. You can also configureApache directly, instead of letting mod_caucho read the configuration from the resin.conf file. Ifyou use this method, you need to make sure you match the Apache configuration with the Resinconfiguration.httpd.confLoadModule caucho_module libexec / mod_caucho.soResin 3.0 Installation -. p 17Copyright (c) 1998-2004 Caucho Technology All rights reserved- 17 -. ResinConfigServer localhost 6802 SetHandler caucho-status Note:.. The caucho-status is optional and probably should be avoided in a production site It letsyou ask the Caucho Apache module about the Caucho status, valuable for debugging.Restart Apache Now browse http:. // localhost / caucho-status It should return a table indicatingthat the servlet runner is stopped.Browse http: //localhost/test.jsp It should return a message like:. Can not connect to Servlet Run ner.You can also dispatch to Resin directly from the httpd.conf. The apache handler name is "caucho-request" .Apache Handler Meaningcaucho-status Handler to display / caucho-statuscaucho-request Dispatch a request to ResinRequests dispatched directly from the Apache httpd.conf will not appear in / caucho-status youcan use caucho-request as follows:. SetHandler caucho-request Apache Command MeaningResinConfigServer host port Specifies the Resin JVM at host: port as aconfiguration Server.cauchostatus True / False Enables / Disables The / Caucho-StatusManagementVirtual Hoststhe Virtual Host Topic Describes Virtual Hosts in detil. if you '

re using a single JVM, you onlyneed to configure the resin.conf If you want a different JVM for each virtual host, yourhttpd.conf can load a different resin.conf for each JVM: httpd.confResin 3.0 Installation - p 18Copyright (.. . c) 1998-2004 Caucho Technology All rights reserved- 18 - ServerName foo.comServerAlias ​​www.foo.comResinConfigServer 192.168.0.1 6802 ServerName bar.comServerAlias ​​www.bar .ComResinconfigserver 192.168.0.2 6802 The foo.conf might Look Something Like: foo.conf ... dispatchMod_caucho queries configuration server to distinguish the URLs going to Resin from theURLs handled by Apache. The configuration server uses the directives todecide which URLs to send. Also, any * .war file automatically gets all its URLs. Other URLs sta ywith Apache. There's a more complete discussion of the URL dispatching in the plugin-dispatchpage.Load BalancingIn Resin 3.0, you can distribute requests to multiple machines. All requests in a session will goto the same host. In addition, if one host goes down ., Resin will send the request to the nextavailable machine.In addition, you can specify backup machines The backup only will serve requests if allprimaries are down.See the http config section for more details.resin.conf 转载请注明原文地址:https://www.9cbs.com/read-105667.html


New Post(0)