Centos6安装apache rpm

  • A+
所属分类:apache
  1. 查看系统是否已安装apache,如没有返回信息说明没安装
     rpm -qa httpd
  2. yum安装apache
     yum install httpd -y
  3.  设置随系统启动
     chkconfig httpd on
  4.  开启apache
     Service httpd start
  5.  提示httpd; Could not reliably determine the server’s fully qualified domain name, using local.localdomain for ServerName
    解决办法:把#ServerName www.example.com:80注释并改成ServerName localhost:80
    或者直接再最后添加ServerName localhost:80
  6. Apache默认存放路径/var/www/html,配置文件/etc/httpd/conf/httpd.conf
  7.  建议删除welcome.conf, rm -rf /etc/httpd/conf.d/welcome.conf
  8. 禁止显示apache版本号
     ServerTokens ProductOnly
    
     ServerSignature Off

    9 测试显示版本

     Curl -I ip
  9. 修改网站根目录
     DocumentRoot /**
avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: