Tag Archives: Apache

apache server-status w sending reply

ОС CentOS 6.7; Apache/2.2.15; nginx/1.13.5

Симтомы: Рост количество процессов httpd, при значении примерно в 2250 – сервер падает в 502 ошибку.

Смотрим:

lynx http://localhost/server-status

Инструмент: Apache Server Status Vizualization

Видим очень большие значения SS в статусе W Sending Reply.

Continue reading

Apache notes

Не запускается Apache 2.4 на Windows

Служба останавливается сразу после запуска.
В журнале событий могут быть такие строки

make_sock: could not bind to address 0.0.0.0:80
# или
AH00072: make_sock: could not bind to address 0.0.0.0:80

Суть: занят 80-ый порт.
Решение: Ищем того, кто занимает 80 порт и освобождаем его.
Варианты:
1. Skype. Отключить использование 80, 443 портов в настройках соединения.
Continue reading

Apache mod_rewrite

Все запросы на https

# All to https
RewriteEngine On 
RewriteCond %{HTTPS}  !=on 
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] 

Все запросы на index.php

#
RewriteBase /
RewriteRule ^index\.php$ - [L]
# исключения для существующих файлов и каталогов
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# 
RewriteRule ^ /index.php [L]

no-www to www

# Redirect to www
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Block GET requests to URL

RewriteCond %{REQUEST_METHOD} ^GET [NC]
RewriteCond %{REQUEST_URI} ^/search
RewriteRule .* - [F,L]