[TYPO3-install] SOLVED: Newbie question: HTTP 400 Bad Request after install, but only non-localhost VirtualHost (Michael_OF)

Michael_OF michaelof at rocketmail.com
Sat Dec 3 16:29:29 CET 2016


Thanks to GREAT HELP of Eric Covener in Apache's IRC channel #httpd I was able to SOLVE the issue.

Maybe of interest for others also:


My VirtualHost definition has had two errors:

a) Including the .htaccess itself is fine (sounds strange at first, but for upgrade reasons), BUT must take place not in
VirtualHost context, but inside the <Directory> directive.

Changing this solves the "Bad Request" issue and leads to an "access denied" issue. Which is logged and solvable easily:

b) Same context issue for "Options FollowSymLinks": NOT VirtualHost, but <Directory>.


Leading to the following *** WORKING *** VirtualHost for a TYPO3 instance without using .htaccess files:


<VirtualHost *:443>

        ServerName domain.tld:443

        DocumentRoot "/srv/www/htdocs/typo3root"

        Include /etc/apache2/conf.d/php5.conf
        Include /etc/apache2/conf.d/typo3.local.conf

        <Directory "/srv/www/htdocs/typo3root">
                Options +FollowSymLinks
                AllowOverride None
                #AllowOverride All
                Require all granted
                Include /srv/www/htdocs/typo3root/.htaccess
        </Directory>


        SSLEngine on

        <IfModule mod_headers.c>
              Header always set Strict-Transport-Security "max-age=15552000; preload"
        </IfModule>

</VirtualHost>


FYI: etc/apache2/conf.d/typo3.local.conf (settings necessary for TYPO3, not default for my OpenSuse 42.2 system)

<IfModule mod_php5.c>
  php_value max_execution_time 240
  php_value memory_limit 128M
  php_value register_globals disabled
  php_value upload_max_filesize 100M
  php_value post_max_size 100M
  php_value max_input_vars 2000
  php_value extension soap.so
</IfModule>



Regards,
Michael



> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sat, 3 Dec 2016 01:45:27 +0100
> From: Michael_OF <michaelof at rocketmail.com>
> Subject: [TYPO3-install] Newbie question: HTTP 400 Bad Request after
> 	install, but only non-localhost VirtualHost
> To: typo3-install at lists.typo3.org
> Message-ID:
> 	<mailman.2294.1480725939.628.typo3-install at lists.typo3.org>
> Content-Type: text/plain; charset=utf-8
> 
> Hi all,
> 
> 
> I've installed TYPO3 7.6.13, on Apache 2.4.23, on OpenSuse Leap 42.2. On a private VPS.
> 
> For security reasons all done at first on "localhost", accessed remotely  by ssh port forwarding.
> 
> --> Installation etc. went fine, TYPO3 backend "runs" on "localhost:port/typo3root/typo3".
> 
> BUT: Whatever I try, I'm not able to get it running on a "real" host, not localhost, does not work. For whatever
> DocumentRoot subfolder added to HTTP GET, result is:
> 
> 
> 	Bad Request
> 	Your browser sent a request that this server could not understand.
> 	Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the
> 	request.
> 
> 
> - typo log in backend shows nothing
> - apache's access_log shows the HTTP GET, nothing further
> - apache's error_log shows nothing, which was not expected by me :-(
> 
> Apaches VirtualHost definition:
> 
> 	<VirtualHost *:443>
> 	        ServerName domain.tld:443
>         	ServerAlias www.domain.tld:443
> 	        DocumentRoot "/srv/www/htdocs/typo3root"
> 	        Options FollowSymLinks
> 	        Include /etc/apache2/conf.d/php5.conf
> 	        Include /etc/apache2/conf.d/typo3.local.conf
> 	        <Directory "/srv/www/htdocs/typo3root">
> 	                AllowOverride None
> 	                Require all denied
> 	        </Directory>
> 	        Include /srv/www/htdocs/typo3root/.htaccess
> 	        SSLEngine on
> 	</VirtualHost>
> 
> 
> Some remarks:
> 
> - as TYPO3 is not the only web app on my vserver, others like owncloud, roundcubemail, phpMyAdmin exists, I decided for
> security reasons to put TYPO3 not in the main DocumentRoot, but in an own subtree starting at <DocumentRoot>/typo3root
> - As this is "my own" vserver, I also decided to follow Apache's recommendations NOT to use .htaccess files. Instead of
> that I set a strict "Directory" directive at first and included the original TYPO3 .htaccess file into the vhost, making
> future updates easier.
> 
> FOR DEBUGGING this http/400 errors of course I've tried also without strict "Directory" directives and with allowed
> .htaccess files. Also tested without https/ssl, http-only, as I found some hints that enabling ssl on apache level might
> not be enough (http://stackoverflow.com/questions/13074815/enabling-ssl-in-typo3).
> 
> "Bad request" still appears.
> 
> So I'm running out of ideas, and any hints would be great!
> 
> 
> Regards,
> Michael
> 
> 
> ------------------------------
> 
> _______________________________________________
> TYPO3-install mailing list
> TYPO3-install at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-install
> 
> End of TYPO3-install Digest, Vol 133, Issue 1
> *********************************************
> 


More information about the TYPO3-install mailing list