D
D
Denis Ogurtsov2014-05-12 12:19:01
Apache HTTP Server
Denis Ogurtsov, 2014-05-12 12:19:01

Why doesn't using mod_macro for Wirth. hosts?

I have been using this for more than a year:
habrahabr.ru/post/112193
to create virtual hosts. Recently installed Ubuntu 14.04. I set everything according to the article:
habrahabr.ru/sandbox/38025
But when accessing any local domain or localhost, it still throws in the
/var/www/html/ folder.
In general, the file with virtual hosts is ignored:
/etc/apache2/conf.d/ custom/vhosts
PS:
- Apache rebooted;
- executed commands:

sudo apt-get install libapache2-mod-macro
sudo a2enmod macro

- /etc/hosts :
127.0.0.1 test2.loc www.test2.loc
- /etc/apache2/conf.d/custom/vhosts:
<Macro VHost $host $path>
    <VirtualHost *:80>
        DocumentRoot "$path"
        ServerAdmin [email protected]
        ServerName $host
        ServerAlias www.$host

        DirectoryIndex index.php index.html index.htm index.shtml

        <Directory "$path">
        Options FollowSymLinks
        	Options all
                AllowOverride All
        </Directory>
    </VirtualHost>

</Macro>
......
test2.loc /home/www-data/www/test2
.......

-folder with /home/www-data/www/test2/ exists with drwxrwxr-x
permissions -apache version:
Server version: Apache/2.4.7 (Ubuntu)
Server built:   Apr  3 2014 12:20:28

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
olegf13, 2014-07-06
@olegf13

I also got into this situation. The following helped.
Renamed the vhosts file to vhosts.conf and put it in /etc/apache2/
In /etc/apache2/apache2.conf added to the end:
Then restarted apache:
And it all worked!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question