Skocz do zawartości
Fese

Problem z .htaccess na VPS

Polecane posty

Mam problem tego typu, że nie dziala mi plik .htaccess

Co może być powodem problemu? Po wejściu na stronę nic się nie dzieje.

 

Wykonalem następujące polecenia:

sudo nano /etc/apache2/sites-available/default
Pierwsze dwa "AllowOverride None" Zmieniamy na "AllowOverride All"
sudo /etc/init.d/apache2 restart
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

Mój plik .htaccess (chdmod 644) wygląda tak:

AuthType Basic
AuthName "Galeria zdjec"
AuthUserFile /var/www/.htpasswd
require valid-user

Hasło ustanawiam tak:

htpasswd -c /var/www/.htpasswd janek
Edytowano przez Fese (zobacz historię edycji)

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

Pokaż cały plik z virtualhostem oraz główny config apache

Masz tam dyrektywę:

AccessFileName .htaccess

?

Logi mówią coś o jakimś błędzie z tym związanym?

Edytowano przez HaPe (zobacz historię edycji)

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

Zrobiłem restart serwera i a2enmod rewrite is enabled.

 

/etc/apache2/sites-available/default

    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        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

    Alias /doc/ "/usr/share/doc/"
    <Directory "/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
    </Directory>
Directives

For *:80ServerAdmin webmaster@localhost                   /etc/apache2/sites-available/default (2)
DocumentRoot /var/www                             /etc/apache2/sites-available/default (4)
<Directory />
 Options FollowSymLinks                           /etc/apache2/sites-available/default (6)
 AllowOverride All                                /etc/apache2/sites-available/default (7)
</Directory>
<Directory /var/www/>
 Options Indexes FollowSymLinks MultiViews       /etc/apache2/sites-available/default (10)
 AllowOverride All                               /etc/apache2/sites-available/default (11)
 Order allow,deny                                /etc/apache2/sites-available/default (12)
 allow from all                                  /etc/apache2/sites-available/default (13)
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/          /etc/apache2/sites-available/default (16)
<Directory "/usr/lib/cgi-bin">
 AllowOverride None                              /etc/apache2/sites-available/default (18)
 Options +ExecCGI -MultiViews +SymLinksIfOwn ..  /etc/apache2/sites-available/default (19)
 Order allow,deny                                /etc/apache2/sites-available/default (20)
 Allow from all                                  /etc/apache2/sites-available/default (21)
</Directory>
ErrorLog /var/log/apache2/error.log              /etc/apache2/sites-available/default (24)
LogLevel warn                                    /etc/apache2/sites-available/default (28)
CustomLog /var/log/apache2/access.log combin ..  /etc/apache2/sites-available/default (30)
Alias /doc/ "/usr/share/doc/"                    /etc/apache2/sites-available/default (32)
<Directory "/usr/share/doc/">
 Options Indexes MultiViews FollowSymLinks       /etc/apache2/sites-available/default (34)
 AllowOverride None                              /etc/apache2/sites-available/default (35)
 Order deny,allow                                /etc/apache2/sites-available/default (36)
 Deny from all                                   /etc/apache2/sites-available/default (37)
 Allow from 127.0.0.0/255.0.0.0 ::1/128          /etc/apache2/sites-available/default (38)
</Directory>

/var/log/apache2/error.log

