【发布时间】:2014-08-28 12:19:01
【问题描述】:
1)我创建了默认配置文件的副本并将其重命名为“livrets.com”(在 /etc/apache2/sites-available 目录中)
2) 我编辑如下:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName livrets.com
ServerAlias www.livrets.com
DocumentRoot /var/www/livrets.com/htdocs
<Directory /var/www/livrets.com/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
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>
3) 我启用它运行sudo a2ensite livrets.com
4) 我创建了目录 /var/livrets.com/htdocs 给它 777 个属性(可以肯定)和我的用户作为所有者:sudo chown -R fred:fred /var/www
5) 我在 /var/www/livrets.com/htdocs 中创建了一个 index.html 文件
6)我重启了apache
不过,当我在浏览器中键入 livrets.com URL 时,它不会显示我的 /var/www/livrets.com/htdocs/index.html 文件。
有什么想法吗?
【问题讨论】:
标签: ubuntu apache2 localhost virtualhost