apache_httpd的安装与配置

来源:互联网 发布:感性和理性 知乎 编辑:程序博客网 时间:2024/05/18 11:25

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 0
原创粉丝点击