Set up a JSP environment on Ubuntu Server 10.04

Source: Internet
Author: User

1. install java
Sudo apt-get install sun-java6-jdk sun-java6-fonts sun-java6-plugin
Jre may be installed first.
Sudo update-java-alternatives-s java-6-sun

2. Environment Variables
Sudo vim/etc/environment
Add JAVA_HOME =/usr/lib/jvm/java-6-openjdk/


Change PATH to the following
PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/lib/jvm/java-6-openjdk/bin /"


3. install apache
Sudo apt-get install apache2
Then sudo/etc/init. d/apache2 start/stop/restart can be started.
Start the browser and check the result by entering 127.0.0.1 in the address bar.
The/etc/init. d/apache2 and/usr/sbin/apachectl functions the same, but they are automatically executed in/etc/init. d.
Any settings to be modified are added to/etc/apache2/httpd. conf.

4. install tomcat
Sudo apt-get install tomcat6 tomcat6-common tomcat6-docs tomcat6-examples libtomcat6-java
Similarly, start/etc/init. d/tomcat6 start/stop/restart

5. Security of mod_jk
In this way, apache and tomcat should be able to run normally, but they do not know each other. www.linuxidc.com needs mod_jk to connect them together.
Sudo apt-get install libapache2-mod-jk
/Usr/lib/apache2/modules/mod_jk.so is the module responsible for apache to submit the request to tomcat for processing.

Then copy/usr/share/doc/libapache2-mod-jk/httpd_example_apache2.con content directly to/etc/apache2/httpd. conf,

6. Verification
Sudo gedit/etc/apache2/httpd. conf
# Gedit. You can paste it directly to the end.
Alias/examples "/usr/share/tomcat6-examples/examples"
<Directory "/usr/share/tomcat6-examples/examples">
Options Indexes FollowSymLinks
AllowOverride None
Order allow, deny
Allow from all
</Directory>
#/Tomcat6-examples/examples from sudo apt-get install tomcat6 tomcat6-examples
Restart apache2 and enter http: // localhost/examples in the browser to check whether the request is successful.
 

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.