如何在Apache服务器中添加虚拟directores并允许访问页面?

如何在Apache服务器中添加虚拟directores并允许访问页面?,apache,apache2,Apache,Apache2,我知道这是一个重复的问题,但我完全无法理解如何为apache服务器创建虚拟目录 我可以访问我的主页index.html,但无法访问该文件夹中的其他页面 page2.html在/var/www/html中/ 我还需要查看文件夹固件软件链接到另一个文件夹在桌面上。 我用的是软呢帽14 以下是我的问题 1.如何在/var/www/html/中启用对其他页面的访问? 2.我必须为该文件夹提供哪些权限以及httpd.conf中的哪些更改? 3.如何轻松添加虚拟目录?是否每次都必须编辑.conf文件? 我是

我知道这是一个重复的问题,但我完全无法理解如何为apache服务器创建虚拟目录

我可以访问我的主页index.html,但无法访问该文件夹中的其他页面 page2.html在/var/www/html中/

我还需要查看文件夹固件软件链接到另一个文件夹在桌面上。 我用的是软呢帽14

以下是我的问题 1.如何在/var/www/html/中启用对其他页面的访问? 2.我必须为该文件夹提供哪些权限以及httpd.conf中的哪些更改? 3.如何轻松添加虚拟目录?是否每次都必须编辑.conf文件? 我是否可以编辑一次.conf文件,然后在同一父文件夹中创建子目录而不引起麻烦

当前HTTPD.conf为-

目前的特权是-

[root@wbserv ~]# ls -l /var/www/
total 24
drwxr-xr-x.  2 root      root 4096 Jul 26  2010 cgi-bin
drwxr-xr-x.  3 root      root 4096 Jan 25 17:23 error
drwxr-xr-x.  2 root      root 4096 Feb 14 04:41 html
drwxr-xr-x.  3 root      root 4096 Jan 25 17:26 icons
drwxr-xr-x. 14 root      root 4096 Jan 25 17:27 manual
drwxr-xr-x.  2 webalizer root 4096 Feb  7 03:39 usage
[root@wbserv ~]# ls -l /var/www/html/
total 868
-rwxr-xr-x. 1 root root  52264 Feb  6 15:48 bkg.jpg
-rwxr-xr-x. 1 root root 462993 Feb  6 15:48 banner.png
-rwxr-xr-x. 1 root root  28785 Feb  6 15:48 title.png
lrwxrwxrwx. 1 root root     24 Feb 10 15:39 Firmwares -> /root/Desktop/Firmwares/
-rwxr-xr-x. 1 root root   6282 Feb 14 04:39 index.html
-rwxr-xr-x. 1 root root   9304 Feb  6 15:48 logo.png
-rwxr-xr-x. 1 root root  16877 Feb  6 15:48 sorttable.js
-rwxr-xr-x. 1 root root   1432 Feb 14 04:39 page2.html
-rwxr-xr-x. 1 root root   4303 Feb  6 15:48 style.css

[root@wbserv ~]# ls -l /root/Desktop/
total 16
drwx------.  4 root root 4096 Jan 31 15:28 Firmwares
drwx------. 10 root root 4096 Feb 14 04:36 Utilities

您的配置看起来与您要完成的目标相符。无法访问固件目录中的文件的原因是apache用户和/或组没有读取目录的权限。此外,除了文档根目录/var/www/html中的index.html文件之外,我看不到访问其他文件有任何问题。如果您试图访问page2.html,会出现什么错误?我通过将page2.html放入另一个文件夹/var/www/html/p2/page2.html来访问它。如何启用apache对固件文件夹的访问?