A
A
Alex Helber2016-12-02 13:10:35
Apache HTTP Server
Alex Helber, 2016-12-02 13:10:35

Why Can't Create Apache2 Ubuntu Virtual Host?

I can't access the site either from a PC on the local network or directly from the server itself :(

[email protected]:/etc/apache2$ ls sites-available/
000-default.conf  default-ssl.conf  remload.conf

[email protected]:/etc/apache2$ cat sites-available/remload.conf
<VirtualHost *:80>
    ServerName remload
    ServerAdmin [email protected]

    DocumentRoot /home/alx/www/remload
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /home/alx/www/remload>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log

    LogLevel debug

    CustomLog /var/log/apache2/access.log combined
</VirtualHost>

[email protected]:/etc/apache2$ ls sites-enabled/
000-default.conf  remload.conf

______________________________________
cat /var/log/apache2/error.log


[Fri Dec 02 12:00:58.964270 2016] [authz_core:debug] [pid 3543] mod_authz_core.c(809): [client 127.0.0.1:57412] AH01626: authorization result of <RequireAny>: denied
[Fri Dec 02 12:00:58.964297 2016] [authz_core:error] [pid 3543] [client 127.0.0.1:57412] AH01630: client denied by server configuration: /home/alx/www/remload
[Fri Dec 02 12:00:59.202869 2016] [authz_core:debug] [pid 3543] mod_authz_core.c(809): [client 127.0.0.1:57412] AH01626: authorization result of Require all denied: denied
[Fri Dec 02 12:00:59.202989 2016] [authz_core:debug] [pid 3543] mod_authz_core.c(809): [client 127.0.0.1:57412] AH01626: authorization result of <RequireAny>: denied
[Fri Dec 02 12:00:59.203015 2016] [authz_core:error] [pid 3543] [client 127.0.0.1:57412] AH01630: client denied by server configuration: /home/alx/www/remload
[Fri Dec 02 12:00:59.282146 2016] [authz_core:debug] [pid 3543] mod_authz_core.c(809): [client 127.0.0.1:57412] AH01626: authorization result of Require all denied: denied
[Fri Dec 02 12:00:59.282226 2016] [authz_core:debug] [pid 3543] mod_authz_core.c(809): [client 127.0.0.1:57412] AH01626: authorization result of <RequireAny>: denied
[Fri Dec 02 12:00:59.282248 2016] [authz_core:error] [pid 3543] [client 127.0.0.1:57412] AH01630: client denied by server configuration: /home/alx/www/remload

________________________________________________________________
upd. The page opened on the server (I had to add a Directory for this folder to /etc/apache2/apache2.conf)
The next problem is accessing the page from a remote machine.
At http://[local_ip]/remload I get 404
I'm waiting for your suggestions and advice, colleagues!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2016-12-02
@goodwin332

Starting with apache2.4 to access the virtual host add Require all granted to Directory
What would be

<Directory /home/alx/www/remload>
    AllowOverride All
    Options Indexes FollowSymLinks MultiViews
    Require all granted
</Directory>

<VirtualHost *:80>
    ServerName localhost
    ServerAdmin [email protected]

    DocumentRoot /home/alx/www
    <Directory /home/alx/www>
        AllowOverride All
        Options Indexes FollowSymLinks MultiViews
        Require all granted
    </Directory>

    ErrorLog /var/log/apache2/error.log

    LogLevel debug

    CustomLog /var/log/apache2/access.log combined
</VirtualHost>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question