doushen2154 2016-01-20 18:41
浏览 21

在主目录中设置虚拟主机 - Ubuntu 15.10

This is an extension to the following question :

https://askubuntu.com/questions/617190/how-to-setup-apache2-virtualhosts-on-your-home-directory-on-ubuntu-14-04


I'm trying to setup a virtual host to run apps from my home directory

/home/byteseeker/projects/blogapp

I followed all the steps listed by the user @Vinicius Santana and also included the correction answered by @Doug Smythies in the above mentioned question.

The Virtual Host file in

/etc/apache2/sites-available/blogapp.conf

looks like this

< VirtualHost *:80 >

ServerAdmin webmaster@blogapp.dev
ServerName blogapp.dev
ServerAlias www.blogapp.dev
DocumentRoot /home/byteseeker/projects/blogapp/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

< /VirtualHost >

And the < Directory > tag in

/etc/apache2/apache2.conf

(as pointed out in referred question's solution ) looks like this

< Directory / >

Options FollowSymLinks
AllowOverride None
Require all denied
< /Directory >

< Directory /usr/share >

AllowOverride None
Require all granted

< /Directory >

< Directory /var/www/ >

Options Indexes FollowSymLinks
AllowOverride None
Require all granted
< /Directory >

< Directory /home/byteseeker/projects/blogapp/ >

Options Indexes FollowSymLinks
AllowOverride None
Require all granted
< /Directory >

The Hosts file in

/etc/hosts

has the contents as

127.0.0.1 localhost
127.0.0.1 anonymous
127.0.0.1 blogapp.dev

I have also put a "index.html" file in

/home/byteseeker/projects/blogapp

with a simple welcome message

Now when I try to go to blogapp.dev , I always end up getting the same "It Works" page that I get when accessing "localhost"

What's possibly wrong with my setup ?

N.B: I'm using

  1. Apache 2.4.12
  2. PHP 5.6.11
  3. Ubuntu Mate 15.10
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 一道python难题2
    • ¥15 一道python难题
    • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler
    • ¥15 oracle集群安装出bug
    • ¥15 关于#python#的问题:自动化测试
    • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
    • ¥15 教务系统账号被盗号如何追溯设备