ubuntu上编译安装apache2.4

安装步骤

1.下载apr并编译安装

2.下载apr-util并编译安装
- 到http://apr.apache.org/download.cgi下载apr-util下载地址截图,解压文件
- cd apr-util-1.5.4 -> ./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr->make->sudu make install

3.安装PCRE
- sudo apt-get install libpcre3 libpcre3-dev -y

4.下载httpd并编译安装

  • 进入官网提供的镜像地址http://apache.fayea.com/httpd/
  • 下载httpd下载地址截图,解压文件
  • ./configure –prefix=/usr/local/httpd –with-apr-util=/usr/local/apr-util –with-apr=/usr/local/apr
  • make
  • sudo make install

5.启动apcahe并通过浏览器访问

  • cd /usr/local/httpd/bin 
  • sudo ./apachectl start,通过ps -ef | grep httpd来检测是否有httpd进程正在运行,如下图则表示启动成功启动成功截图
  • 访问localhost初始效果
  • cd /usr/local/httpd/htdoc -> sudo touch test.html ->vim test.html
    想要随便写点啥,会报出这是一个只读文件是禁止写入的报错截图->修改文件的所有者chown xiaosa:xiaosa test.html ->vim test.html写入hello apache ->通过浏览器访问localhost/test.html显示结果截图
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值