Martovitskiy
@Martovitskiy

Как правильно настроить apache Sentos7?

Стоит Centos7, коннект по ssh, установил apache 2.4.
В var/www/html доступа нет, залил сайт в отдельную папку. при попытке достучаться, ошибка : Forbidden
You don't have permission to access

Файл etc/httpd/conf/httpd.conf
код


ServerRoot "/etc/httpd"
Listen 80

Include conf.modules.d/*.conf

ServerRoot "/etc/httpd"

#Listen 12.34.56.78:80
Listen 80

Include conf.modules.d/*.conf
User apache
Group apache

# 'Main' server configuration
#
ServerAdmin root@localhost

<Directory />
    AllowOverride none
    Require all denied
    Require all granted
</Directory>

DocumentRoot "/home/ha261287mev1/vipoc"

<Directory "/home/ha261287mev1">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

# Further relax access to the default document root:
<Directory "/home/ha261287mev1/vipoc">
    Options Indexes FollowSymLinks
    DirectoryIndex main.php
    AllowOverride None
    Require all granted
</Directory>
<VirtualHost *:80>
        ServerName www.vipoc.com
        DocumentRoot /home/ha261287mev1/vipoc
        ServerAlias vipoc.com
        ErrorLog /home/ha261287mev1/vipoc/error.log
        CustomLog /home/ha261287mev1/vipoc/requests.log combined
</VirtualHost>
#
<IfModule dir_module>
    DirectoryIndex index.php
</IfModule>
#
#
<Files ".ht*">
    Require all denied
</Files>

ErrorLog "logs/error_log"

#
LogLevel warn

<IfModule log_config_module>
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>
    CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule mime_module>
    TypesConfig /etc/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</IfModule>
AddDefaultCharset UTF-8

<IfModule mime_magic_module>
    #
    # The mod_mime_magic module allows the server to use various hints from the
    # contents of the file itself to determine its type.  The MIMEMagicFile
    # directive tells the module where the hint definitions are located.
    #
    MIMEMagicFile conf/magic
</IfModule>

#
# Load config files in the "/etc/httpd/conf.d" directory, if any.
IncludeOptional conf.d/*.conf

  • Вопрос задан
  • 84 просмотра
Пригласить эксперта
Ответы на вопрос 1
SignFinder
@SignFinder
Wintel\Unix Engineer\DevOps
1. В linux нет папок, там директории.
2. Права на директорию для пользователя от которого apache запускается какие?
3. В var/log/httpd есть логи, в том числе и лог ошибок-там можно посмотреть-в чем проблема.
Ответ написан
Комментировать
Ваш ответ на вопрос

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

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