[Sat Sep 13 01:55:57 2014] [alert] [client 64.246.161.190] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 01:55:58 2014] [alert] [client 64.246.161.190] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only"), referer: http://whois.domaintools.com/openjobs.ru
[Sat Sep 13 02:17:01 2014] [alert] [client 195.78.211.2] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 02:28:19 2014] [alert] [client 87.236.215.112] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 02:28:20 2014] [alert] [client 87.236.215.112] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 04:13:10 2014] [alert] [client 91.230.60.48] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 04:13:10 2014] [alert] [client 91.230.60.48] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 04:50:47 2014] [alert] [client 87.236.215.112] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 04:50:48 2014] [alert] [client 87.236.215.112] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 05:10:10 2014] [alert] [client 66.249.79.87] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 05:10:11 2014] [alert] [client 66.249.79.95] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 05:11:12 2014] [alert] [client 66.249.79.95] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 05:11:12 2014] [alert] [client 66.249.79.95] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 05:12:13 2014] [alert] [client 66.249.79.103] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 05:12:14 2014] [alert] [client 66.249.79.95] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 05:12:44 2014] [alert] [client 157.55.39.35] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 05:12:56 2014] [alert] [client 157.55.39.35] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 08:21:02 2014] [alert] [client 222.94.118.20] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only"), referer: http://hotel.qunar.com/
[Sat Sep 13 08:25:41 2014] [alert] [client 164.40.153.130] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 11:25:30 2014] [alert] [client 95.132.16.54] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 11:46:22 2014] [alert] [client 91.230.60.48] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 15:29:43 2014] [alert] [client 91.230.60.48] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 17:46:15 2014] [alert] [client 212.66.52.42] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only"), referer: http://www.baidu.com/
[Sat Sep 13 18:00:35 2014] [error] [client 98.150.111.21] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /
[Sat Sep 13 19:19:47 2014] [alert] [client 37.220.35.61] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 19:19:49 2014] [alert] [client 37.220.35.61] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 19:19:51 2014] [alert] [client 37.220.35.61] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 19:19:58 2014] [alert] [client 37.220.35.61] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 19:21:11 2014] [alert] [client 37.220.35.61] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 19:21:43 2014] [alert] [client 37.220.35.61] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 19:25:54 2014] [notice] caught SIGTERM, shutting down
[Sat Sep 13 19:25:55 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.13 with Suhosin-Patch configured -- resuming normal operations
[Sat Sep 13 19:26:11 2014] [notice] caught SIGTERM, shutting down
[Sat Sep 13 19:26:12 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.13 with Suhosin-Patch configured -- resuming normal operations
[Sat Sep 13 19:26:18 2014] [alert] [client 96.44.189.102] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 19:26:24 2014] [alert] [client 96.44.189.102] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 19:26:24 2014] [alert] [client 96.44.189.102] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 19:27:21 2014] [alert] [client 96.44.189.102] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 19:47:17 2014] [alert] [client 87.236.215.112] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 19:49:31 2014] [alert] [client 204.8.156.142] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 19:49:35 2014] [alert] [client 204.8.156.142] /var/www/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")
[Sat Sep 13 19:58:27 2014] [notice] caught SIGTERM, shutting down
[Sat Sep 13 19:58:35 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.13 with Suhosin-Patch configured -- resuming normal operations
[Sat Sep 13 20:17:32 2014] [notice] caught SIGTERM, shutting down
[Sat Sep 13 20:17:33 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.13 with Suhosin-Patch configured -- resuming normal operations
[Sat Sep 13 20:17:38 2014] [notice] caught SIGTERM, shutting down
[Sat Sep 13 20:17:39 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.13 with Suhosin-Patch configured -- resuming normal operations
[Sat Sep 13 21:05:44 2014] [notice] caught SIGTERM, shutting down
[Sat Sep 13 21:05:53 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.13 with Suhosin-Patch configured -- resuming normal operations

/var/log/apache2/access.log

176.10.100.228 - - [13/Sep/2014:20:17:45 +0000] "GET /wp-includes/js/jquery/jquery.js?ver=1.11.0 HTTP/1.1" 304 212 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
176.10.100.228 - - [13/Sep/2014:20:17:45 +0000] "GET /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1 HTTP/1.1" 304 211 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
176.10.100.228 - - [13/Sep/2014:20:17:47 +0000] "GET /wp-content/themes/twentytwelve/js/navigation.js?ver=20140318 HTTP/1.1" 304 209 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
37.59.114.24 - - [13/Sep/2014:20:39:36 +0000] "GET /?p=1 HTTP/1.1" 200 4116 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
37.59.114.24 - - [13/Sep/2014:20:39:39 +0000] "GET /wp-content/themes/twentytwelve/style.css?ver=3.9.2 HTTP/1.1" 304 211 "http://91.230.60.171/?p=1" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
37.59.114.24 - - [13/Sep/2014:20:39:39 +0000] "GET /wp-includes/js/jquery/jquery.js?ver=1.11.0 HTTP/1.1" 304 212 "http://91.230.60.171/?p=1" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
37.59.114.24 - - [13/Sep/2014:20:39:39 +0000] "GET /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1 HTTP/1.1" 304 211 "http://91.230.60.171/?p=1" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
37.59.114.24 - - [13/Sep/2014:20:39:40 +0000] "GET /wp-includes/js/comment-reply.min.js?ver=3.9.2 HTTP/1.1" 200 756 "http://91.230.60.171/?p=1" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
37.59.114.24 - - [13/Sep/2014:20:39:40 +0000] "GET /wp-content/themes/twentytwelve/js/navigation.js?ver=20140318 HTTP/1.1" 304 210 "http://91.230.60.171/?p=1" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:20:55:54 +0000] "GET / HTTP/1.1" 200 2828 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:20:55:57 +0000] "GET /wp-includes/js/jquery/jquery.js?ver=1.11.0 HTTP/1.1" 304 212 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:20:55:57 +0000] "GET /wp-content/themes/twentytwelve/style.css?ver=3.9.2 HTTP/1.1" 304 210 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:20:55:59 +0000] "GET /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1 HTTP/1.1" 304 210 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:20:56:01 +0000] "GET /wp-content/themes/twentytwelve/js/navigation.js?ver=20140318 HTTP/1.1" 304 209 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:21:00:42 +0000] "GET / HTTP/1.1" 200 2828 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:21:00:44 +0000] "GET /wp-content/themes/twentytwelve/style.css?ver=3.9.2 HTTP/1.1" 304 210 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:21:00:44 +0000] "GET /wp-includes/js/jquery/jquery.js?ver=1.11.0 HTTP/1.1" 304 212 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:21:00:44 +0000] "GET /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1 HTTP/1.1" 304 211 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:21:00:45 +0000] "GET /wp-content/themes/twentytwelve/js/navigation.js?ver=20140318 HTTP/1.1" 304 209 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:21:04:23 +0000] "GET / HTTP/1.1" 200 2828 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:21:04:26 +0000] "GET /wp-content/themes/twentytwelve/style.css?ver=3.9.2 HTTP/1.1" 304 210 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:21:04:26 +0000] "GET /wp-includes/js/jquery/jquery.js?ver=1.11.0 HTTP/1.1" 304 212 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:21:04:27 +0000] "GET /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1 HTTP/1.1" 304 210 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
217.98.1.39 - - [13/Sep/2014:21:04:28 +0000] "GET /wp-content/themes/twentytwelve/js/navigation.js?ver=20140318 HTTP/1.1" 304 209 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
5.226.116.14 - - [13/Sep/2014:21:11:55 +0000] "GET / HTTP/1.1" 200 2828 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
5.226.116.14 - - [13/Sep/2014:21:11:57 +0000] "GET /wp-content/themes/twentytwelve/style.css?ver=3.9.2 HTTP/1.1" 304 211 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
5.226.116.14 - - [13/Sep/2014:21:11:58 +0000] "GET /wp-includes/js/jquery/jquery.js?ver=1.11.0 HTTP/1.1" 304 211 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
5.226.116.14 - - [13/Sep/2014:21:11:59 +0000] "GET /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1 HTTP/1.1" 304 210 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
5.226.116.14 - - [13/Sep/2014:21:12:01 +0000] "GET /wp-content/themes/twentytwelve/js/navigation.js?ver=20140318 HTTP/1.1" 304 209 "http://91.230.60.171/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
127.0.0.1 - - [13/Sep/2014:21:12:06 +0000] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
127.0.0.1 - - [13/Sep/2014:21:12:07 +0000] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
127.0.0.1 - - [13/Sep/2014:21:12:08 +0000] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
127.0.0.1 - - [13/Sep/2014:21:12:09 +0000] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
127.0.0.1 - - [13/Sep/2014:21:12:10 +0000] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"

/etc/apache2/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 <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
# 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
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# 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
<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# 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
<IfModule mpm_event_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# 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.
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy all
</Files>

#
# 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 <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# 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/
Edytowano przez Fese (zobacz historię edycji)

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

Bądź aktywny! Zaloguj się lub utwórz konto

Tylko zarejestrowani użytkownicy mogą komentować zawartość tej strony

Utwórz konto

Zarejestruj nowe konto, to proste!

Zarejestruj nowe konto

Zaloguj się

Posiadasz własne konto? Użyj go!

Zaloguj się


×