目录
1.依赖库的下载及安装apr、apr-util、zlib、openssl
3.1 rm: cannot remove 'libtoolT': No such file or directory
1.依赖库的下载及安装apr、apr-util、zlib、openssl
1.1 apr的安装
apr下载路径:https://mirror.bit.edu.cn/apache//apr/apr-1.7.0.tar.gz
wget https://mirror.bit.edu.cn/apache//apr/apr-1.7.0.tar.gz
tar -zxvf apr-1.7.0.tar.gz
cd apr-1.7.0
./configure --prefix=/home/scott/apache2/apr
make
make install
1.2 apr-util的安装
apr-util下载路径:https://mirror.bit.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
wget https://mirror.bit.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
tar -zxvf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1
./configure --prefix=/home/scott/apache2/apr-util --with-
apr=/home/scott/apache2/apr
make
make install
1.3 zlib的安装
zlib下载路径:http://www.zlib.net/zlib-1.2.11.tar.gz
wget http://www.zlib.net/zlib-1.2.11.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=/home/scott/apache2/zlib-1.2.11
make
make install
1.4 openssl的安装
openssl下载路径:https://www.openssl.org/source/openssl-1.1.1i.tar.gz
wget https://www.openssl.org/source/openssl-1.1.1i.tar.gz
tar -zxvf openssl-1.1.1i.tar.gz
cd openssl-1.1.1i
./config --prefix=/home/scott/apache2/openssl
make
make install
2.Apache的下载及安装
httpd下载地址:https://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.46.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.46.tar.gz
tar -zxvf httpd-2.4.46.tar.gz
cd httpd-2.4.46
./configure --prefix=/home/scott/apache2/httpd --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib=/home/scott/apache2/zlib --with-pcre=/home/scott/apache2/pcre --with-apr=/home/scott/apache2/apr --with-apr-util=/home/scott/apache2/apr-util --with-ssl=/home/scott/apache2/openssl --enable-modules=most --enable-mpms-shared=all
make
make install
将 apache 的配置文件httpd.conf(/home/scott/apache2/httpd/conf/httpd.conf)中的 ServerName 改成可用域名或如下配置 ServerName localhost:80
启动指令: ./bin/httpd -f /home/scott/apache2/httpd/conf/httpd.conf -k start
关闭指令: ./bin/httpd -f /home/scott/apache2/httpd/conf/httpd.conf -k start stop
重启指令: ./bin/httpd -f /home/scott/apache2/httpd/conf/httpd.conf -k start restart
PS:部分情况需要进入到目录 cd /bin/, 才能执行指令httpd
启动指令: httpd -f /home/scott/apache2/httpd/conf/httpd.conf -k start
关闭指令: httpd -f /home/scott/apache2/httpd/conf/httpd.conf -k start stop
重启指令: httpd -f /home/scott/apache2/httpd/conf/httpd.conf -k start restart
index.html文档路径:/home/scott/apache2/httpd/htdocs
验证是否安装成功:
浏览器输入:http://127.0.0.1:82/
页面显示: It works!
成功!
3.安装中问题及解决方法
3.1 rm: cannot remove 'libtoolT': No such file or directory
解决办法
使用如下命令打开configure文件
sudo vi configure
找到RM='$RM'修改为RM='$RM -f'
参考博客:https://blog.csdn.net/github_38336924/article/details/89372771
参考博客:https://blog.csdn.net/sforiz/article/details/81532151