Ubuntu 11.04 安装了 apache2 并安装了所有相关软件包。我已经尝试了大部分博客,并让 google 和其他论坛成为我最好的朋友,但我无法解决这个问题。
我需要在我的本地系统上设置一个命名的虚拟主机以进行开发。
我在其中创建了目录“vivek”/var/www并复制了默认的 index.html 并编辑了一些元素。
我添加的文件vivek.com中/etc/apache2/sites-available,如下所示:
# Ensure that Apache listens on port 80
Listen 80
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.vivek.com
DocumentRoot /var/www/vivek
# Other directives here
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/vivek/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory /> …Run Code Online (Sandbox Code Playgroud)