apache_httpd的安装与配置

1.安装程序及服务名
httpd -k install -n Apache2.4

安装成功后,会提示如下异常:

Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::14ea:32a2:9c1d:bc74. Set the 'ServerName' directive globally to suppress this message

找到安装目录下的Apache24\conf\httpd.conf文件,找到219行,修改名称如下:

ServerName localhost:80

同时修改以下几处配置:

38行修改为
ServerRoot "安装的根目录"
如:ServerRoot "c:/apache_httpd_server_x64/Apache24"244245行, 修改为
DocumentRoot "c:/apache_httpd_server_x64/Apache24/htdocs"
<Directory "c:/apache_httpd_server_x64/Apache24/htdocs">

第363行修改为
ScriptAlias /cgi-bin/ "c:/apache_httpd_server_x64/Apache24/cgi-bin/"

测试配置文件的语法是否正确:

httpd -n Apache2.4 -t

如果返回 Syntax OK,则表示没有语法错误,则可以直接运行以下命令,启动服务:

httpd -k start

如果出现异常,则按提示的错误信息进行修改。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值