很抱歉开始讨论之前讨论过的事情。但我找不到合适的解决方案来解决我的问题。感谢您的阅读。
我有一个 VPS 服务器,并使用 /etc/apache2/sites-available/default 文件为其添加了默认根。
我的默认文件是
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/root/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/root/>
Options None
AllowOverride None
Order deny,allow
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
后来我添加了一个名为 alfonsoapp.com 的新域,但现在它可以在默认根目录 /home/root/files/ 上工作,但它应该可以在 /home/alfonsoapp/files 上工作,我哪里做错了?
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/alfonsoapp/files/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/alfonsoapp/files>
Options None
AllowOverride None
Order deny,allow
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>