Apache2 param aleatoriamente de funcionar, erro 403

1

Acabei de instalar um servidor Ubuntu pessoal onde estou trabalhando, para testar nossos sites php. Este é um 12.04 LTS atualizado com LAMP e Samba instalado. Eu o configurei para trabalhar com o diretório / home / administrateur / www como o diretório padrão do DocumentRoot.

Eu fiz isso: Adicionado o usuário www-data no grupo administrateur, de forma recursiva deu permissões ug + rwx em admin /.

Mudei a raiz padrão para / home / administrateur / www em / etc / apache2 / sites-available / default

Até agora, tudo está ok ... mas o apache reinicia a cada dia, uma ou mais vezes, e então, eu não consigo acessar sites e receber o erro 403. A pasta www /, que geralmente está disponível em nossa rede local, não está mais acessível. Mas quando me conecto ao servidor com putty, tudo está bem novamente. Isso é muito estranho.

Meu log de erros é assim para este momento:

PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ming.ini on line 1 in Unknown on line 0
[Sun Mar 02 06:51:47 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.9 with Suhosin-Patch configured -- resuming normal operations
[Mon Mar 03 09:10:45 2014] [crit] [client 192.168.30.15] (13)Permission denied: /home/administrateur/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Mon Mar 03 09:10:45 2014] [crit] [client 192.168.30.15] (13)Permission denied: /home/administrateur/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Mon Mar 03 09:10:45 2014] [crit] [client 192.168.30.15] (13)Permission denied: /home/administrateur/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Mon Mar 03 09:47:55 2014] [error] [client 192.168.30.15] File does not exist: /home/administrateur/www/favicon.ico
[Mon Mar 03 09:47:55 2014] [error] [client 192.168.30.15] File does not exist: /home/administrateur/www/favicon.ico
[Mon Mar 03 09:50:51 2014] [notice] Graceful restart requested, doing restart
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ming.ini on line 1 in Unknown on line 0
[Mon Mar 03 09:50:52 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.9 with Suhosin-Patch configured -- resuming normal operations
[Mon Mar 03 09:52:09 2014] [error] [client 192.168.30.15] File does not exist: /home/administrateur/www/atd13/wp-content/themes/atd13/img/slideshare-logo-24.png, referer: http://test.atd13.nm/
[Mon Mar 03 09:52:09 2014] [error] [client 192.168.30.15] File does not exist: /home/administrateur/www/atd13/wp-content/themes/atd13/img/twitter-logo-24.png, referer: http://test.atd13.nm/
[Mon Mar 03 09:52:09 2014] [error] [client 192.168.30.15] File does not exist: /home/administrateur/www/atd13/wp-content/themes/atd13/img/fb-logo-24.png, referer: http://test.atd13.nm/
[Mon Mar 03 09:53:00 2014] [error] [client 192.168.30.15] File does not exist: /home/administrateur/www/atd13/wp-content/themes/atd13/img/fb-logo-24.png, referer: http://test.atd13.nm/
[Mon Mar 03 09:53:00 2014] [error] [client 192.168.30.15] File does not exist: /home/administrateur/www/atd13/wp-content/themes/atd13/img/twitter-logo-24.png, referer: http://test.atd13.nm/
[Mon Mar 03 09:53:00 2014] [error] [client 192.168.30.15] File does not exist: /home/administrateur/www/atd13/wp-content/themes/atd13/img/slideshare-logo-24.png, referer: http://test.atd13.nm/
[Mon Mar 03 09:53:42 2014] [error] [client 192.168.30.15] File does not exist: /home/administrateur/www/atd13/wp-content/themes/atd13/img/fb-logo-24.png, referer: http://test.atd13.nm/
[Mon Mar 03 09:53:42 2014] [error] [client 192.168.30.15] File does not exist: /home/administrateur/www/atd13/wp-content/themes/atd13/img/twitter-logo-24.png, referer: http://test.atd13.nm/
[Mon Mar 03 09:53:42 2014] [error] [client 192.168.30.15] File does not exist: /home/administrateur/www/atd13/wp-content/themes/atd13/img/slideshare-logo-24.png, referer: http://test.atd13.nm/
[Mon Mar 03 11:48:39 2014] [error] [client 192.168.30.51] Erreur de la base de donn\xc3\xa9es WordPress You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use nea$
[Mon Mar 03 11:48:46 2014] [error] [client 192.168.30.51] Erreur de la base de donn\xc3\xa9es WordPress You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use nea$
[Mon Mar 03 11:49:03 2014] [error] [client 192.168.30.51] Erreur de la base de donn\xc3\xa9es WordPress You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use nea$
[Mon Mar 03 16:39:10 2014] [error] [client 192.168.30.15] File does not exist: /home/administrateur/www/censier/favicon.ico
[Mon Mar 03 16:39:10 2014] [error] [client 192.168.30.15] File does not exist: /home/administrateur/www/censier/favicon.ico
[Tue Mar 04 06:34:26 2014] [notice] Graceful restart requested, doing restart
Warning: DocumentRoot [/home/administrateur/www] does not exist
Warning: DocumentRoot [/home/administrateur/www/adrexo] does not exist
Warning: DocumentRoot [/home/administrateur/www/atd13] does not exist
Warning: DocumentRoot [/home/administrateur/www/adrexo-blog] does not exist
Warning: DocumentRoot [/home/administrateur/www/censier] does not exist
Warning: DocumentRoot [/home/administrateur/www/friendship] does not exist
Warning: DocumentRoot [/home/administrateur/www/nouvelle-marque] does not exist
Warning: DocumentRoot [/home/administrateur/www/philanthropie] does not exist
Warning: DocumentRoot [/home/administrateur/www/wordpress] does not exist
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ming.ini on line 1 in Unknown on line 0
[Tue Mar 04 06:34:26 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.10 with Suhosin-Patch configured -- resuming normal operations
[Tue Mar 04 09:10:09 2014] [crit] [client 192.168.30.15] (13)Permission denied: /home/administrateur/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Tue Mar 04 09:10:09 2014] [crit] [client 192.168.30.15] (13)Permission denied: /home/administrateur/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Tue Mar 04 09:10:09 2014] [crit] [client 192.168.30.15] (13)Permission denied: /home/administrateur/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

