The people who contact the JSP server basically started from the installation of JSP, because JSP does not have any installation process like ASP, and there is an automatic installation package like PHP, the installation of JSP is troublesome, and there are many manual steps. Next we will explain step by step how to configure a JSP server in the Linux environment.
1. Install JDK
CD to your JDK Installation File directory
CP./j2sdk-1_4_0-linux.bin/usr/local
CD/usr/local
Chmod A + x j2sdk-1_4_0-linux.bin
/J2sdk-1_4_0-linux.bin
Follow the Installation Wizard. The JDK directory after installation is/usr/local/jdk1.4.
Ii. install Apache
If you have installed Apache on the operating system, uninstall it. By using the RPM manager to uninstall Apache and Its Related suites, only the source code-level compilation and installation of the operating system is the most thorough system installation, and you can truly control it.
CD to the Apache source file directory you downloaded
Tar xvzf Apache *
./Configure -- prefix =/usr/local/Apache -- enable-module = so
Make; make install
3. install Resin
CD to the Apache source file directory you downloaded
Tar xvzf resin */usr/local
CD/usr/local/resin *
Configure -- With-Apache =/usr/local/Apache
Make; make install
4. Set Profile
VI/etc/profile // You can also open it in another text editor and add the following variables
Java_home =/usr/local/jdk1.4
Resin_home =/usr/local/resin-2.0
Classpath = $ java_home/lib: $ java_home/JRE/lib // if you have other system-level class libraries or drivers, continue writing down and separate them with colons
Path = $ path: $ java_home/bin: $ java_home/JRE/bin
Export java_home resin_home classpath path
After the modification, save the file and log out, log on again, open the command console, and enter env. If you see the environment variable in the returned output, it is successful.
5. Configure DNS
VI/etc/named. conf
Add the following statement:
Zone yesgo.com {
Type master;
File "yesgo.com ";
}
Zone 1.168.192.in-ADDR. Arpa {
Type master;
File "192.168.1 ";
}
Create these two configuration files:
Touch/var/named/yesgo.com create the NS or cname record of WWW
Touch/var/named/192.168.1 create a Domain Name Pointer
After the configuration is complete, run the following command:
NDC restat
NSLookup
When NSLookup is run, an interactive command line is displayed. If www.yesgo.com is entered and its IP address is returned normally, the domain name is successfully resolved.
6. Configure Apache
Create site root directory
Mkdir/WWW
Mkdir/www/www.yesgo.com
VI/usr/local/Apache/CONF/httpd. conf
Add the following statement to create a VM. You can change your domain name and IP address.
Namevirtualhost 192.168.1.1 // machine IP Address
Virtualhost www.yesgo.com
Serveradmin webmaster@yesgo.com
DocumentRoot/www/www.yesgo.com
Servername www.yesgo.com
Errorlog logs/www.yesgo.com-error_log
Customlog logs/www.yesgo.com-access_log common
/Virtualhost
Create these two configuration files:
Touch/var/named/yesgo.com create the NS or cname record of WWW
Touch/var/named/192.168.1 create a Domain Name Pointer
After the configuration is complete, run the following command:
NDC restat
NSLookup
When NSLookup is run, an interactive command line is displayed. If www.yesgo.com is entered and its IP address is returned normally, the domain name is successfully resolved.
6. Configure Apache
Create site root directory
Mkdir/WWW
Mkdir/www/www.yesgo.com
VI/usr/local/Apache/CONF/httpd. conf
Add the following statement to create a VM. You can change your domain name and IP address.
Namevirtualhost 192.168.1.1 // machine IP Address
Virtualhost www.yesgo.com
Serveradmin webmaster@yesgo.com
DocumentRoot/www/www.yesgo.com
Servername www.yesgo.com
Errorlog logs/www.yesgo.com-error_log
Customlog logs/www.yesgo.com-access_log common
/Virtualhost
9. Create an FTP account
So far, all JDK, DNS, Apache, and resin configurations have been completed, and now the ftp
Useradd yesgo // account name
Passwd yesgo // enter the password, which must be case sensitive and cannot be less than six characters long.
Run the above command to create the/home/yesgo directory, delete it, and then run the following command
Ln-S/www/www.yesgo.com/home/yesgo
Note: Change the folder attribute of/www/www.yesgo.com, set owner to yesgo user, group to yesgo group, and grant User Read and Write Permission, other has read permission, if you do not do so, if you log on to FTP, you are not authorized to access the website.
If you want to add yesgo users to the FTP Guest Group From the security perspective, it will enable the yesgo users to use/www/www.yesgo.com as their root directory to prevent operations on other directories. Now, you can log on to your FTP site using FTP tools on the client and upload your site files.
10. Test Site
In the network configuration of the client, add the DNS server as your server IP address so that the domain name you set above can be accessed.
If you cannot use the network configuration or conflict with the online DNS server, go to the C:/Windows or C:/WINNT directory to find the hosts file and append the following line: 192.168.1.1 www.yesgo.com. The front is the IP address of your server, the back is your domain name, separated by tab in the middle. Use ultradev and other tools to create a local site, remotely set it to the FTP set above, and then create test. JSP file with only one sentence: 1 + 1 = <% = 1 + 1>.
Upload the file to the server, that is, upload it to the/www/www.yesgo.com directory, and browse http://www.yesgo.com/test.jspin the client browser. If you return 1+12,2, the test is successful.