Uberspace / lab

The Uberlab provides various tutorials - written by you! - on how to run software and tools on Uberspace 7.
https://lab.uberspace.de
Other
315 stars 415 forks source link

[pixelfed] 500 Internal Server Error when following guide #1452

Closed miri64 closed 1 year ago

miri64 commented 1 year ago

I followed https://lab.uberspace.de/guide_pixelfed/ exactly with the exception that I used a dedicated domain DocumentRoot and mailbox for the SMTP configuration. So fine so good, I get a login page. But once I try to login with my newly created user, I get a 500 Internal Server Error.

The apache error log only reports

AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

and nothing is provided in the PHP log. If I try to do as recommended in the .htaccess, I unsurprisingly get

/var/www/virtual/<myusername>/<mydomain>/.htaccess: LimitInternalRecursion not allowed here

and

/var/www/virtual/<myusername>/<mydomain>/.htaccess: LogLevel not allowed here

Disabling the 500 error page only provides the generic Apache error page.

Seems like a configuration error, but I am not sure where to look to fix it.

Here is my (censored) .env file:

```bash APP_NAME="Pixelfed" APP_ENV="production" APP_KEY="" APP_DEBUG="false" # Instance Configuration OPEN_REGISTRATION="false" ENFORCE_EMAIL_VERIFICATION="false" PF_MAX_USERS="1000" OAUTH_ENABLED="true" # Media Configuration PF_OPTIMIZE_IMAGES="true" IMAGE_QUALITY="80" MAX_PHOTO_SIZE="15000" MAX_CAPTION_LENGTH="500" MAX_ALBUM_LENGTH="10" # Instance URL Configuration APP_URL="https://" APP_DOMAIN="" ADMIN_DOMAIN="" SESSION_DOMAIN="" TRUST_PROXIES="*" # Database Configuration DB_CONNECTION="mysql" DB_HOST="127.0.0.1" DB_PORT="3306" DB_DATABASE="_pixelfed" DB_USERNAME="" DB_PASSWORD='' # Redis Configuration REDIS_CLIENT="predis" REDIS_SCHEME="unix" REDIS_PATH=/home//.redis/sock REDIS_PORT=0 REDIS_HOST="localhost" REDIS_PASSWORD="null" # Laravel Configuration SESSION_DRIVER="database" CACHE_DRIVER="redis" QUEUE_DRIVER="redis" BROADCAST_DRIVER="log" LOG_CHANNEL="stack" HORIZON_PREFIX="horizon-" # ActivityPub Configuration ACTIVITY_PUB="false" AP_REMOTE_FOLLOW="false" AP_INBOX="false" AP_OUTBOX="false" AP_SHAREDINBOX="false" # Experimental Configuration EXP_EMC="false" ## Mail Configuration (Post-Installer) MAIL_DRIVER=smtp MAIL_HOST=.uberspace.de MAIL_PORT=465 MAIL_USERNAME=@ MAIL_PASSWORD="" MAIL_ENCRYPTION=tls MAIL_FROM_ADDRESS="@" MAIL_FROM_NAME="Pixelfed" ## S3 Configuration (Post-Installer) PF_ENABLE_CLOUD=false FILESYSTEM_DRIVER=local FILESYSTEM_CLOUD=s3 #AWS_ACCESS_KEY_ID= #AWS_SECRET_ACCESS_KEY= #AWS_DEFAULT_REGION= #AWS_BUCKET= #AWS_URL= #AWS_ENDPOINT= ```
miri64 commented 1 year ago

Oh, I also did not use the dev branch, but the release tag v0.11.4, but I get the same result with the dev branch.

miri64 commented 1 year ago

I can also confirm that basically any path but / (e.g. the "About" link at the bottom) yields a 500.

miri64 commented 1 year ago

Ok, moving the symlink /var/www/virtual/<myusername>/<mydomain> to /var/www/virtual/<myusername>/html worked... Not ideal, so is there a solution that I still can use /var/www/virtual/<myusername>/<mydomain>?

taddydevil commented 1 year ago

Jep, there is a solution.

Add Rewritebase / in your .htaccess File under /var/www/virtual/isabell/example.org/.htaccess

Should look like this:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    Rewritebase /

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
miri64 commented 1 year ago

Thank, that worked! I will amend the instructions ASAP.

SalocinHB commented 1 year ago

Using RewriteRule directives in a directory other than html always requires RewriteBase /.

miri64 commented 1 year ago

Thank, that worked! I will amend the instructions ASAP.

1472