我的Linux下JSP配置全過程

來源:互聯網
上載者:User

Java .0.4-bin.jar
標 題: 我的Linux下JSP配置全過程 BBS 水木清華站 (Mon Jun 3 13:04:03 2002)
僅供參考
RedHat Linux 7.2 JSP Server Install
Need Software: J2SDK 1.3.1_01 & Apache 1.3.22 & Tomcat 3.3 & MySQL 3.23.44 &
MM.MySQL 2.0.4
Software Download URL:
1. Java 2 Platform, Starndard Edition v1.3.1_01(J2SE):
j2sdk-1_3_1_01-linux-i386.bin
http://java.sun.com/j2se/1.3/download-linux.html
choose "SDK Downloads" - "GNUZIP Tar shell script"
2. Apache HTTP Server 1.3.22: apache_1.3.22.tar.gz
http://httpd.apache.org/dist/httpd/apache_1.3.22.tar.gz
3. Tomcat 3.3: jakarta-tomcat-3.3.tar.gz

http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/jakarta-tomc

at-3.3.tar.gz
4. MySQL 3.23.44: mysql-3.23.44.tar.gz

http://www.mysql.com/downloads/download.php?file=Downloads/MySQL-3.23/mysql-3
.23.44.tar.gz
choose your mirror site
5. MM.MySQL 2.0.4 JDBC API: mm.mysql-2.0.4-bin.jar

http://www.mysql.com/downloads/download.php?file=Downloads/Contrib/mm.mysql-2
.0.4-bin.jar
choose your mirror site
Copy:
j2sdk-1_3_1_01-linux-i386.bin,apache_1.3.22.tar.gz,jakarta-tomcat-3.3.tar.gz,
mysql-3.23.44.tar.gz
To: /usr/local/
Set Web Root Path: /web/root/
"//" is note
[root@alin root] # cd /usr/local/
[root@alin local] # chmod 755 j2sdk-1_3_1_01-linux-i386.bin
[root@alin local] # ./j2sdk-1_3_1_01-linux-i386.bin
[root@alin local] # ln -s jdk1.3.1_01 jdk
[root@alin local] # tar -zxvf apache_1.3.22.tar.gz
[root@alin local] # ln -s apache_1.3.22 apache
[root@alin local] # tar -zxvf jakarta-tomcat-3.3.tar.gz
[root@alin local] # ln -s jakarta-tomcat-3.3 tomcat
[root@alin local] # tar -zxvf mysql-3.23.44.tar.gz
[root@alin local] # ln -s mysql-3.23.44 mysql
[root@alin local] # mv mm.mysql-2.0.4-bin.jar /usr/local/tomcat/lib/
[root@alin local] # cd /etc/
[root@alin etc] # vi profile
...
PATH=$PATH:/usr/local/jdk/bin
CLASSPATH=/usr/local/jdk/lib
JAVA_HOME=/usr/local/jdk
TOMCAT_HOME=/usr/local/tomcat
TOMCAT_INSTALL=/usr/local/tomcat
...
export ... PATH CLASSPATH JAVA_HOME TOMCAT_HOME TOMCAT_INSTALL
...
[root@alin etc] # reboot
//Restart Computer
[root@alin root] # cd /usr/local/apache/
[root@alin apache] # ./configure --prefix=/usr/local/apache
--enable-module=so
[root@alin apache] # make
[root@alin apache] # make install
[root@alin apache] # cd /usr/local/tomcat/native/mod_jk/apache1.3/
[root@alin apache1.3] # ./build-unix.sh
[root@alin apache1.3] # ./install-unix.sh
// copy mod_jk.so to /usr/local/apache/libexec/
[root@alin apache1.3] # cd /usr/local/mysql/
[root@alin mysql] # groupadd mysql
[root@alin mysql] # useradd -g mysql mysql
[root@alin mysql] # ./configure --prefix=/usr/local/mysql
[root@alin mysql] # make
[root@alin mysql] # make install
[root@alin mysql] # ./scripts/mysql_install_db
[root@alin mysql] # chown -R root /usr/local/mysql/
[root@alin mysql] # chown -R root /usr/local/mysql/bin/
[root@alin mysql] # chgrp -R mysql /usr/local/mysql/
[root@alin mysql] # cd /usr/local/apache/conf/
[root@alin conf] # vi httpd.conf
...
// Modify: DocumentRoot "/usr/local/apache/htdocs"
DocumentRoot "/web/root"
...
// Modify:

...
// Add at last
Include /usr/local/tomcat/conf/mod_jk.conf
[root@alin conf] # cd /usr/local/tomcat/conf/
[root@alin conf] # vi apps-root.xml
// Create a new file:



