Set up Tomcat + Apache + MySQL server in Ubuntu

Source: Internet
Author: User
1. ubuntu8.04TLSServer version is installed by default (this version is supported by April 2013. installing ssh # sudoapt-getinstallssh3. install vsftpd # sudoapt-getinstallvsftp settings/etc/vsftpd. conf. Because FTP is not required for external access, it is only for Intranet access. The related settings are as follows. # reject anonymous users and comment them out # anonymous_en

1. The TLS Server version of Ubuntu 8.04 is installed by default (this version is supported by April 2013)

2. Install ssh
# Sudo apt-get install ssh

3. Install vsftpd
# Sudo apt-get install vsftp
Set/etc/vsftpd. conf. Because FTP is not required for external access, it is only for Intranet access. The related settings are as follows.
# Reject anonymous users and comment them out
# Anonymous_enable = YES
# Accept local users
Local_enable = YES
# Uploads
Write_enable = YES
# Allowed to upload Ascii files
Ascii_upload_enable = YES
Ascii_download_enable = YES
Start vsftpd
/Etc/init. d vsftpd start

4. Install JDK 5
Apt-get install sun-java5-jdk
The installation of the JAVA environment through apt is automatically set.

5. Install TOMCAT6.018
Download the package from the Tomcat official website and upload it through FTP.
Extract
Tar zxvf apache-tomcat-6.0.18.tar.gz
Copy to/usr/lib
# Sudo cp/home/kejun/upload/apache-tomcat-6.0.18/usr/lib/apache-tomcat-6.0.18

6. Install Apache2
Sudo apt-get install apache2
If you install apache through apt, the Directory of apache varies a lot. After installation, the configuration file is not changed.

7. Install JK (used to integrate Tomcat and Apache)
# Sudo apt-get install libapache2-mod-jk
Check whether jk. load exists in the startup module of apache2.
# Sudo ls/etc/apache2/mod-enabled/
Configure workers. properties
# Sudo vi/etc/libapache2-mod-jk/workers. properties
Change the following two items to your own directory.
Workers. Maid =/usr/lib/apache-tomcat-6.0.18
Workers. java_home =/usr/lib/jvm/java-1.5.0-sun
Next, configure apache2.conf.
# Sudo vi/usr/share/doc/libapache2-mod-jk/httpd_example_apache2.conf
Copy the content to apache2.conf.
Increase listening port 8081
# Sudo vi/etc/apache2/ports. conf
Add a row
Listen 8081.
Modify a VM
# Sudo vi/etc/apache2/sites-available/default
According to your settings, the following are my settings
NameVirtualHost *: 80
Namevirtualhost*: 8081

ServerAdmin webmaster @ localhost

DocumentRoot/var/www/

Options FollowSymLinks
AllowOverride None


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow, deny
Allow from all

ScriptAlias/cgi-bin // usr/lib/cgi-bin/

AllowOverride None
Options + ExecCGI-MultiViews + SymLinksIfOwnerMatch
Order allow, deny
Allow from all

ErrorLog/var/log/apache2/error. log
# Possible values include: debug, info, notice, warn, error, crit,
# Alert, emerg.
LogLevel warn

CustomLog/var/log/apache2/access. log combined
ServerSignature On

Alias/doc/"/usr/share/doc /"

Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny, allow
Deny from all
Allow from 127.0.0.0/255.0.0.0: 1/128


ServerAdmin webmaster @ localhost
DocumentRoot/usr/lib/apache-tomcat-6.0.18/webapps/idealshop
ErrorLog/var/log/apache2/idealerror. log
LogLevel warn
CustomLog/var/log/apache2/idealaccess. log combined

Options FollowSymLinks
AllowOverride None
Order allow, deny
Allow from all


Add the file jk2.properties to the conf file of tomcat.
The content is as follows:
Handler. list = channelSocket, request
ChannelSocket. port = 8009

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.