linux下安装apache

安装前准备软件
apr-1.4.8.tar.gz
apr-util-1.5.2.tar.gz
  pcre-8.32.tar.gz
  httpd-2.4.6.tar.gz
1、安装apr
        1)shell# tar zxvf   apr-1.4.8.tar.gz
        2) shell#  cd apr-1.4.8
        3) shell#   ./configure --prefix=/usr/local/apr
错误解决:
rm: cannot remove `libtoolT': No such file or directory
解决办法:
vi configure
在30031行 #    $RM "$cfgfile" 前面加#注释掉
在重新./configure
        4) shell#  make && make install
2、安装apr-util
        1) shell#  tar zxvf apr-util-1.5.2.tar.gz
        2) shell#  cd apr-util-1.5.2
        3)  shell#  ./configure --prefix=/usr/local/aprutil --with-apr=/usr/local/apr/ 
4) shell#  make && make install
4、安装pcre
      1) shell#  tar zxvf pcre-8.32.tar.gz
        2) shell#  cd pcre-8.32
        3) shell#  ./configure --prefix=/usr/local/pcre
        4) shell#  make && make install
5、安装apache
安装Apache有两个要注意的地方,因为我这里用的Postfix的后台管理是extman这个程序,而它是通过CGI的方式来进行管理的,所以这里启用了suexec的功能,还有一个是关于网站的存放路径的,如果不指定,那么在启用suexec后会出现 suexec-docroot的错误。
      1) shell#  tar zxvf httpd-2.4.6.tar.gz
      2) shell#  cd httpd-2.4.6
      3) shell#  ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/aprutil --with-pcre=/usr/local/pcre --enable-so --enable-rewrite --enable-mods-shared=all --enable-suexec --with-suexec-caller=daemon --with-suexec-docroot=/var/www
      4) shell#  make && make install
      6) shell#  cd /usr/local/apache2/bin
      7) shell#  ./apachectl start       #启动apache
启动apache报错
解决httpd: Could not reliably determine the server's fully qualified domain name
进入apache的安装目录:
linux : /usr/local/apache/conf
将里面的#ServerName localhost:80注释去掉即可。

6.安装完后的设置(对于php架设的网站要开通这两个功能)
1.apache开启伪静态
第一步:LoadModule rewrite_module modules/mod_rewrite.so   取消注释
第二步:搜索AllowOverride None 替换为 AllowOverride All(是有对应网站目录下的那个)
2.apache设置主页
修改apache的配置文件(/usr/local/apache/conf/httpd.conf)配置文件
    DirectoryIndex index.php index.html
找到这段代码:按照顺序写你的主页,中间用空格隔开


至此,apache已安装完毕

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值