opensuse following jdk, apache, tomcat, mysql, jsp layout and testing

A project the company needs to build a virtual machine and apache web cluster platform, out for a week, finally tomcat and apache, mysql integration is complete, refer to the experience of online friends, in the light of their own installation process, write down, in particular, problems and a solution for everyone to share, hope to go the other of a friend some detours also to contribute to Zi Ji Zuo notes, all software was Muqianzuixin version, are downloaded from the official site (recommended) .
1. Install jdk, I suggest, are not familiar with linux friends, do not directly ysat or yum and other tools to download, it will not find the file where, if they are more familiar with the words on linux can be.
sun official website to download jdk-6u20-linux-x64.bin
# Chmod u + x jdk-6u20-linux-x64.bin
# ./jdk-6u20-linux-x64.bin
ln-s / usr/local/jdk1.6.0_20 / usr / local / jdk
ln-s / usr/local/jdk1.6.0_20 / jre / usr / local / jre
# Vi / etc / profile
Add the following lines
export JAVA_HOME = / usr/local/jdk1.6.0_20
export CLASSPATH =.: $ JAVA_HOME / lib / dt.jar: $ JAVA_HOME / lib / tools.jar
export PATH = $ PATH: $ JAVA_HOME / bin
export CATALINA_HOME = / usr / local / tomcat
Save exit.
# Source / etc / profile
jdk java-version see whether the installation was successful
2. Install apache, apache is an excellent tool for dealing with static pages, tomcat can build a powerful set of web server processing power.
Download httpd-2.2.15.tar.gz
# Cp httpd-2.2.15.tar.gz / usr / local
# Cd / usr / local
# Tar zxvf httpd-2.2.15.tar.gz
# Cd httpd-2.2.15
#. / Configure-prefix = / usr / local / apache - enable-module = so
# Make
# Make install
Start Apache, and test.
# Cd / usr / local / apache / bin
#. / Apachectl start
Open the browser and in the address bar http://localhost, you can see "it works" page, indicating apache installed successfully.
3. Install tomcat, tomcat is apache handle dynamic pages out of a tool, you can debug jsp, php and so on.
Download apache-tomcat-6.0.26.tar.gz
# Tar zxvf apache-tomcat-6.0.14.tar.gz
# Cp-r apache-tomcat-6.0.14 / usr / local / tomcat
# / Usr / local / tomcat / bin / startup.sh
Open http://localhost:8080, saw a cat, you can verify the tomcat start
4. The whole, and apache and tomcat
Download tomcat-connectors-1.2.28-src.tar.gz
# Tar zxvf tomcat-connectors-1.2.28-src.tar.gz
Compile configuration. All of the following folders, if not, need to create.
# Cd tomcat-connectors-1.2.28-src/native
#. / Buildconf.sh
#. / Configure - with-apxs = / usr / local / apache / bin / apxs - with-tomcat = / usr / local / tomcat - with-java-home = / usr / java / jdk - with- jni
# Make
# Make install
# Cd / usr / local / apache / modules /
Found mod_jk.so generate success.

Edit apache configuration file:
# Vi / usr / local / apache / conf / httpd.conf

Add the following lines at the end
LoadModule jk_module modules / mod_jk.so
JkWorkersFile / usr / local / apache / conf / workers.properties
JkLogFile / usr / local / apache / logs / mod_jk.log
JkLogLevel info
JkLogStampFormat "[% a% b% d% H:% M:% S% Y]"
JkRequestLogFormat "% w% V% T"
JkMount / servlet / * worker1
JkMount / *. jsp worker1

