cockpit icon indicating copy to clipboard operation
cockpit copied to clipboard

.htaccess causing internal server error

Open Kedmun0 opened this issue 4 years ago • 5 comments

Hi all,

I hope you can help me. This has been bugging me for days. I have been trying to install cockpit CMS onto my website using the extraction into web root solution but it doesn't seem to be working. I get a server error when I try to install the CMS going though /cockpit/install and then when I disable the .htaccess file, it lets me install it and it gives me the option to login to cockpit using the new admin / admin credentials but it then redirects me to a 404 not found page.

I read that it's because the .htaccess file is disabled but when it is enabled, I get an internal server error

Kedmun0 avatar May 04 '20 21:05 Kedmun0

Please investigate http + php log files to get more details. otherwise it is hard to point to the right direction

aheinze avatar May 16 '20 15:05 aheinze

I'm having the same issue, when I remove everything but

`# URL rewrites <IfModule mod_rewrite.c>

Options -MultiViews

RewriteEngine On
# RewriteBase /

# Protect some contents
RewriteRule ^.*/?\.git+ - [F,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]

</IfModule>`

It seems to be working fine. Can anyone shed some light on this?

buzztnt avatar May 18 '20 17:05 buzztnt

solved here: https://discourse.getcockpit.com/t/re-htaccess-file-causes-internal-server-error/1437/3?u=raffaelj

The reason was, that mod_version wasn’t enabled on a shared GoDaddy host.

If you have the same problem, either activate mod_version for your apache or if you can’t enable it, you can delete or comment out all the <IfVersion >= 2.4> lines in .htaccess to match your setup.

can be closed now.

raffaelj avatar Jun 18 '20 11:06 raffaelj

I got the same issue and commented all ifVersion tags, since mod_version is not existent on my system. But after installing cockpit successfully, I get a 404 to http://dev-pi.local/cockpit/auth/login?to=/.

Any ideas?

wlfnkls avatar Jul 02 '20 14:07 wlfnkls

I got the same issue and commented all ifVersion tags, since mod_version is not existent on my system. But after installing cockpit successfully, I get a 404 to http://dev-pi.local/cockpit/auth/login?to=/.

Any ideas?

In the root .htaccess file (https://github.com/agentejo/cockpit/blob/next/.htaccess#L38), change line 38

#RewriteBase /

by

RewriteBase /

This should work ;)

MarcTabaries avatar Oct 26 '21 11:10 MarcTabaries