Resin configuration: <web-app id= ' examples/tags ' >
<directory-servlet id= ' false '/>//<directory-servlet id= ' false '/> configuration makes resin prohibit directory browsing
</web-app>
Configuring resin virtual Hosts in Windows
Resin Server to configure access to SSL, there are several ways
[1]:
1. Use OpenSSL under UNIX. (http://www.openssl.org/)
2. Use Sun's Jsse. (Http://java.sun.com/products/jsse)
3...
Here we introduce the second method, which is implemented under Windows 2000.
preparatory work :
1. Windows Server.
2. J2sdk 1.4.x. (already included in the Jsse)
3. Resin 2.1.x.
4. Keytool usage in Jsse [2].
Steps :
1. Create a server certificate
A The following is how to use Sun's keytool to generate a server certificate. Look at the picture below:
Generally, the KeyStore password and the MyKey master password should be set to the same.
At this point, the certificate file has been saved in this example C:/resin-2.1.11/keys/server.keystore
2. Configure Resin (resin.conf)
The resin SSL configuration needs to be extended to
<caucho.com> <security-provider id= ' Com.sun.net.ssl.internal.ssl.Provider '/> <!--declare a new HTTP server on port 443 (standard port for HTTPS), -With SSL enabled--> <app-dir>doc</app-dir> <!--the HTTP port--> <!--the Srun port, read by both JVM and plugin--> <srun host= ' localhost ' port= ' 6802 '/> <ssl>true</ssl> <key-store-file>keys/server.keystore</key-store-file> <key-store-password>YourPasswordHere</key-store-password> |
Test :
Using the above configuration, start the resin service, we can access https://localhost.
One of the quickest ways to test this is to create a new JSP file that reads as follows and access him:
Secure? <%= request.issecure ()%> |
Run/bin/httpd.exe, the result is as follows:
To access https://localhost/, jump out of a security alert and choose Yes.
(If you don't want to jump out of this security alert, there are a few things to do: 1 Install the certificate to IE in the client; the CN (that is, first and last name) of the 2 certificate generation must use the server's machine name, or DNS name. )
Browser browsing https://localhost/, the effect is as follows:
Browse https://localhost/isSecure.jsp Test Files
This means that we configured resin to use SSL successfully.
Configuring Resin Virtual hosts in Windows < host ID = "Test.domain.com" >
< Web-app id = '/' >
< App-dir > d:/resin/webapps/test </app-dir >//Specify the path of the Web program
< classpath id = ' web-inf/classes '
Source = ' web-inf/classes '
compile = ' true '/>
<session-config >
< Session-max > 4096 </session-max >
< session-timeout > </session-timeout >
< Enable-cookies > True </enable-cookies >
< enable-url-rewriting > True </enable-url-rewriting >
</session-config >
< Multipart-form Upload-max = '-1 '/>