apache安装、tomcat安装、tomca单机多实例安装

文章目录

apache安装

yum -y install gcc gcc-c++

tar -jxvf apr-1.5.1.tar.bz2

cd apr-1.5.1

./configure --prefix=/usr/local/apr && make && make install

tar -jxvf apr-util-1.5.2.tar.bz2

cd apr-util-1.5.2
./configure --with-apr=/usr/local/apr/ --prefix=/usr/local/apr-util
make && make install

tar -zxvf pcre-8.32.tar.gz
cd pcre-8.32
./configure --help
./configure --prefix=/usr/local/pcre
make && make install

tar -zxvf httpd-2.4.41.tar.gz
cd httpd-2.4.41
./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --prefix=/usr/local/apache2 --enable-so

make && make install

tomcat安装

tar -zxvf apache-tomcat-8.5.40.tar.gz #解压
mv apache-tomcat-8.5.40 /opt/tomcat #移动
tar -zxvf jdk-8u201-linux-x64.tar.gz -C /usr/local/

vim /etc/profile
export JAVA_HOME=/data/server/jdk1.8 #修改环境变量
export CLASSPATH=.:JAVA_HOME/lib/dt.jar:JAVAHOME/jib/tools.jarexportPATH=JAVA_HOME/jib/tools.jar export PATH=JAVAH​OME/jib/tools.jarexportPATH=PATH:$JAVA_HOME/bin

source /etc/profile #使配置文件生效

/data/server/tomcat8/bin/startup.sh #开启服务

单机多实例

安装tomcat
再复制一份tomcat即可,修改端口别冲突就可以
vim /opt/tomcat/conf/server.xml
8005/8080/8009

将tomcat托管给superviosr管理
yum -y install epel-release
yum -y install supervisor

vim /etc/supervisord.conf

[program:tomcat1]
command=/opt/tomcat1/bin/catalina.sh run

[program:tomcat2]
command=/opt/tomcat2/bin/catalina.sh run

启动supervisord
service supervisord start

查看tomcat1和tomcat2的监听端口,可以看到一整正在监听
ss -ntl | grep 8080
ss -ntl | grep 8081

上一篇:编译安装LAMP架构


下一篇:linux编译安装Apache