Aqui está meu / etc / apache2 / sites-available / default


        ServerAdmin [email protected]

DocumentRoot /home/administrateur/www
        
                Options FollowSymLinks
                AllowOverride All
        
        
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from All
        

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

        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

    Alias /doc/ "/usr/share/doc/"
    
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    


e aqui, meu apache2.conf

#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
#     which responds to requests that aren't handled by a virtual host.
#     These directives also provide default values for the settings
#     of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
#     different IP addresses or hostnames and have them handled by the
#     same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "foo.log"
# with ServerRoot set to "/etc/apache2" will be interpreted by the
# server as "/etc/apache2/foo.log".
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at );
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
LockFile ${APACHE_LOCK_DIR}/accept.lock

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5

##
## Server-Pool Size Regulation (MPM specific)
## 

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves

    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0


# worker MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
#              graceful restart. ThreadLimit can only be changed by stopping
#              and starting Apache.
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves

    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0


# event MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves

    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0


# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#

    Order allow,deny
    Deny from all
    Satisfy all


#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
# It is also possible to omit any default MIME type and let the
# client's browser guess an appropriate action instead. Typically the
# browser will decide based on the file's extension then. In cases
# where no good assumption can be made, letting the default MIME type
# unset is suggested  instead of forcing the browser to accept
# incorrect  metadata.
#
DefaultType None


#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a 
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a 
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf

# Include all the user configurations:
Include httpd.conf

