Debian4 architecture J2EE

Source: Internet
Author: User
Debian4 architecture J2EE-Linux Enterprise Application-Linux server application information. The following is a detailed description. I haven't played linux for a while. This time, the customer said that he prefers debian, so I have practiced it now. I have summarized some online materials and shared them with you.

I. System Installation
Install with CD1, ROOT Password dongjunbiao, new user webuser, password webuser

Ii. System Configuration
1. install ssh: apt-get install ssh
2. install rcconf: apt-get install rcconf
3. Install secureCRT on the PC for remote management and solve the garbled problem: in terminal simulation, select terminal linux, select ANSI color, and select fixedsys as the font in terminal appearance, character encoding selection UTF-8
4. Use Xmanager (PC) to remotely control the DEBIAN desktop GNOME: vi/etc/TPD. conf search for xdmcp, add Enable = true Port = 177, save and restart, and install Xmanager on the PC for Remote Management
5. Download rar from http://www.rarsoft.com/download.htm, wget http://www.rarsoft.com/rar/rarlinux-3.7.0.tar.gzafter decompression.
Cp rar_static/usr/bin/rar
6. install nmap: apt-get install nmap (nmap localhost)
7. install the gcc compiling environment apt-get install gcc g ++

Iii. Install Mysql
Groupadd mysql
Useradd-g mysql
Cd/usr/local
Download mysql installation package mysql-5.0.41-linux-i686-icc-glibc23.tar.gz

Tar xvfz mysql-5.0.41-linux-i686-icc-glibc23 tar.gz
Ln? S mysql-5.0.41-linux-i686-icc-glibc23 mysql
Cd mysql
Scripts/mysql_install_db -- user = mysql
Chown-R root.
Chown-R mysql data
Chgrp-R mysql.
./Bin/mysqld_safe -- user = mysql & start
./Bin/mysqladmin-u root password mysql
Cp./support-files/mysql. server/etc/init. d/mysql
Rcconf (select mysql and enable it to start automatically)
Cp support-files/my-large.cnf/etc/my. cnf
Vi/etc/my. cnf (add default-character-set = gb2312 to both the client and server)
Vi/etc/my. cnf comment skip-networking

4. Install JDK
1. Download jdk. bin to the/usr/java directory.
2. Chmod + x jdk. bin
3../jdk. bin

5. Install Apache2 and Tomcat
1, Apache2.2 installation: Download arp, arp-util, Apache2 source file httpd-2.2.4.tar.gz, with Root undo.

Install apr
# Cd srclib/apr
#./Configure -- prefix =/usr/local/apr
# Make
# Make install

Install apr-util
# Cd ../apr-util/
#./Configure -- prefix =/usr/local/apr-util \
-- With-apr =/usr/local/apr
# Make
# Make install

Install apache
#./Configure -- prefix =/usr/local/apache2.2 \
-- Enable-so \
-- Enable-rewrite = share \
-- Enable-proxy = share \
-- Enable-proxy-ajp = share \
-- Enable-dav = share \
-- With-apr =/usr/local/apr \
-- With-apr-util =/usr/local/apr-util
# Make
# Make install

Put/usr/local/apache2.2/bin/apachectl start in/etc/rc. local (automatic start)

2. install Tomcat: Download mysql-5.0.41-linux-i686-icc-glibc23.tar.gz,apache-tomcat-5.5.23-admin.tar. Decompress tomcat to/usr/local/as the Root user, add the admin and manager roles in the tomcat-user.xml file, add the admin user and password webadmin
3. Set the webuser to start Tomcat: Run chgrp In the Tomcat installation directory? R webuser., chmod-R g + rw., edit bin/catalina. sh and add export JAVA_HOEM =/usr/java/jdk1.5.0 _ 12.
4. Enable Tomcat to start automatically:
# Cd/usr/local/tomcat/bin
# Tar xvfz jsvc.tar.gz
# Cd jsvc-src
# Sh support/buildconf. sh
# Chmod 755 configure
#./Configure -- with-java =/usr/local/java (change to your JDK location)
# Make
Cp/usr/local/tomcat/bin/jsvc-src/native/Tomcat5.sh/etc/init. d/tomcat
# Chmod 755/etc/init. d/tomcat
# Vi/etc/init. d/tomcat (modify various paths and jsvc Directories)

5. Configure Apache2 and Tomcat:
After apache is installed successfully, you need to make a small modification to its two configuration files conf/httpd. conf and conf/extra/httpd-vhosts.conf.
Search for "Include conf/extra/httpd-vhosts.conf" in the conf/httpd. conf file and remove the previous. Then the "conf/extra/httpd-vhosts.conf" file is modified as follows:


ServerAdmin 127.0.0.1
ProxyPass/ajp: // localhost: 8009/retry = 3
ProxyPassReverse/ajp: // localhost: 8009/
ServerName localhost
ErrorLog logs/127.0.0.1-error_log
CustomLog logs/127.0.0.1-access_log common


Edit the httpd. conf file and add ServerName LocalHost: 80.

Vi. Import mysql database
1. Log On With a mysql user and download the mysql export file mnksxt. SQL to the mysql home directory.
2. Create two mysql superusers, grant all privileges on *. * TO 'ycjyxt '@ 'localhost' identified by 'ycjyxtpass' with grant option; grant all privileges on *. * TO 'ycjyxt '@' % 'identified by 'ycjyxtpass' with grant option;
3. Run bin/mysql-uycjyxt-pycjyxtpass
7. Deploy Web Applications
1. Use the webuser user to download the program package file to the main directory and run rar x mnksxt.rar.
2. Copy mnksxt/WEB-INF/lib/mysql-connector-java-3.1.12-bin.jar to/usr/local/apache-tomcat-5.5.23/common/lib/
3. Delete the webapp/ROOT directory
4. Create the ROOT. xml file in the conf/Catalina/localhost directory:


DocBase = "/home/webuser/mnksxt"
Privileged = "true">
Name = "jdbc/mysql"
Type = "javax. SQL. DataSource"
Password = "ycjyxtpass"
DriverClassName = "com. mysql. jdbc. Driver"
MaxIdle = "2"
MaxWait = "5000"
Username = "ycjyxt"
Url = "jdbc: mysql: // localhost: 3306/mnksxt? AutoReconnect = true"
MaxActive = "40"/>


8. Install Proftpd
Apt-get install proftpd, select standlone, and run rcconf to remove proftpd. Run/etc/init. d/proftpd start | stop nmap localhost to view the port.
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.