Submitted by tknfor in Postmill (edited )

I managed to get a test environment set up. I am able to view the front page of my instance but upon pressing any other link I get an error telling me Apache was unable to find this file. What did I do wrong?

Not Found The requested URL was not found on the server

2

Comments

You must log in or register to comment.

emma wrote

You need an .htaccess file. Look for one for Symfony.

3

tknfor OP wrote (edited )

Thanks! I fixed the issue by just using nginx instead of apache. While trying to upload images I get a 500 server internal error, and I'm not sure where to begin fixing this.

Where are pictures saved too?

1

emma wrote

Check your log files.

Pictures are saved in public/submission_images, and thumbnails in public/media/cache

2

tknfor OP wrote (edited )

The postmill_error.log is empty which is a little confusing as a 500 error also appears when posting links. The links get posted but it shows a 500 error instead of returning to the post.

1

emma wrote

There's a var/log directory in the Postmill files. Check the logs there.

2

tknfor OP wrote

[2020-02-21T21:20:36.460301+00:00] request.INFO: Matched route "submit". {"route":"submit","route_parameters":{"_route":"submit","forum_name":"memes","_controller":"App\Controller\SubmissionController::submit"},"request_uri":"https://test.instance/submit/memes","method":"POST"} [] [2020-02-21T21:20:36.462994+00:00] security.DEBUG: Read existing security token from the session. {"key":"_security_main","token_class":"Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken"} [] [2020-02-21T21:20:36.492075+00:00] security.DEBUG: User was reloaded from a user provider. {"provider":"Symfony\Bridge\Doctrine\Security\User\EntityUserProvider","username":"banana"} [] [2020-02-21T21:20:36.492272+00:00] security.DEBUG: Checking for guard authentication credentials. {"firewall_key":"main","authenticators":1} [] [2020-02-21T21:20:36.492287+00:00] security.DEBUG: Checking support on guard authenticator. {"firewall_key":"main","authenticator":"App\Security\LoginAuthenticator"} [] [2020-02-21T21:20:36.492298+00:00] security.DEBUG: Guard authenticator does not support the request. {"firewall_key":"main","authenticator":"App\Security\LoginAuthenticator"} [] [2020-02-21T21:20:36.530959+00:00] php.WARNING: Warning: fopen(/var/www/Postmill/public/submission_images/8bcf4c407c92ca7406779c2e29a2b5c24b4daab0428d23aef9c9c4a5ab21c2de.jpeg): failed to open stream: Permission denied {"exception":"[object] (ErrorException(code: 0): Warning: fopen(/var/www/Postmill/public/submission_images/8bcf4c407c92ca7406779c2e29a2b5c24b4daab0428d23aef9c9c4a5ab21c2de.jpeg): failed to open stream: Permission denied at /var/www/Postmill/vendor/league/flysystem/src/Adapter/Local.php:157)"} [] [2020-02-21T21:20:36.531857+00:00] request.CRITICAL: Uncaught PHP Exception RuntimeException: "Couldn't store file" at /var/www/Postmill/src/Flysystem/ImageManager.php line 56 {"exception":"[object] (RuntimeException(code: 0): Couldn't store file at /var/www/Postmill/src/Flysystem/ImageManager.php:56)"} [] [2020-02-21T21:20:36.536405+00:00] security.DEBUG: Stored the security token in the session. {"key":"_security_main"} []

1

emma wrote

The image directories aren't writable as the user PHP runs as. Changing the owner to www-data is the easiest way to fix it.

2

tknfor OP wrote

That fixed it! I'm assuming it also explains why posting links lead to a 500 error. Which folder handles sharing of links?

Thanks!

1

emma wrote

Posting links would fail due to the image directories not being writable, as it tries to download a related image. Links themselves are stored in the database.

2

tknfor OP wrote (edited )

Hey thanks again for your help. One last question. While setting up the admin for the data base using this command: bin/console app:user:add admin1 --admin I get the following error:

There are no commands defined in the "app:user" namespace.

Did you mean one of these?

app

app:theme

1

emma wrote

That command is for older versions. See https://gitlab.com/postmill/Postmill/-/wikis/admin-accounts.

2

tknfor OP wrote

Like I've said bless you for all these answers. Could I also ask how to delete forum categories after they've been created?

1

emma wrote

This is actually not possible, sorry. Forum categories will likely be removed in a later version of Postmill anyway.

2

tknfor OP wrote

Thanks! I had to make the media/cache folder myself and gave it ownership to www-data and no more errors!

1