# Include ports listing
Include ports.conf

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
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

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
Include conf.d/

# Include the virtual host configurations:
Include sites-enabled/

# mod rewrite

        RewriteEngine On

e um ls-lah / home / administrateur / www / me dá:

drwxrwx--- 21 administrateur administrateur 4,0K févr. 26 14:00 .
drwxrwx---  6 administrateur administrateur 4,0K mars   4 10:08 ..
drwxrwx---  7 administrateur administrateur 4,0K févr. 26 14:02 adrexo
drwxrwx---  6 administrateur administrateur 4,0K févr. 25 17:14 adrexo-blog
drwxrwx---  6 administrateur administrateur 4,0K févr. 26 13:58 adrexo-blog-corpo
drwxrwx---  5 administrateur administrateur 4,0K févr. 19 16:10 adrexo-blog_save
drwxrwx---  5 administrateur administrateur 4,0K févr. 19 16:10 adrexo_save
drwxrwx---  5 administrateur administrateur 4,0K mars   3 10:10 atd13
drwxrwx---  5 administrateur administrateur 4,0K mars   3 16:39 censier
drwxrwx---  5 administrateur administrateur 4,0K févr. 19 16:25 censier_test
drwxrwx---  5 administrateur administrateur 4,0K févr. 19 16:10 croix-rouge
drwxrwx---  6 administrateur administrateur 4,0K févr. 20 19:11 friendship
-rwxrwx---  1 administrateur administrateur   19 févr. 24 16:48 index.php
drwxrwx---  5 administrateur administrateur 4,0K août   9  2011 nouvellemarque
drwxrwx---  5 administrateur administrateur 4,0K févr. 18 18:47 nouvelle-marque
drwxrwx---  5 administrateur administrateur 4,0K févr. 24 17:24 philanthropie
drwxrwx---  5 administrateur administrateur 4,0K févr. 19 16:32 philanthropie_
drwxrwx--- 23 administrateur administrateur  12K mai   30  2013 prestashop
drwxrwx---  5 administrateur administrateur 4,0K févr. 19 16:12 sandbox
drwxrwx---  5 administrateur administrateur 4,0K août   9  2011 surlepont
drwxrwx---  2 administrateur administrateur 4,0K févr. 18 15:38 vhosts ne pas effacer
drwxrwx---  5 administrateur administrateur 4,0K févr. 24 17:44 wordpress

Obrigado por ajudar

    
por Neovea 04.03.2014 / 09:37

2 respostas

3

Ele soa como você pode ter escolhido criptografar seu diretório pessoal ao configurar o Ubuntu.

Se este for o caso, o seu diretório pessoal se tornará acessível somente depois que você efetuar login na máquina e, após o logout, ele deixará de ser acessível logo em seguida.

Esta não é uma configuração apropriada para um diretório do qual os arquivos devem ser exibidos a qualquer momento; você deve criptografar todo o disco rígido , com uma senha de inicialização. (Observe que isso não estava disponível em 12.04 LTS e só ficou disponível em 12.10.)

Para reverter isso , tente ecryptfs-setup-private --undo , que dará a você o processo de desfazer um diretório pessoal criptografado.

    
por 04.03.2014 / 11:46
1

A entrada de log apresenta um erro crítico e a solução:

Permission denied: /home/administrateur/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

Isso parece com permissões incorretas em um arquivo .htaccess real ou permissões insuficientes para o apache em seu diretório inicial para executar uma listagem de diretórios para verificar se esse arquivo existe.

Eu acho que você não quer o apache procurando por um arquivo htaccess, mas o motivo pelo qual o apache verifica a existência de um arquivo htaccess em seu diretório home também e não apenas no subdiretório www é estranho, talvez porque sua especificação DocumentRoot?

DocumentRoot /home/administrateur/www

deve ser

DocumentRoot "/home/administrateur/www"
    
por 04.03.2014 / 10:39

Tags