Apache 源码包安装

安装依赖包:
$ rpm -ivh apr-1.4.8-3.el7.x86_64.rpm
$ rpm -ivh apr-devel-1.4.8-3.el7.x86_64.rpm
$ rpm -ivh cyrus-sasl-devel-2.1.26-20.el7_2.x86_64.rpm
$ rpm -ivh expat-devel-2.1.0-8.el7.x86_64.rpm
$ rpm -ivh libdb-devel-5.3.21-19.el7.x86_64.rpm
$ rpm -ivh openldap-devel-2.4.40-13.el7.x86_64.rpm
$ rpm -ivh apr-util-devel-1.5.2-6.el7.x86_64.rpm
$ rpm -ivh apr-util-1.5.2-6.el7.x86_64.rpm
$ rpm -ivh pcre-devel-8.32-15.el7_2.1.x86_64.rpm
$ rpm -ivh pcre-8.32-15.el7_2.1.x86_64.rpm

apache源码编译及安装
解包
$ tar zxf httpd-2.4.25.tar.gz -C /usr/src
配置
$ ./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi
编译及安装
$ make && make install

$ ls /usr/local/httpd

执行优化路径
$ ln -s /usr/local/httpd/bin/* /usr/local/bin
$ ls -l /usr/local/bin/httpd /usr/local/bin/apachectl

b)启动服务后,客户端通过http://IP能访问默认的网站。
$ vim /lib/systemd/system/httpd.service

[Unit]
Description=The Apache  HTTP  Server
After=network.target

[Service]
Type=forking
PIDFile=/usr/local/httpd/logs/httpd.pid
ExecStart=/usr/local/httpd/bin/apachectl  $OPTIONS
ExecReload=/bin/kill  -HUP  $MAINPID
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=graphical.target

开启apache服务
$ systemctl start httpd.service

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值