源码包安装apache

含有的命令:cd,wget,tar,cd,yum,./configure,make,make install,vim

===安装apache===

[root@ycj ~]# cd /usr/src/ //切换路径

[root@ycj src]# wget http://archive.apache.org/dist/httpd/httpd-2.4.29.tar.gz

//获取安装包

[root@ycj src]# tar -xzf httpd-2.4.29.tar.gz //解压

[root@ycj src]# cd httpd-2.4.29/ //切换路径

==安装依赖==

[root@ycj httpd-2.4.29]# yum -y install apr-devel apr apr-util-devel

[root@ycj httpd-2.4.29]# yum -y install gcc c gcc-c++

[root@ycj httpd-2.4.29]# yum install -y pcre*

==编译==

[root@ycj httpd-2.4.29]# ./configure --prefix=/usr/local/httpd --enable-so --enable-mods-shared=most

--prefix是安装的路径

[root@ycj httpd-2.4.29]# make && make install

[root@ycj httpd-2.4.29]# vim /usr/local/httpd/conf/httpd.conf

#ServerName www.example.com:80

//去掉注释,作用是开启80端口

[root@ycj httpd-2.4.29]# /usr/local/httpd/bin/apachectl start

//开启服务,源码包不能用systemctl

在浏览器用ip访问

源码包安装apache源码包安装apache

上一篇:CentOS源码包安装apache、nginx服务


下一篇:python网络-多线程(22)