剖析httpd配置文件(二)
  DF5J4hb0hcmT 2023年11月19日 25 0

百度百科介绍

httpd是Apache超文本传输协议(HTTP)服务器的主程序。被设计为一个独立运行的后台进程,它会建立一个处理请求的子进程或线程的池。

简单来说httpd可以发布网页、文件服务器等。

端口port配置

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

监听端口号默认是80,可以根据自己情况修改。注意如果是云服务器,需要开放对应端口号。

主目录配置

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"

可以看到,默认目录是/var/www/html,上一篇文章我们就是在此目录下编写index.html进行测试,次数可以改成其他目录。

此目录还可以放置文件,作为文件服务器使用。


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月19日 0

暂无评论

推荐阅读
  4yu2JdefgeRW   2023年11月02日   32   0   0 开发工具vimApacheruntimePHP
DF5J4hb0hcmT