Apache源码安装
程序员文章站
2022-05-09 15:46:45
1 下载安装包 2 解压 3 添加httpd对于apr,apr util,pcre的依赖 4 安装apr 5 安装apr util 6 安装prce 7 安装httpd 8 关闭防火墙 9 编辑httpd的配置文件 10 添加apache的快捷方式 11 修改httpd 12 运行httpd ......
1 下载安装包
apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz pcre-8.43.tar.gz httpd-2.4.41.tar.gz https://github.com/purple910/linux
2 解压
tar -zxf apr-1.7.0.tar.gz tar -zxf apr-util-1.6.1.tar.gz tar -zxf pcre-8.43.tar.gz tar -zxf httpd-2.4.41.tar.gz
3 添加httpd对于apr,apr-util,pcre的依赖
cp -r apr-1.7.0 httpd-2.4.41/srclib/apr cp -r util-1.6.1 httpd-2.4.41/srclib/apr-util cp -r pcre-8.43 httpd-2.4.41/srclib/pcre
4 安装apr
cd apr-1.7.0 gedit configure(将 $rm "$cfgfile" 注释掉) ./configure --prefix=/usr/local/src/apr make && make install
5 安装apr-util
cd .././apr-util-1.6.1 ./configure –prefix=/usr/local/src/apr-util –with-apr=/usr/local/src/apr make && make install (如果报错 缺少expat.h) yum install -y expat-devel.x86_64
6 安装prce
cd .././ pcre-8.43 ./configure –prefix=/usr/local/src/pcre make && make install
7 安装httpd
cd .././ httpd-2.4.41 ./configure --with-included-apr --sysconfdir=/etc/httpd --prefix=/usr/local/src/apache2.4 --with-apr=/usr/local/src/apr --with-apr-util=/usr/local/src/apr-util --with-pcre=/usr/local/src/pcre --enable-so --enable-unixd --enable-rewrite make && make install
8 关闭防火墙
server firewall stop
9 编辑httpd的配置文件
vim /etc/httpd/httpd.conf #servername www.example.com:80 servername 172.0.0.1:80
10 添加apache的快捷方式
cp /usr/local/src/apache2.4/bin/apachectl /etc/init.d/httpd ln -s /etc/init.d/httpd /etc/rc.d/s85httpd
11 修改httpd
vim /etc/rc.d/init.d/httpd # chkconfig: 345 85 15 # description: activates/deactivates apache web server
12 运行httpd
server httpd start ah00558: httpd: could not reliably determine the server's fully qualified domain name,using localhost.localdomain. set the 'servername' directive globally to suppress this message
推荐阅读
-
Delcam FeatureCAM 2014安装及破解图文详细教程
-
Vue源码之关于vm.$delete()/Vue.use()内部原理详解
-
wallpaper engine安装目录在哪 wallpaper engine安装目录一览
-
深入解析Vue源码实例挂载与编译流程实现思路详解
-
Vocaloid4 Editor怎么安装? Vocaloid4 Editor安装与激活图文详细教程(包括反激活)
-
详解无限滚动插件vue-infinite-scroll源码解析
-
prism7怎么破解? Graphpad prism 7破解版安装详细教程(附激活码)
-
android 九宫格滑动解锁开机实例源码学习
-
Linux虚拟机下mysql 5.7安装配置方法图文教程
-
记录无法安装mysql-Invalid GPG Key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql的解决办法