RedHatLinux network server architecture practice (5)
Source: Internet
Author: User
Article Title: RedHatLinux network server architecture practice (5 ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Export JAVA_HOME RESIN_HOME CLASS_HOME CLASSPATH PATH
# Save the file, log out, and enter again. Run the following command to check whether the system variables have taken effect:
Shell> env
Step 14 Resin Install
1 install Resin
Cd/home/src
CPS/home/src/resin-2.0.5.tar.gz/usr/local
Cd/usr/local
Tar xvzf resin *
Cd resin *
./Configure -- with-apache =/usr/local/apache // set the compilation Parameters
(Or:./configure -- with-apxs =/usr/local/apache/bin/apxs)
Make // compile
Make install // install
2. Create a symbolic connection
# Establish a symbolic connection of resin, and establish a jvm symbolic connection
Ln-s/usr/local/resin2.0.5/usr/local/resin
# Establish a symbolic connection for the resin service program, and establish an apache symbolic connection
Ln-s/usr/local/resin/bin/httpd. sh/usr/bin/resin
3. modify the configuration file
Vi/usr/local/resin/conf/resin. conf
Modify One: create a connection pool, similar to the DSN (Data Source) on NT)
<Resource-ref>
<Res-ref-name> jdbc/test </res-ref-name> // data source name
<Res-type> javax. SQL. DataSource </res-type> // Data Source type
<Init-param driver-name = "org. gjt. mm. mysql. Driver"/> // database driver
<Init-param url = "jdbc: mysql: // localhost/test"/> // connection string <init-param user = "your_user_name"/> // user Name
<Init-param password = "your_password"/> // password
<Init-param max-connections = "20"/> // maximum number of connections
<Init-param max-idle-time = "30"/> // Delay time
</Resource-ref>
# Examples of subsequent tests show how to call a data source
Modify Two: Modify the default home directory. If you use a virtual host, you can ignore this location.
<App-dir>/usr/local/apache/htdocs </app-dir>
Modify Three: modifies the Resin port and works with Apache.
<Http port = '000000'/> // Delete the row.
Modify Four: Add a VM that supports JSP
# Adding a JSP-supported virtual host requires the following four tasks: DNS, FTP, APACHE, and RESIN
1. Add a DNS alias (of course, the host name can also be used)
Vi/var/named/yesgo. loc
# Append the following line. Of course, you can customize other aliases or host names.
Www in cname ns. yesgo. loc.
/Etc/rc. d/init. d/named restart
// Restart the DNS Service
Nslookup // test whether the resolution is successful
2. Add an FTP account
Useradd www-s/dev/null-g ftpchroot // Add an account
Passwd www // change the password
Chmod 701/home/www // set the permission. Otherwise, the server will say that you do not have the permission to access the server in the future.
3. Add a VM to Apache
Vi/usr/local/apache/conf/httpd. conf
# Specify the IP address used to create a VM
NameVirtualHost 192.168.1.2
# Add virtual host
<VirtualHost www. yesgo. loc>
ServerAdmin webmaster@yesgo.loc // administrator email
DocumentRoot/home/www // root directory
ServerName www. yesgo. loc // Domain Name
ErrorLog logs/www. yesgo. loc-error_log // Error Log name
CustomLog logs/www. yesgo. loc-access_log common // custom log name
</VirtualHost>
4. Add a VM to Resin to support JSP
Vi/usr/local/resin/conf/resin. conf
# Search for <Host id = 'www. yesgo. loc '>
<App-dir>/home/www </app-dir> // specify the root directory of the site
<Classpath id = 'classe' source = 'classe' compile = 'true'/> // specify the class file directory
</Host>
Note 』:
According to the above settings, the directory where you place JavaBean is the classes directory under the root directory of the site. You cannot memorize/WEB-INFO/classes. The key is to understand the truth, you can set everything, such as Amao and Agou.
"Strongly recommended": Set the permission for the classes directory. Otherwise, the client can browse and download your components.
Chmod 701/home/www/classes // set the permission for the classes directory to avoid unauthorized access
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service