Create a file workers.proferties
# Vi / usr / local / apache / conf / workers.porperties
Add the following:
workers.tomcat_home = / usr / local / tomcat
workers.java_home = / usr/local/jdk1.6.0_20
ps = /
worker.list = worker1
worker.worker1.port = 8009
worker.worker1.host = localhost
worker.worker1.type = ajp13
worker.worker1.connection_pool_timeout = 600
worker.worker1.socket_keepalive = 1
worker.worker1.lbfactor = 1
worker.inprocess.stdout = $ (workers.tomcat_home) $ (ps) logs $ (ps) inprocess.stdout
worker.inprocess.stderr = $ (workers.tomcat_home) $ (ps) logs $ (ps) inprocess.stderr
Finally restart tomcat and apache, the installation is completed we
# / Usr / local / tomcat / bin / shutdown.sh / / close the tomcat
# / Usr / local / tomcat / bin / startup.sh / / start tomcat
# / Usr / local / apache / bin / apachectl restart / / restart apache
This point, if everything is not wrong, this time apache jsp pages do not have the processing capacity, can only deal with some html page, if you want to deal with dynamic pages, requires the following configuration:
Configure server.xml, the file / usr / local / tomcat / webapps / conf folder below, modify the following places:
Host section in the back to add:
<Context Path="" docBase="/usr/local/apache/htdocs" debug="0" reloadable="true" crossContext="true">
Open the tomcat and apache, input http://localhost:8080/index.jsp, you can see the tomcat and apache are connected up.
5. Install mysql
Would have to download the installation package to install, but later found not installed, Guer directly opensuse the yast tool, download the latest version of mysql, will also be dependent packages and libraries down under.
Mysql installation key documents such as:
/ Etc / init.d / mysql ------ start script
/ Etc / logrotate.d / mysql
/ Etc/sysconfig/susefirewall2
/ Var / lib / mysql / ------ start mysql parameters
/ Etc / my.cnf ------ set the parameters, on the port
/ Usr / localmysql
If you want to delete the downloaded mysql, need to delete all the above three behind a clean, otherwise the installation of mysql will not start. Another is to delete the above data, the start mysql after Tishi Cuowuqueshao "mysql.sock" (the file in the / var / lib / mysql / below), in which case, can restart the machine, mysql server will be in After starting the machine generate the document. Start the mysql service, a database group_data, and then build the form in which the test, the following statement:
create table test / / build table test
(
id int (3) auto_increment not null primary key,
name char (10) not null,
address varchar (50) default 'dongguan',
year date
); / / Build the table end
/ / The following Insert Field
insert into test values ('1 ',' gdeii ',' dongguan ', '2010-06-04');
6. Connect mysql, tomca do download jsp test connector mysql-connector-java-5.1.12.tar.gz
# Tar-zxvf mysql-connector-java-5.1.12.tar.gz
# Cp mysql-connector-java-5.1.12-bin.jar / usr / local / tomcat / lib
, Prepared by the jsp test page mysql.jsp
I used the test page is as follows:
<% @ Page contentType = "text / html; charset = gb2312"%>
<% @ Page import = "java.sql .*"%>
<html>
<body>
<%
String sql = "select * from test;";
String url = "jdbc: mysql: / / localhost: 3306/group_data";
String user = "root";
String password = "";
try
(
Class.forName ("com.mysql.jdbc.Driver"). NewInstance ();
)
catch (ClassNotFoundException e)
(
out.println ("driver not found");
)
Connection conn = DriverManager.getConnection (url, user, password);
Statement stm = conn.createStatement ();
ResultSet rs = stm.executeQuery (sql);
if (rs.next ())
(
out.println (rs.getString (1 )+"");
out.println ("|");
out.println (rs.getString (2));
)
else
(
out.println ("fail");
)
rs.close ();
stm.close ();
conn.close ();
%>
</ Body>
</ Html>
Restart tomcat, mysql, in your browser and enter http://localhost:8080/mysql
Page appears
1 | gdeii
Note the database connect successful.
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of opensuse following jdk, apache, tomcat, mysql, jsp layout and testing

  • Answer: After 2.2 upgrade mysql question-driven

    windows installed after the mysql gem error, error is approximately: ArgumentError (NULL pointer given): (eval): 3: in `each_hash ' (eval): 3: in `all_hashes' This is feeling under the windows of the question if the mysql gem version libmysql ...

  • Struts2 Spring Hibernate integration of easy

    1. Add Spring 2.0 in Libraries Choose the following four jar, and configure the / WEB-INF/lib under Spring2.0 AOP Libraries Spring2.0 Core Libraries Spring2.0 Persistence Core Libraries Spring2.0 WEb Libraries At the same time, the applicationContext ...

  • js page Jump implementation of a number of ways

    The first is: <script language="javascript" type="text/javascript"> window.location.href = "login.jsp? backurl =" + window.location.href; </ script> The second: <script language="javascript"> alert

  • hibernate (jpa) composite primary key annotation statement Ways

    In the design of the database tables are designed with a composite primary key of the table, that table's record by more than one field joint identification, such as: Table CREATE TABLE TB_HOUR_DATA ( STAT_DATE DATE NOT NULL, PATH_ID NUMBER(20) NOT NULL,

  • EJB ant script to deploy template works

    <? xml version = "1.0" encoding = "UTF-8"?> <! - Name Project name basedir build.xml file directory -> <project name="HelloWorld" basedir="."> <! - Property variables -> <! - The sour ...

  • Struts2 Spring Hibernate's easy to integrate

    1. Add Spring 2.0 in Libraries Choose the following four jar, and configure the / WEB-INF/lib under Spring2.0 AOP Libraries Spring2.0 Core Libraries Spring2.0 Persistence Core Libraries Spring2.0 WEb Libraries At the same time, the applicationContext ...

  • RoR explained

    ROR is Ruby on Rails. Ruby is a well-known has been very good dynamic language It's dynamic language. Simple and easy. Dynamic languages are interpreted, but the performance may make a discount, but not absolute, because the application is complex, th

  • FLEX: integrating Spring + Hibernate

    Before a friend also wanted to study development of FLEX. Asked me to help him to be a small sample. Spent a weekend time, to integrate a sampleproject. Client: FLEX Server: Spring2.5 + Hibernate3.2 + Hibernate-annotations3.3.1 + MySQL5 FDS: BlazeDS3 IDE:

  • Some interview questions java

    The first is the company give you a chance to meet, it is necessary to know to meet from time to equal the interview, and have a lot of companies to see you at the first time will give you a ready point of doing something trivial, these questions, althoug

  • Oracle instant clent for ruby / rails on cygwin

    Environment: XP: oracle full client, ruby, rails, gem cygwin: ruby rails, gem (the version with the XP version) Needs: for cygwin is installed under the rails platform support oci Steps: <1> download oracle instant client (10.2.0.3 Instant Client Pa

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries