在linux下配置apache 2.0.48+tomcat4.1.29+jdk 1.4.2

Java EE 同时被 2 个专栏收录
14 篇文章 0 订阅
7 篇文章 0 订阅
一.安装前准备。

1. 所有组件都安装到/usr/local/e789目录下

2. 解压缩命令:tar —vxzf 文件名(.tar 或 .tar.gz)

3. 复制命令:cp 文件名 或cp —Rf 文件夹名

4. 删除命令:rm 文件名 或 rm —Rf 文件夹名

5. 编辑文件命令:vi 文件名 :q!不保存退出 :wq 保存退出

二.安装jdk 1.4.2

1. 执行二进制文件 ./j2sdk-1_4_2-linux-i586.bin 解压生成j2sdk1.4.2文件夹

2. 将文件夹改名为jdk142

3. 配置文件(设置环境变量):/etc/profile

JAVA_HOME=/usr/local/e789/jdk142

export JAVA_HOME

TOMCAT_HOME=/usr/local/e789/tomcat4129

export TOMCAT_HOME

CATALINA_HOME=/usr/local/e789/tomcat4129

export CATALINA_HOME

CATALINA_BASE=/usr/local/e789/tomcat4129

export CATALINA_BASE

APACHE_HOME=/usr/local/e789/apache2048

export APACHE_HOME

HTTPD_HOME=/usr/local/e789/apache2048

export HTTPD_HOME

CLASSPATH=/usr/local/e789/jdk142/lib:/usr/local/e789/jdk142/jre/lib

export CLASSPATH

PATH=$PAHT:/usr/local/e789/jdk142/bin:/usr/local/e789/jdk142/jre/bin

三.安装tomcat 4.1.29

1. 解压缩文件jakarta-tomcat-4.1.29.tar.gz

2. 将解压后的文件夹改名为tomcat4129

3. 启动(停止)命令:./bin/startup.sh (shutdown.sh)

4. 测试tomcat:在ie里输入http://(ip):8080,如果有内容出现,则说明安装成功

四.安装配置apache 2.0.48

1. 解压缩文件httpd-2.0.48.tar.gz

2. 安装:①./configure --with-layout=Apache

--prefix=/usr/local/e789/apache2048

--enable-module=so

--enable-mods-shared=most

--with-mpm=prefork



②make

③make install

3. 配置文件:/usr/local/e789/apache2048/conf/httpd.conf

DocumentRoot "/usr/local/e789/tomcat4129/webapps"(将发布的目录指向tomcat的webapps目录)



4. 启动文件:./bin/httpd -k start (restart/stop)

5. 测试apache:在ie里输入http://(ip),如果有内容出现,则说明安装成功

五.安装jk2

1. 解压缩文件jakarta-tomcat-connectors-jk2-src-current.tar.gz

2. 将解压后的文件夹改名为jk202

3. 执行buildconf.sh文件。

4. 执行configure文件:

①./jk/native2/configure --with-apxs2=/usr/local/e789/apache2048/bin/apxs --enable-EAPI

--with-tomcat41=/usr/local/e789/tomcat4129

②make

③make install(我做的时候,这个命令不好用)

六.整和apache和tomcat

1. 把jkjni.so和mod_jk2.so文件复制到apache的modules目录下

cp /usr/local/e789/jk202/jk/build/jk2/apache2/*.so /usr/local/e789/apache2048/modules

2. 把jk2.properties文件复制到tomcat的conf目录下

cp /usr/local/e789/jk202/jk/conf/jk2.properties /usr/local/e789/tomcat4129/conf

3. 把worker2.properties文件复制到apache的conf目录下

cp /usr/local/e789/jk202/jk/conf/worker2.properties /usr/local/e789/apache2048/conf

4. 编辑jk2.properties文件

vi /usr/local/tomcat/conf/jk2.properties

# list of needed handlers.

handler.list=channelSocket,request

# Override the default port for the channelSocket

channelSocket.port=8009

5. 编辑apache的http.conf

vi /usr/local/apache/conf/http.conf

LoadModule jk2_module modules/mod_jk2.so

DirectoryIndex index.html index.html.var index.jsp

6. 编辑apache/conf/workers2.properties文件

# only at beginnin. In production uncomment it out
[logger.apache2]
level=DEBUG

[shm]
file=/usr/local/apache/logs/jk2.shm
size=1048576

# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

# Uri mapping
[uri:*.jsp]
worker=ajp13:localhost:8009
(负责把*.jsp的文件通过ajp13发送到tomcat处理)

7.编辑tomcat的server.xml










8.启动tomcat和apache测试(先启动tomcat)

9.建立虚拟目录:

① 在tomcat/conf/server.xml文件中建立









docBase为真实目录

② 在apache/conf/workers2.properties文件中建立

[uri:/dirName/*.jsp]

work=ajp13:localhost:8009

七.安装mysql4.0.16

1. 解压缩文件:mysql-debug-4.0.16-pc-linux-i686.tar.gz

2. 将解压后的目录改为mysql4016

3. 建立用户:useradd –g root mysql

passwd –u mysql

4. 将mysql4016目录的拥有权改成 mysql 用户:chown –R mysql:root mysql4016

5. 在/usr/local下建立连接文件

ln –s /usr/local/e789/mysql4016 mysql

6. 以mysql用户的身份登陆,运行脚本来建立一个初始化数据库:

su mysql

./mysql4016/scripts/mysql_install_db

exit(回到root身份)

7. 把启动脚本程序复制到/etc/rc.d/init.d目录里

cd /etc/rc.d/init.d

cp /usr/local/mysql/support-files/mysql.server mysql

8. 运行chkconfig把MySQL添加到系统的启动服务组里面去

/sbin/chkconfig --del mysql

/sbin/chkconfig --add mysql

9. 测试mysql

启动:/etc/rc.d/init.d/mysql start

如果显示Starting mysqld daemon with databases from /var/lib/mysql 则成功

(/usr/local/mysql/bin/mysql为mysql客户端程序)

10.最后更改管理员密码

./bin/mysqladmin -u root password e789

11.登陆:mysql –u root –p e789

二.安装jdk 1.4.2

1. 执行二进制文件 ./j2sdk-1_4_2-linux-i586.bin 解压生成j2sdk1.4.2文件夹

2. 将文件夹改名为jdk142

3. 配置文件(设置环境变量):/etc/profile

JAVA_HOME=/usr/local/e789/jdk142

export JAVA_HOME

TOMCAT_HOME=/usr/local/e789/tomcat4129

export TOMCAT_HOME

CATALINA_HOME=/usr/local/e789/tomcat4129

export CATALINA_HOME

CATALINA_BASE=/usr/local/e789/tomcat4129

export CATALINA_BASE

APACHE_HOME=/usr/local/e789/apache2048

export APACHE_HOME

HTTPD_HOME=/usr/local/e789/apache2048

export HTTPD_HOME

CLASSPATH=/usr/local/e789/jdk142/lib:/usr/local/e789/jdk142/jre/lib

export CLASSPATH

PATH=$PAHT:/usr/local/e789/jdk142/bin:/usr/local/e789/jdk142/jre/bin

三.安装tomcat 4.1.29

1. 解压缩文件jakarta-tomcat-4.1.29.tar.gz

2. 将解压后的文件夹改名为tomcat4129

3. 启动(停止)命令:./bin/startup.sh (shutdown.sh)

4. 测试tomcat:在ie里输入http://(ip):8080,如果有内容出现,则说明安装成功

四.安装配置apache 2.0.48

1. 解压缩文件httpd-2.0.48.tar.gz

2. 安装:①./configure --with-layout=Apache

--prefix=/usr/local/e789/apache2048
--enable-module=so

--enable-mods-shared=most

--with-mpm=prefork



②make

③make install

3. 配置文件:/usr/local/e789/apache2048/conf/httpd.conf

DocumentRoot "/usr/local/e789/tomcat4129/webapps"(将发布的目录指向tomcat的webapps目录)



4. 启动文件:./bin/httpd -k start (restart/stop)

5. 测试apache:在ie里输入http://(ip),如果有内容出现,则说明安装成功

五.安装jk2

1. 解压缩文件jakarta-tomcat-connectors-jk2-src-current.tar.gz

2. 将解压后的文件夹改名为jk202

3. 执行buildconf.sh文件。

4. 执行configure文件:

①./jk/native2/configure --with-apxs2=/usr/local/e789/apache2048/bin/apxs --enable-EAPI

--with-tomcat41=/usr/local/e789/tomcat4129

②make

③make install(我做的时候,这个命令不好用)

六.整和apache和tomcat

1. 把jkjni.so和mod_jk2.so文件复制到apache的modules目录下

cp /usr/local/e789/jk202/jk/build/jk2/apache2/*.so /usr/local/e789/apache2048/modules

2. 把jk2.properties文件复制到tomcat的conf目录下

cp /usr/local/e789/jk202/jk/conf/jk2.properties /usr/local/e789/tomcat4129/conf

3. 把worker2.properties文件复制到apache的conf目录下

cp /usr/local/e789/jk202/jk/conf/worker2.properties /usr/local/e789/apache2048/conf

4. 编辑jk2.properties文件

vi /usr/local/tomcat/conf/jk2.properties

# list of needed handlers.

handler.list=channelSocket,request

# Override the default port for the channelSocket

channelSocket.port=8009

5. 编辑apache的http.conf

vi /usr/local/apache/conf/http.conf

LoadModule jk2_module modules/mod_jk2.so

2. 把jk2.properties文件复制到tomcat的conf目录下

cp /usr/local/e789/jk202/jk/conf/jk2.properties /usr/local/e789/tomcat4129/conf

3. 把worker2.properties文件复制到apache的conf目录下

cp /usr/local/e789/jk202/jk/conf/worker2.properties /usr/local/e789/apache2048/conf

4. 编辑jk2.properties文件

vi /usr/local/tomcat/conf/jk2.properties

# list of needed handlers.

handler.list=channelSocket,request

# Override the default port for the channelSocket

channelSocket.port=8009

5. 编辑apache的http.conf

vi /usr/local/apache/conf/http.conf

LoadModule jk2_module modules/mod_jk2.so

DirectoryIndex index.html index.html.var index.jsp

6. 编辑apache/conf/workers2.properties文件

# only at beginnin. In production uncomment it out
[logger.apache2]
level=DEBUG

[shm]
file=/usr/local/apache/logs/jk2.shm
size=1048576

# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

# Uri mapping
[uri:*.jsp]
worker=ajp13:localhost:8009
(负责把*.jsp的文件通过ajp13发送到tomcat处理)

7.编辑tomcat的server.xml










8.启动tomcat和apache测试(先启动tomcat)

9.建立虚拟目录:

① 在tomcat/conf/server.xml文件中建立









docBase为真实目录

② 在apache/conf/workers2.properties文件中建立

[uri:/dirName/*.jsp]

work=ajp13:localhost:8009

七.安装mysql4.0.16

1. 解压缩文件:mysql-debug-4.0.16-pc-linux-i686.tar.gz

2. 将解压后的目录改为mysql4016

3. 建立用户:useradd –g root mysql

passwd –u mysql

4. 将mysql4016目录的拥有权改成 mysql 用户:chown –R mysql:root mysql4016

5. 在/usr/local下建立连接文件

ln –s /usr/local/e789/mysql4016 mysql

6. 以mysql用户的身份登陆,运行脚本来建立一个初始化数据库:

su mysql

./mysql4016/scripts/mysql_install_db

exit(回到root身份)

7. 把启动脚本程序复制到/etc/rc.d/init.d目录里

cd /etc/rc.d/init.d

cp /usr/local/mysql/support-files/mysql.server mysql

8. 运行chkconfig把MySQL添加到系统的启动服务组里面去

/sbin/chkconfig --del mysql

/sbin/chkconfig --add mysql

9. 测试mysql

启动:/etc/rc.d/init.d/mysql start

如果显示Starting mysqld daemon with databases from /var/lib/mysql 则成功

(/usr/local/mysql/bin/mysql为mysql客户端程序)

10.最后更改管理员密码

./bin/mysqladmin -u root password e789

11.登陆:mysql –u root –p e789
 
  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值