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 keil的map文件中Image component sizes各项意思
    • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)