V
V
Vitaly2018-07-23 11:34:03
Apache HTTP Server
Vitaly, 2018-07-23 11:34:03

Error 403 Forbidden Ubuntu 18.04?

Good afternoon. I decided to switch from Windows to ubuntu, but I can’t beat apache, I used openserver on Windows and everything was fine, but here I ran into a problem.
I installed apache, mysql, php, phpmyadmin, everything seems to be set up and even everything took off (partially), I get 403 when I try to access the site, applied chmod 777 recursively to all files and folders, in total, if I view the properties of the directories, the rights to files and folders are correct , but this does not solve the problem of
my virtual host config

<VirtualHost *:80>
  # The ServerName directive sets the request scheme, hostname and port that
  # the server uses to identify itself. This is used when creating
  # redirection URLs. In the context of virtual hosts, the ServerName
  # specifies what hostname must appear in the request's Host: header to
  # match this virtual host. For the default virtual host (this file) this
  # value is not decisive as it is used as a last resort host regardless.
  # However, you must set it for any further virtual host explicitly.
  #ServerName www.example.com

  ServerAdmin [email protected]
  ServerName dmw.loc
  ServerAlias www.dmw.loc
  DocumentRoot /media/vitaliy/Server/domains/dmw.loc/trunk/docroot

  # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
  # error, crit, alert, emerg.
  # It is also possible to configure the loglevel for particular
  # modules, e.g.
  #LogLevel info ssl:warn

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined

  # For most configuration files from conf-available/, which are
  # enabled or disabled at a global level, it is possible to
  # include a line for only one particular virtual host. For example the
  # following line enables the CGI configuration for this host only
  # after it has been globally disabled with "a2disconf".
  #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

apache config
DefaultRuntimeDir ${APACHE_RUN_DIR}

PidFile ${APACHE_PID_FILE}

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 5

User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

HostnameLookups Off

ErrorLog ${APACHE_LOG_DIR}/error.log

LogLevel warn

IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

Include ports.conf


<Directory />
  Options FollowSymLinks
  AllowOverride None
  Require all denied
</Directory>

<Directory /usr/share>
  AllowOverride None
  Require all granted
</Directory>

<Directory /media/vitaliy/Server/domains/>
  Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
        Require all granted
  Require ip 127.0.0.1
  Require host localhost
</Directory>

AccessFileName .htaccess

<FilesMatch "^\.ht">
  Require all denied
</FilesMatch>


LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

IncludeOptional conf-enabled/*.conf

IncludeOptional sites-enabled/*.conf

Server access log
127.0.0.1 - - [23/Jul/2018:11:22:56 +0300] "GET /robots.txt HTTP/1.1" 403 509 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [23/Jul/2018:11:22:56 +0300] "GET /favicon.ico HTTP/1.1" 403 509 "http://dmw.loc/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [23/Jul/2018:11:36:02 +0300] "GET / HTTP/1.1" 403 499 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [23/Jul/2018:11:36:03 +0300] "GET /favicon.ico HTTP/1.1" 403 509 "http://dmw.loc/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [23/Jul/2018:11:36:03 +0300] "GET / HTTP/1.1" 403 498 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [23/Jul/2018:11:36:04 +0300] "GET /favicon.ico HTTP/1.1" 403 509 "http://dmw.loc/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [23/Jul/2018:11:36:04 +0300] "GET / HTTP/1.1" 403 498 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [23/Jul/2018:11:36:04 +0300] "GET /favicon.ico HTTP/1.1" 403 509 "http://dmw.loc/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [23/Jul/2018:11:36:54 +0300] "-" 408 0 "-" "-"
127.0.0.1 - - [23/Jul/2018:11:38:13 +0300] "GET / HTTP/1.1" 403 499 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [23/Jul/2018:11:38:13 +0300] "GET /favicon.ico HTTP/1.1" 403 509 "http://dmw.loc/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [23/Jul/2018:11:38:14 +0300] "GET / HTTP/1.1" 403 498 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [23/Jul/2018:11:38:14 +0300] "GET /favicon.ico HTTP/1.1" 403 509 "http://dmw.loc/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [23/Jul/2018:11:39:04 +0300] "-" 408 0 "-" "-"
127.0.0.1 - - [23/Jul/2018:11:40:28 +0300] "GET / HTTP/1.1" 403 499 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [23/Jul/2018:11:40:28 +0300] "GET /favicon.ico HTTP/1.1" 403 509 "http://dmw.loc/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CityCat4, 2018-07-23
@CityCat4

Access rules are not inherited :) If you need a virtualhost - why doesn't it have allow/deny rules? If virthost is not needed - why its config?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question