docBase="/web/root"
reloadable="true"
trusted="true" >


[root@alin conf] # vi server.xml
...
// Modify:

...
[root@alin conf] # cd /usr/local/tomcat/bin
[root@alin bin] # vi tomcat.sh
...
// Modify: CLASSPATH=${TOMCAT_INSTALL}/lib/tomcat.jar
CLASSPATH=${TOMCAT_INSTALL}/lib/tomcat.jar:${TOMCAT_INSTALL}/lib/mm.mysql-2.0
.4-bin.jar
...
[root@alin bin] # ./tomcat.sh run -jkconf
[root@alin bin] # cp /usr/local/tomcat/conf/auto/mod_jk.conf
/usr/local/tomcat/conf/
[root@alin bin] # cd /usr/local/mysql/support-files
[root@alin support-files] # vi mysql.server
...
// Modify: datadir=/usr/local/mysql/data
datadir=/usr/local/mysql/var
...
// Modify: bindir=./bin
bindir=/usr/local/mysql/bin
...
// Modyfy: pid_file=$datadir/`@HOSTNAME@`.pid

pid_file=$datadir/`/bin/hostname`.pid
...
// Add after: "start")
echo "Starting MySQL: "
...
// Add after: "stop")
echo "Stopping MySQL: "
[root@alin support-files] # cd /etc/rc.d/init.d/
[root@alin init.d] # vi http
// Create a new file:
#!/bin/bash
. /etc/rc.d/init.d/functions
INITLOG_ARGS=""
JAVA_HOME=/usr/local/jdk
TOMCAT_HOME=/usr/local/tomcat
TOMCAT_INSTALL=/usr/local/tomcat
export JAVA_HOME TOMCAT_HOME TOMCAT_INSTALL
tomcatd=/usr/local/tomcat/bin/tomcat.sh
apached=/usr/local/apache/bin/apachectl
RV1=0
RV2=0
RETVAL=0
start() {
echo "Starting Tomcat & Apache Server: "
daemon $tomcatd start -noout
RV1=$?
sleep 4
daemon $apached start
RV2=$?
RETVAL=$[$RV1+$RV2]
return $RETVAL
}
stop() {
echo "Stopping Tomcat & Apache Server "
daemon $apached stop
RV1=$?
daemon $tomcatd stop
RV2=$?
RETVAL=$[$RV1+$RV2]
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $httpd
;;
restart)
stop
start
;;
*)
echo $"Usage: $prog {start|stop|restart}"
exit 1
esac
exit $RETVAL
[root@alin init.d] # cp /usr/local/mysql/support-files/mysql.server .
[root@alin init.d] # cd /etc/rc.d/rc3.d
[root@alin rc3.d] # ln -s ../init.d/http S85http
[root@alin rc3.d] # ln -s ../init.d/mysql.server S90mysql
[root@alin rc3.d] # ln -s ../init.d/mysql.server K10mysql
[root@alin rc3.d] # ln -s ../init.d/http K15http
[root@alin rc3.d] # cd /usr/rc.d/rc5.d
[root@alin rc5.d] # ln -s ../init.d/http S85http
[root@alin rc5.d] # ln -s ../init.d/mysql.server S90mysql
[root@alin rc5.d] # ln -s ../init.d/mysql.server K10mysql
[root@alin rc5.d] # ln -s ../init.d/http K15http
[root@alin rc5.d] # cd /usr/rc.d/rc6.d
[root@alin rc6.d] # ln -s ../init.d/mysql.server K10mysql
[root@alin rc6.d] # ln -s ../init.d/http K15http
[root@alin rc6.d] # reboot
// Restart Computer
[root@alin root] # cd /usr/local/mysql/bin/
[root@alin bin] # ./mysqladmin -u root -p password rootpassword
// set root"s password to "rootpassword"
[root@alin bin] # cd /root/bin/
[root@alin bin] # vi mysql
// Create a new file:
#!/bin/bash
/usr/local/mysql/bin/mysql $*
[root@alin bin] # cd /root/
[root@alin root] # vi .my.cnf
// Create a new file:
[client]
host=localhost
user=root
password=rootpassword
[root@alin root] # mysql
...
mysql> quit
Bye
[root@alin root] #
[client]
host=localhost
user=root
password=rootpassword
[root@alin root] # mysql
...
mysql> quit
Bye
[root@alin root] #
// That"s All OK!
-Written by Alin Chen
Email: alinzju@sohu.com

---------------------------愛從一個微笑開始,
在熱吻中得以延伸,
卻隨眼淚逝去...... JAVA天堂

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.