0

Я использую сервер Apache на Ubuntu 14.04. Чтобы перенаправить все запросы с mypage.com на mypage.com:8080/myapp, я использую mod_proxy. Мой 000-default.conf выглядит следующим образом:503 обслуживание недоступно. Apache падает один раз в 7-10 дней

<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] 
    DocumentRoot /var/www/html 

    # 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 
    ProxyPass/http://mypage.com:8080/myapp/ retry=0 timeout=10 
    ProxyPassReverse/http://mypage.com:8080/myapp/ 

    ServerName mypage.com 

    # 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> 

И это мой ports.conf

# If you just change the port or add more ports here, you will likely also 
# have to change the VirtualHost statement in 
# /etc/apache2/sites-enabled/000-default.conf 

Listen 80 
Listen 81 

<IfModule ssl_module> 
    Listen 443 
</IfModule> 

<IfModule mod_gnutls.c> 
    Listen 443 
</IfModule> 

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

И все отлично работает до тех пор, в течение нескольких дней, я всегда получаю 503 Service Unavailable страницу ошибки. 503 и это написано в error.log до возникновения ошибки

[Sun Oct 25 21:22:27.779422 2015] [core:error] [pid 14595] [client 38.104.233.252:45239] AH00126: Invalid URI in request GET HTTP/1.1 HTTP/1.1 
[Mon Oct 26 02:30:20.925532 2015] [core:error] [pid 15416] [client 190.252.95.102:53508] AH00126: Invalid URI in request GET: index.php HTTP/1.0 
[Mon Oct 26 08:22:27.771751 2015] [proxy:error] [pid 15402] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.1.1:8080 (mypage.com) failed 
[Mon Oct 26 08:22:27.774040 2015] [proxy:error] [pid 15402] AH00959: ap_proxy_connect_backend disabling worker for (mypage.com) for 0s 
[Mon Oct 26 08:22:27.774111 2015] [proxy_http:error] [pid 15402] [client 5.28.160.27:48692] AH01114: HTTP: failed to make connection to backend: mypage.com 
[Mon Oct 26 10:55:51.655213 2015] [proxy:error] [pid 15406] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.1.1:8080 (mypage.com) failed 
[Mon Oct 26 10:55:51.655422 2015] [proxy:error] [pid 15406] AH00959: ap_proxy_connect_backend disabling worker for (mypage.com) for 0s 
[Mon Oct 26 10:55:51.655470 2015] [proxy_http:error] [pid 15406] [client 169.57.5.20:60000] AH01114: HTTP: failed to make connection to backend: mypage.com 
[Mon Oct 26 13:32:00.442031 2015] [proxy:error] [pid 15408] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.1.1:8080 (mypage.com) failed 
[Mon Oct 26 13:32:00.442356 2015] [proxy:error] [pid 15408] AH00959: ap_proxy_connect_backend disabling worker for (mypage.com) for 0s 
[Mon Oct 26 13:32:00.442413 2015] [proxy_http:error] [pid 15408] [client 217.168.189.15:50222] AH01114: HTTP: failed to make connection to backend: mypage.com, referer: http://mypage.com/admn 
[Mon Oct 26 13:32:12.245050 2015] [proxy:error] [pid 15402] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.1.1:8080 (mypage.com) failed 
[Mon Oct 26 13:32:12.245179 2015] [proxy:error] [pid 15402] AH00959: ap_proxy_connect_backend disabling worker for (mypage.com) for 0s 
[Mon Oct 26 13:32:12.245190 2015] [proxy_http:error] [pid 15402] [client 217.168.189.15:50225] AH01114: HTTP: failed to make connection to backend: mypage.com, referer: http://mypage.com/admn 
[Mon Oct 26 13:34:44.343614 2015] [mpm_prefork:notice] [pid 991] AH00169: caught SIGTERM, shutting down 
[Mon Oct 26 13:36:07.703185 2015] [mpm_prefork:notice] [pid 991] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.11 configured -- resuming normal operations 
[Mon Oct 26 13:36:07.708761 2015] [core:notice] [pid 991] AH00094: Command line: '/usr/sbin/apache2' 
[Tue Oct 27 01:20:23.236327 2015] [mpm_prefork:notice] [pid 991] AH00169: caught SIGTERM, shutting down 
[Tue Oct 27 01:20:24.265160 2015] [mpm_prefork:notice] [pid 3247] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.11 configured -- resuming normal operations 
[Tue Oct 27 01:20:24.265243 2015] [core:notice] [pid 3247] AH00094: Command line: '/usr/sbin/apache2' 
[Tue Oct 27 01:41:17.177723 2015] [mpm_prefork:notice] [pid 3247] AH00169: caught SIGTERM, shutting down 
[Tue Oct 27 01:41:18.219244 2015] [mpm_prefork:notice] [pid 11636] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.11 configured -- resuming normal operations 
[Tue Oct 27 01:41:18.219351 2015] [core:notice] [pid 11636] AH00094: Command line: '/usr/sbin/apache2' 

После того как я перезагрузить свою машину она отлично работает снова. Затем через 7-10 дней он снова падает. Пробовал много вещей в Интернете, но всегда получал эту ошибку максимум через несколько недель. Борясь с уже в течение нескольких месяцев. SELinux отключен.

ответ

2

Проблема не с Apache, потому что его до сих пор отбывает 503 страницы

Проблемы с приложением, запущенными на номере порта 8080, вы обратное проксирование / к http://mypage.com:8080/myapp/ и когда Apache пытается прокси по просьбе его не возвращая ответ от приложения 8080 и, таким образом, он забрасывает сообщение «Сервис недоступен». Его вывод из базовой части журнала.

[Mon Oct 26 13:32:00.442031 2015] [proxy:error] [pid 15408] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.1.1:8080 (mypage.com) failed 
[Mon Oct 26 13:32:00.442356 2015] [proxy:error] [pid 15408] AH00959: ap_proxy_connect_backend disabling worker for (mypage.com) for 0s 
[Mon Oct 26 13:32:00.442413 2015] [proxy_http:error] [pid 15408] [client 217.168.189.15:50222] AH01114: HTTP: failed to make connection to backend: mypage.com, referer: http://mypage.com/admn 
[Mon Oct 26 13:32:12.245050 2015] [proxy:error] [pid 15402] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.1.1:8080 (mypage.com) failed 

Так проверьте и пост (если необходимо) журналы сервера, работающие на номер порта 8080

+1

Спасибо за ваш response.On 8080 работает сервер Tomcat Java развертывается application.Which лог-файл я должен проверить ? Есть что-то подозрительное в catalina.out '25 октября 2015 г. 7:49:23 org.apache.catalina.realm.LockOutRealm authenticate ВНИМАНИЕ: Была сделана попытка аутентифицировать заблокированного пользователя« admin » окт. 25, 2015 7:49:24 org.apache.catalina.realm.LockOutRealm authenticate ВНИМАНИЕ: Была предпринята попытка аутентификации заблокированного пользователя «admin» ' Не знаю, имеет ли это какое-либо отношение к моей проблеме. Также, что вы думаете, о том, что в основном он работает нормально, пока он не падает после ca в неделю. – FarizHuseynli

+0

выглядит так, как будто кто-то пытается использовать brutforce в приложении, проверьте эту тему http://stackoverflow.com/questions/15337296/how -to-fix-tomcat-warning-a-try-was-made-to-authenticate-the-locked-user – Shiva

+0

Как вы думаете, из-за этого может произойти ошибка 503? – FarizHuseynli

Смежные вопросы