Helber
@Helber

Почему не удается создать виртуальный хост Apache2 Ubuntu?

Не удается зайти на сайт ни с ПК в локальной сети ни с непосредственно самого сервера :(

alx@Hell-Dell:/etc/apache2$ ls sites-available/
000-default.conf  default-ssl.conf  remload.conf


alx@Hell-Dell:/etc/apache2$ cat sites-available/remload.conf
<VirtualHost *:80>
    ServerName remload
    ServerAdmin webmaster@localhost

    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>


alx@Hell-Dell:/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. На сервере страница открылась(надо было добавить Directory для данной папки в /etc/apache2/apache2.conf)

Следующей проблемой является доступ на страницу с удаленной машины.
По адресу http://[local_ip]/remload мне выпадает 404

Жду ваших предположений и советов, коллеги!
  • Вопрос задан
  • 430 просмотров
Пригласить эксперта
Ответы на вопрос 1
goodwin332
@goodwin332
Начиная с apache2.4 для доступа к виртуальному хосту следует добавить Require all granted в Directory

Что бы было

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


<VirtualHost *:80>
    ServerName localhost
    ServerAdmin webmaster@localhost

    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>
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы