Linux系列之离线安装Apache HTTP

1.  安装准备

1.1  下载介质

1.2  上传介质 

scp -r /opt/tools/httpd 192.168.233.130:/opt/tools/httpd

2.  安装HTTP

2.1  编译安装apr

cd /opt/tools/httpd
tar -zxvf apr-1.5.2.tar.gz -C ./

cd ./apr-1.5.2
./configure --prefix=/usr/local/httpd/apr
make 
make install

2.2  编译安装apr-util

cd /opt/tools/httpd
tar -zxvf apr-util-1.5.4.tar.gz -C ./

cd ./apr-util-1.5.4
./configure --prefix=/usr/local/httpd/apr-util --with-apr=/usr/local/httpd/apr/bin/apr-1-config
make 
make install

2.3  编译安装pcre

cd /opt/tools/httpd
tar -zxvf pcre-8.42.tar.gz -C ./

cd ./pcre-8.42
./configure --prefix=/usr/local/httpd/pcre --with-apr=/usr/local/httpd/apr/bin/apr-1-config
make 
make install

2.4  编译安装httpd

cd /opt/tools/httpd
tar -zxvf httpd-2.4.34.tar.gz -C ./

cd ./httpd-2.4.34
./configure --prefix=/usr/local/httpd/apache2 --with-apr=/usr/local/httpd/apr/bin/apr-1-config --with-apr-util=/usr/local/httpd/apr-util/bin/apu-1-config --with-pcre=/usr/local/httpd/pcre/bin/pcre-config --enable-dav --enable-so
make 
make install

2.5 修改httpd配置

    # vim /usr/local/httpd/apache2/conf/httpd.conf

ServerName 192.168.233.130:80

3.  启动HTTP

3.1  将apachectl加入service系统服务

cp /usr/local/httpd/apache2/bin/apachectl /etc/rc.d/init.d/apache
chkconfig --add apache    

3.2  启动apache服务

service apache start 

3.3  验证启动

ps -ef | grep http
netstat -an | grep :80    

3.4 WEB UI验证

3.5  配置HTTP环境变量

    # vim /etc/profile

# HTTP_HOME
export HTTP_HOME=/usr/local/httpd/apache2
export PATH=$PATH:$HTTP_HOME/bin

3.6 验证HTTP环境

source /etc/profile
httpd -v

 

©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页