0
点赞
收藏
分享

微信扫一扫

目标检测如何演变:从区域提议和 Haar 级联到零样本技术

程序猿不脱发2 2023-10-01 阅读 27
phpapache

最近在练习搭建网站,遇到游览器找不到服务器上的php文件的问题。后来查找发现,apache文档根目录跟apache虚拟主机文档根目录不同,服务器开启了虚拟主机功能。这导致游览器找不到php文件。

使用的环境是LAMP,它 的操作系统和软件版本如下:CentOS 7.8 64bit,Apache 2.4.46 ,MariaDB 10.5.9,PHP 7.4.29 。

可以修过虚拟主机的文档根地址来处理这个问题。或者不开启虚拟主机功能。

注意!:/home/www/htdxxx只是目录名的一个示意名,具体要根据计算机的实际来设置。

1、apache 的 httpd.conf 文件部分内容

1.1、apache文件根目录

DocumentRoot "/home/www/htdxxx"
<Directory "/home/www/htdxxx">
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

1.2、是否包含vhost.conf。这里设置了不包含该文件

# Virtual hosts
# Include conf/extra/httpd-vhosts.conf

1.3、目录索引(DirectoryIndex)。index.html与index.php的位置影响网站的网页能否正常显示。

# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

2、httpd-vhosts.conf文件部分内容

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/home/www/htdxxx/dummy-host.example.com"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error_log"
    CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ......     # 备注:省略了几行
</VirtualHost>

举报

相关推荐

0 条评论