【发布时间】:2013-05-10 13:17:03
【问题描述】:
我在 localhost (Ubuntu 13.04) 的 Apache 安装中遇到了这个问题
提示:
干净安装和httpd.conf文件为空(空白)
这个命令行打开一个文件:
sudo gedit /etc/apache2/sites-available/default
该文件有以下数据:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
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
</VirtualHost>
我需要将 /var/www 移动到我的主目录,例如:
/home/USER/www/site1
/home/USER/www/site2
提前谢谢你! :D
【问题讨论】:
-
就这样吧? DocumentRoot /var/www => /home/USER/www
-
和目录指令
-
我试过了,还是不行,你还是会收到错误404
-
您确实在更改后重新启动了 Apache,对吧?
-
只编辑这个文件还是更多?
标签: php apache2 localhost lamp