*[error] [client 127.0.0.1] Invalid method in request \x80j\x01\x0*

If you see this error message in your error log, then it means that you are attempting to connect to a non-HTTPS site (i.e., HTTP only), using HTTPS.

This could indicate that you don't have SSLEngine On in the vhost that you're contacting or you are trying to connect to the site using the wrong protocol (HTTP on HTTPS or HTTPS on HTTP).

For example, if your vhost block looks like this:

NameVirtualHost *:443
<VirtualHost *:443>
  ServerName myserver.foo.com
  DocumentRoot /var/www/myserver

  # Missing SSLEngine On and other SSL configuration directives.
  ...
</VirtualHost>

This is not an SSL enabled vhost. This vhost can only be accessed by the user via HTTP - _http://myserver.foo.com:443_. Also, one does not usually use name based vhosts for HTTPS configuration even though it's seen commonly in Debian and Ubuntu tutorials. See the official Apache docs for more information why.

Or, another example, if your vhosts look like this:

NameVirtualHost *
<VirtualHost *>
  ServerName myserver.foo.com
  DocumentRoot /var/www/myserver

  ...
</VirtualHost>

<VirtualHost _default_:443>
  ServerName myserver.foo.com
  DocumentRoot /var/www/myserver

  SSLEngine On
  # Other SSL configuration directives.
  ...
</VirtualHost>

Apache will always bypass the SSL vhost because of the * interface/port configuration of your HTTP vhost. You will know this is the cause as when you start Apache, you'll see the mixing * ports and non-* ports warning. Running the httpd -S command will also show this warning. This is a common misconfiguration.

The final scenario would be that you are trying to access a HTTP vhost via HTTPS or vice versa. This does not necessarily mean an Apache misconfiguration on your part. Only that you (or your users) are trying to access a HTTP vhost via HTTPS or a HTTPS vhost via HTTP.

Also note that starting from Apache 2.2, the classic, monolithic httpd.conf file has been broken up into smaller configuration files. One of these is httpd-ssl.conf in the conf/extras directory. This file contains an SSL vhost configuration along with SSL configuration directives. If you are aware of this file and have made your configurations in this file, make sure that the include line in httpd.conf has been uncommented.

# Make sure you uncomment the line below!
# Include conf/extra/httpd-ssl.conf
  • No labels