B
B
beckvlz2015-08-17 21:06:24
Apache HTTP Server
beckvlz, 2015-08-17 21:06:24

What causes the error (13)Permission denied: Couldn't read /var/www/SERVERUSER/.htaccess, closing connection or Yandex Bot tricks?

Periodically, a strange Yandex Bot visits sites hosted on a certain server and the following errors appear in the logs:
[warn] [client 5.255.253.36] (13)Permission denied: Couldn't read /var/www/SERVERUSER/.htaccess, closing connection.
But the root of the site has a path: /var/www/SERVERUSER/data/www/SITE.RU
There are no such errors on other servers with other sites, so the thought arose that the problem was in Apache on this server. What would your friends recommend? Where to dig? Why does the request for .htaccess go to the parent folder of the SERVERUSER user, and not the site (there is .htaccess in the root folder of the site)?
Config:

<Directory /var/www/*>
  Options +Includes -FollowSymLinks +SymLinksIfOwnerMatch
  AllowOverride FileInfo AuthConfig Limit Indexes Options=All,MultiViews
  Order allow,deny
  Allow from all
</Directory>

<Directory /var/www/*/data/www/*/cgi-bin>
  Options -Indexes
</Directory>

<IfModule php5_module>
  php_admin_value open_basedir "."
</IfModule>
<IfModule php4_module>
  php_admin_value open_basedir "."
</IfModule>

Action php-cgi /php-bin/php

<VirtualHost *:80>
  ServerAdmin [email protected]

  DocumentRoot /var/www
  <Directory />
    Options FollowSymLinks
    AllowOverride None
  </Directory>
  <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
  </Directory>

  ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  <Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
  </Directory>

  ErrorLog ${APACHE_LOG_DIR}/error.log

  # Possible values include: debug, info, notice, warn, error, crit,
  # alert, emerg.
  LogLevel warn

  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<Directory /var/www/SERVERUSER1/data/www/SITE1.ru>
  Options -ExecCGI -Includes
</Directory>
<VirtualHost SERVERIP:80 >
  ServerName SITE1.ru
  AssignUserID SERVERUSER1 SERVERUSER1
  CustomLog /var/www/httpd-logs/SITE1.ru.access.log combined
  DocumentRoot /var/www/SERVERUSER1/data/www/SITE1.ru
  ErrorLog /var/www/httpd-logs/SITE1.ru.error.log
  ServerAdmin [email protected]
  ServerAlias www.SITE1.ru
</VirtualHost>
<VirtualHost SERVERIP:80 >
  ServerName SITE2.ru
  AddDefaultCharset UTF-8
  AssignUserID SERVERUSER2 SERVERUSER2
  CustomLog /var/www/httpd-logs/SITE2.ru.access.log combined
  DocumentRoot /var/www/SERVERUSER2/data/www/SITE2.ru
  ErrorLog /var/www/httpd-logs/SITE2.ru.error.log
  ServerAdmin [email protected]
  ServerAlias www.SITE2.ru
  AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
  AddType application/x-httpd-php-source .phps
  php_admin_value open_basedir "/var/www/SERVERUSER2/data:."
  php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f [email protected]"
  php_admin_value upload_tmp_dir "/var/www/SERVERUSER2/data/mod-tmp"
  php_admin_value session.save_path "/var/www/SERVERUSER2/data/mod-tmp"
</VirtualHost>
<VirtualHost SERVERIP:443 >
  SSLCertificateFile /var/www/httpd-cert/SERVERUSER2/SITE2.ru.crt
  SSLCertificateKeyFile /var/www/httpd-cert/SERVERUSER2/SITE2.ru.key
  SSLEngine on
  ServerName SITE2.ru
  AddDefaultCharset UTF-8
  AssignUserID SERVERUSER2 SERVERUSER2
  CustomLog /var/www/httpd-logs/SITE2.ru.access.log combined
  DocumentRoot /var/www/SERVERUSER2/data/www/SITE2.ru
  ErrorLog /var/www/httpd-logs/SITE2.ru.error.log
  ServerAdmin [email protected]
  ServerAlias www.SITE2.ru
  AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
  AddType application/x-httpd-php-source .phps
  php_admin_value open_basedir "/var/www/SERVERUSER2/data:."
  php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f [email protected]"
  php_admin_value upload_tmp_dir "/var/www/SERVERUSER2/data/mod-tmp"
  php_admin_value session.save_path "/var/www/SERVERUSER2/data/mod-tmp"
</VirtualHost>
<Directory /var/www/*/data/>
  php_admin_flag engine off
</Directory>
<Directory /var/www/SERVERUSER2/data/www/SITE2.ru>
  Options -ExecCGI -Includes
  php_admin_value open_basedir "/var/www/SERVERUSER2/data:."
  php_admin_flag engine on
</Directory>

NameVirtualHost *:443
NameVirtualHost SERVERIP:80
NameVirtualHost SERVERIP:443
<VirtualHost _default_:443>
  ServerName www.example.com:443
  SSLEngine on
  SSLCertificateFile /etc/apache2/ssl.crt/server.crt
  SSLCertificateKeyFile /etc/apache2/ssl.key/server.key
</VirtualHost>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question