Full Process of Ubuntu 11.04 LAMP installation and configuration + Integration of JSP

Source: Internet
Author: User

First install LAMP, a command: sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server libapache2-mod-auth-mysql php5-mysql phpmyadmin

During this period, you are required to enter the root user password of the mysql database, and select the server type [apache] And phpMyAdmin.
 
Restart apache after installation. Command: sudo/etc/init. d/apache2 restart
 
You also need to link the installed phpmyadmin and run the command: ln-s/usr/share/phpmyadmin under/var/www /.
 
LAMP has been installed.
 
Here, I would like to recommend you a practical php class library, php-pear. I believe that you will be familiar with frameworks such as symfony. It is also a command: sudo apt-get install php-pear
 
The following describes how to install the jsp environment:
 
1. Install jdk. This can be installed from the software center, which is very convenient.
 
2. install tomcat, libapache2_mod_jk, and libmysql-java. These can be installed through the new architecture, which is also very convenient. (Maybe this is one of the reasons why Ubuntu is better than other linux distributions)
 
3. Let apache forward the jsp request to tomcat:
 
Create under/etc/apache2/and modify the workers. properties file:
 
Workers. properties file with the following content
 
Workers. tomcat_home = (your tomcat home directory)
 
Workers. apache_log = (set where to record logs)
 
Workers. java_home = (jdk directory)
 
Ps =/
 
Worker. list = worker1
 
(Copy the following parameters)
 
Worker. worker1.type = ajp13
 
Worker. worker1.host = localhost
 
Worker. worker1.port = 8009
 
Worker. worker1.lbfactor = 50
 
Worker. worker1.cachesize = 10
 
Worker. worker1.cache _ timeout = 600
 
Worker. worker1.socket _ keepalive = 1
 
Worker. worker1.socket _ timeout = 300
 
Add the following content at the end of the apache main configuration file
 
JkWorkersFile/etc/apache2/workers. properties (workers. properties directory)
 
# Where to put jk logs
 
JkLogFile/var/log/apache2/mod_jk.log (jk log)
 
# Having the permissions to write the runtime status log
 
JkShmFile/var/log/apache2/jk-runtime-status
 
# Set the jk log level [debug/error/info]
 
JkLogLevel info
 
# Select the log format
 
JkLogStampFormat "[% a % B % d % H: % M: % S % Y]" (log generation format)
 
# JkOptions indicate to send ssl key size,
 
JkOptions + ForwardKeySize + ForwardURICompat-ForwardDirectories
 
# JkRequestLogFormat set the request format
 
JkRequestLogFormat "% w % V % T"
 
# Send servlet and jsp requests to tomcat with ajp13 protocol
 
JkMount/*. jsp worker1 # indicates that all files suffixed with jsp are handed over to worker1.
 
Restart tomcat and apache.

Related Article

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.