Fedora 39中Apache httpd虚拟主机无法返回/site1下index.html内容的问题求助
Fedora 39中Apache httpd虚拟主机无法返回/site1下index.html内容的问题求助
各位好,我在Fedora 39的虚拟机上配置Apache虚拟主机时遇到了问题,折腾了好久都没解决,希望能得到大家的帮助。
先把我的环境和操作细节整理出来:
系统与软件版本
- 系统:Fedora Linux 39
- Apache版本:
执行命令httpd -v得到输出:
Server version: Apache/2.4.58 (Fedora Linux)
Server built: Oct 20 2023 00:00:00
虚拟主机配置
我在/etc/httpd/conf.d目录下创建了名为00-test的配置文件,内容如下:
<Directory /site1> Require all granted AllowOverride None </Directory> <VirtualHost *:8070> DocumentRoot "/site1" </VirtualHost>
文件与权限设置
/site1目录下存放了index.html文件,为了排除权限问题,我给目录和文件都设置了完全权限:
chmod a+rwx /site1 /site1/index.html
其他操作细节
- 已经禁用并停止了firewalld,避免防火墙拦截端口:
systemctl disable firewalld systemctl stop firewalld
- 每次修改配置后,都会执行重载和重启httpd的操作,甚至还重启过整个系统:
systemctl reload httpd systemctl restart httpd
主配置验证情况
/etc/httpd/conf/httpd.conf默认监听80端口,我在/var/www/html下创建的Index.html可以正常访问,说明Apache主服务是正常运行的。
问题现象
我期望通过curl localhost:8070能看到/site1/index.html的内容,但实际没有任何返回。查看/var/log/httpd/error_log也找不到相关错误,systemctl status httpd显示服务处于active状态。我已经反复尝试修改配置并重启服务,甚至ChatGPT给出的方法也试了好几轮,但都没解决问题。
麻烦各位帮忙排查下可能的原因,谢谢!
备注:内容来源于stack exchange,提问作者An98
相关产品推荐
相关产品推荐

