OVH - client denied by server configuration: - .htaccess

I take my Symfony project in my server, but I have one error. When i see on the errors on the server, I get it :
[Wed Dec 21 11:44:08 2016] [error] [client 92.140.212.141] [host www.triath-swim.fr] client denied by server configuration: /homez.594/triathswog/www/.htaccess, referer: http://www.triath-swim.fr/
[Wed Dec 21 11:44:08 2016] [error] [client 92.140.212.141] [host www.triath-swim.fr] client denied by server configuration: /homez.594/triathswog/www/.htaccess, referer: http://www.triath-swim.fr/
I don't understand.
My site web is : www.triath-swim.fr
in /.htaccess :
SetEnv SHORT_OPEN_TAGS 0
SetEnv REGISTER_GLOBALS 0
SetEnv MAGIC_QUOTES 0
SetEnv SESSION_AUTOSTART 0
SetEnv ZEND_OPTIMIZER 1
SetEnv PHP_VER_7_0
in www/.htacess :
SetEnv REGISTER_GLOBALS 0
SetEnv MAGIC_QUOTES 0
SetEnv ZEND_OPTIMIZER 1
SetEnv PHP_VER 7_0

Related

Intermittent Service not available Error in Elasticbeanstalk application

We are using a webserver with ElasticBeanstalk from 2019.,
the platform is
tomcat 8.5 with java8 running on 64 bit Amazon Linux. httpd as proxy
recently (from Jan 30th) we started getting Service Unavailable issues if go to the endpoint from time to time. and if we refresh 2-3 times it will get resolved on its own.
then I download full logs. under elasticbeanstalk-error_log I can see
[Mon Feb 28 10:00:58.338035 2022] [proxy:error] [pid 14882:tid 139757313533696] (13)Permission denied: AH02454: HTTP: attempt to connect to Unix domain socket /var/run/httpd/ (localhost) failed
[Mon Feb 28 10:00:58.338078 2022] [proxy_http:error] [pid 14882:tid 139757313533696] [client <private-ip-here>:12566] AH01114: HTTP: failed to make connection to backend: httpd-UDS, referer: http://<custom-end-point>/1/<name.jsp>?s=sec$$4P!&refresh=300
[Mon Feb 28 10:43:40.663468 2022] [proxy:error] [pid 14882:tid 139757120071424] (13)Permission denied: AH02454: HTTP: attempt to connect to Unix domain socket /var/run/httpd/ (localhost) failed
[Mon Feb 28 10:43:40.663518 2022] [proxy_http:error] [pid 14882:tid 139757120071424] [client <private-ip-here>:21136] AH01114: HTTP: failed to make connection to backend: httpd-UDS
repeated multiple times from Jan30th.
and when I look at access.log
I can see 503 error log exactly at the same time when permission denied error logs in elasticbeanstalk-error_log
And I looked at the running process using ps -aux | grep HTTPd and ps -aux | grep tomcat
both are running from 2019 and have no restarts.
what more I can do to troubleshoot these issuesWe are running a web application written in Java(tomcat8) hosted in AWS ElastcBeanStalk
Some weeks back we started getting 503 error randomly
When we checked the elasticbeanstalk-erorr_logs
[Thu Mar 03 13:22:12.906144 2022] [proxy:error] [pid 14882:tid 139757338711808] (13)Permission denied: AH02454: HTTP: attempt to connect to Unix domain socket /var/run/httpd/ (localhost) failed
[Thu Mar 03 13:22:12.906202 2022] [proxy_http:error] [pid 14882:tid 139757338711808] [client 172.31.17.0:61382] AH01114: HTTP: failed to make connection to backend: httpd-UDS, referer: http://our-domain.com/1/callBackLog.jsp
The error logs are suggesting connection error with backend unix socket
When we checked in /var/run/httpd/ folder, there were no unix sockets(.sock files)
But in apache httpd config
<VirtualHost *:80>
<Proxy *>
Require all granted
ProxyPass / http://localhost:8080/ retry=0
ProxyPassReverse / http://localhost:8080/
ProxyPreserveHost on
ErrorLog /var/log/httpd/elasticbeanstalk-error_log
the proxy backend is ip address not unix socket
As per the config httpd should connect to backend ip address(localhost:8080) but why is it complaining about unix socket
Have anyone faced similar issues?
============= UPDATE
The error logs are suggesting connection error with backend unix socket
When we checked in /var/run/httpd/ folder, there were no unix sockets(.sock files)
But in apache httpd config
<VirtualHost *:80>
<Proxy *>
Require all granted
ProxyPass / http://localhost:8080/ retry=0
ProxyPassReverse / http://localhost:8080/
ProxyPreserveHost on
ErrorLog /var/log/httpd/elasticbeanstalk-error_log
the proxy backend is ip address not unix socket
As per the config httpd should connect to backend ip address(localhost:8080) but why is it complaining about unix socket
Have anyone faced similar issues?

