首页 > 解决方案 > 如何在 Debian 下的用户目录中为网站启用 Apache 虚拟主机?

问题描述

我想在本地运行一个网站,其文件在我的用户目录中,我在下面创建了 .conf 文件,a2ensite'd,apache 重新加载,当我在浏览器中键入 /localhost/instanote.com 时,找不到.

ServerName instanote.com

ServerAlias insta-note.com




DocumentRoot /home/thomas/ownCloud/CW14/cms_cw14
<Directory "/home/thomas/ownCloud/CW14/cms_cw14">
    Options FollowSymlinks
    AllowOverride all
    Require all granted

</Directory>

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf

我不知道为什么,但是开头和结尾的开始和结束标签“<”“VirtualHost *:80”>“”“<”“/VirtualHost”“>”没有显示在上面,但它们存在于我的代码谢谢

标签: apache

解决方案


推荐阅读