Linux/Debian Apache2 mod_rewrite internal error

i have some problems to setup my mod_rewrite for my Joomla-Site.
Im using Apache 2.2.22 on Debian.
Website is on Directory: /home/web/beta/
What i did:
1) Commands:
sudo a2enmod rewrite
sudo mkdir -p /var/run/apache2
sudo chown -R www-data /var/run/apache2
sudo a2enmod actions
sudo /etc/init.d/apache2 force-reload
2) Then i setup following file: /etc/apache2/sites-enabled/000-default
<Directory /home/web/>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo
3) The htaccess file at path /home/web/beta/.htaccess i set:
RewriteEngine On
(I took the .htaccess from this site: http://www.joomla-security.de/downloads.html)
Ok, now the Problem.
As long as i set the AllowOverride to FileInfo i get following error message:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, webmaster#localhost and
inform them of the time the error occurred, and anything you might
have done that may have caused the error.
More information about this error may be available in the server error
log. Apache/2.2.22 (Debian) Server at XXXXXXX.com Port 80
What i did wrong?
Can you help me please?
EDIT: Error Log:
[Wed Nov 11 19:21:56 2015] [notice] caught SIGTERM, shutting down
[Wed Nov 11 19:21:57 2015] [notice] Apache/2.2.22 (Debian) PHP/5.4.45-0+deb7u2 configured -- resuming normal operations
[Wed Nov 11 19:21:57 2015] [alert] [client XX.XX.XX.198] /home/web/beta/.htaccess: Options not allowed here
[Wed Nov 11 19:21:58 2015] [alert] [client XX.XX.XX.198] /home/web/beta/.htaccess: Options not allowed here
[Wed Nov 11 19:21:59 2015] [alert] [client XX.XX.XX.144] /home/web/beta/.htaccess: Options not allowed here
It seems, from the errors you've posted, that you are trying to use the Options directive in .htaccess. To do that, you need to add Options to the AllowOverride directive in 000-default (cf. https://httpd.apache.org/docs/2.2/mod/core.html#options).
So change:
AllowOverride FileInfo
to
AllowOverride FileInfo Options
in 000-default.
Edit:
And if the above doesn't work, try changing it to:
AllowOverride All
And if that doesn't work then it could mean that other configuration files are getting loaded after 000-default and overwrite some of the directives.

Apache mod_wl2.4 plugin error parseJVMID

I have some issues with setting an clustered environment for weblogic and Apache. The structure is like this: 1 webserver that proxies requests to a clustered environment of 3 weblogic servers.
Everytime i send the request to the apache server , the request gets unhandled. I figured out a part of the problem , but that is something that is not intended in production. whenever i add DynamicServerList On the requests fail. When i switch it to off it works, but that means whenever a server fails , apache will still send requests to that server and user experience would be 0.
EDIT 1: I am using weblogic 12c and apache2.4 for Centos 7
EDIT 2: There is no firewall nor selinux active
Here is my config file for weblogic plugin:
<VirtualHost *:8080>
ServerAdmin postmaster#webserver2
ServerName webserver2
DocumentRoot /var/www/webserver2/htdocs
ErrorLog /var/log/httpd//webserver-error_log
CustomLog /var/log/httpd/webserver-access_log forwarded
<Directory />
AllowOverride all
Order allow,deny
Allow from all
</Directory>
DirectoryIndex index.html
<Location />
SetHandler weblogic-handler
</Location>
<IfModule mod_weblogic.c>
WeblogicCluster 192.168.166.70:8001,192.168.166.71:8001,192.168.166.69:8001
ConnectTimeoutSecs 15
ConnectRetrySecs 10
WLIOTimeoutSecs 600
DynamicServerList ON
Idempotent ON
FileCaching ON
KeepAliveSecs 60
KeepAliveEnabled ON
DebugConfigInfo ON
</IfModule>
</VirtualHost>
And the errors I get are the following:
[Mon Sep 14 09:54:58.480616 2015] [weblogic:error] [pid 15343:tid
140547949991680] [client 172.18.132.50:57991] <1534314422136982>
parseJVMID: could not resolve hostname '-1062689209'. Returning NULL
from parseJVMID
[Mon Sep 14 09:54:58.480681 2015] [weblogic:error]
[pid 15343:tid 140547949991680] [client 172.18.132.50:57991]
<1534314422136982> initJVMID: parseClusterServerList failure
[Mon Sep
14 09:55:28.481215 2015] [weblogic:error] [pid 15343:tid
140547949991680] [client 172.18.132.50:57991] <1534314422136982>
request [/clusterjsp/HaJsp.jsp] did NOT process
successfully..................

wsgi startup - why two identical processes?

I have the following config:
virtualhost:
<VirtualHost *:80>
ServerAdmin rok#localhost
ServerName lh.test.com
WSGIScriptAlias / /home/user/myapp/src/wsgi.py application-group='%{GLOBAL}' process-group='%{GLOBAL}'
WSGIDaemonProcess lh.test.com processes=1 threads=1 display-name=%{GROUP}
<Directory /home/user/myapp/src>
<Files wsgi.py>
Order deny,allow
Require all granted
</Files>
Options All
AllowOverride All
Require all granted
</Directory>
Alias /static /home/user/myapp/src/static
ErrorLog /var/log/apache2/lh.test.com-error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel debug
CustomLog /var/log/apache2/lh.test.com-access.log combined
</VirtualHost>
wsgi.py:
from __future__ import unicode_literals
import os, signal, sys
sys.path.append('/home/user/apps/django-trunk')
sys.path.insert(0, '/home/user/myapp/src')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")
print 'starting up wsgi application...'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
When I start apache, it always starts two identical wsgi processes for some reason:
apache log:
Mon Jan 06 21:17:02.895219 2014] [mpm_event:notice] [pid 27628:tid 140594224048000] AH00489: Apache/2.4.6 (Ubuntu) mod_wsgi/3.4 Python/2.7.5+ configured -- resuming normal operations
[Mon Jan 06 21:17:02.895287 2014] [core:notice] [pid 27628:tid 140594224048000] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 06 21:17:02.905771 2014] [:error] [pid 27632:tid 140594224048000] starting up wsgi application...
[Mon Jan 06 21:17:02.909542 2014] [:error] [pid 27633:tid 140594224048000] starting up wsgi application...
and ps aux:
root 27628 0.0 0.0 84196 3100 ? Ss 21:17 0:00 /usr/sbin/apache2 -k start
www-data 27632 0.1 0.3 470984 24648 ? Sl 21:17 0:00 /usr/sbin/apache2 -k start
www-data 27633 0.1 0.3 470984 24648 ? Sl 21:17 0:00 /usr/sbin/apache2 -k start
any idea why that is so?
You have the WSGIScriptAlias directive wrong:
WSGIScriptAlias / /home/user/myapp/src/wsgi.py application-group='%{GLOBAL}' process-group='%{GLOBAL}'
It should be:
WSGIScriptAlias / /home/user/myapp/src/wsgi.py application-group='%{GLOBAL}' process-group='lh.test.com'
The result is that your application isn't running in daemon mode but embedded mode, and so is running in the Apache child worker processes. As such how many processes you see is going to be up to the Apache MPM settings.
Change that directive and also set:
WSGIRestrictEmebedded On
This will turn off the ability for stuff to run in the Apache child worker process and cause an error if you stuff up your configuration and don't delegate an application to run in the daemon process group properly.
Also go read:
http://blog.dscpl.com.au/2012/10/why-are-you-using-embedded-mode-of.html

htaccess Deny from all and 500 Internal Server Error

I want to restrict direct access to a specific directory (and all the files inside) on my local server.
The directory is: C:/Server/www/project/html/
I've tried the following code (.htaccess is placed in www directory - /project/html/ doesn't work too):
<Directory "C:/Server/www/project/html/">
AllowOverride all
Order Deny,Allow
Deny from all
</Directory>
However, it causes 500 Internal Server Error and I can't understand why.
Apache error log:
[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:06:02 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:54:12 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:54:12 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here
[Fri Aug 05 17:05:06 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
Check Apache error log for exact error description.
In any case -- the reason for this error is simple: <Directory> directive CANNOT be placed in .htaccess file -- only server config or virtual host.
http://httpd.apache.org/docs/current/mod/core.html#directory
for me it required enable headers module to apache

Resources