Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network issue #165

Closed
timowevel1 opened this issue Jan 10, 2021 · 18 comments
Closed

Network issue #165

timowevel1 opened this issue Jan 10, 2021 · 18 comments
Labels

Comments

@timowevel1
Copy link

Hello,

I tried to set it up on a fresh installed Ubuntu 20.04 Server. I ran the install script and there I already got errors like that /var/www/vendor could not be created and many Permission denied's. Of course I ran it as root and with sudo.

When I start the webinterface I can access it, but when I try to Sign Up I get a "Network error".

Did anyone experience this?

@timowevel1
Copy link
Author

And of course thank you for this amazing project! It is really nice but because of the problem above I cant use it.

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Jan 10, 2021

That is probably because your server (nginx/apache) is using the www-data user.
I'd advice you to change the owner&group of your application directory to www-data (or whatever your webserver uses), eg: chown -R www-data:www-data ./your_presentator_dir/ OR to add www-data to your user group.

In general you should avoid using root when executing console commands since that most likely will mess up your file permissions.

I'll close the issue since it doesn't seem to be a bug with Presentator, but please comment if you are still experiencing further issues.

@timowevel1
Copy link
Author

Thank you. I noticed that this one was not for production. Now I installed it with the production guide and I'm experiencing errors when logging in. Database and everything is setup. Could you tell how to install the php extension "reflection" and the rest? System is ubuntu. It drops me an Internal Server Error 500 everytime, maybe its php.

/api/users/register:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error) /api/users/register:1

@timowevel1
Copy link
Author

The php socket is also setup correctly in the nginx conf (Php7.4-fpm.sock). File is also on the specified location, probably php extensions are missing.

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Jan 10, 2021

@timololipop Ubuntu usually follows this patternsudo apt-get install php-... or sudo apt-get install php7.4-.... Just google "ubuntu php install ..." and you should be fine.

Although I haven't tested it with the production setup, you should also be able to run manually the requirements check by executing
php /path/to/your_presentator/vendor/presentator/api/requirements.php

Please provide detailed log if the above error persist (and if possible, your nginx config).

@timowevel1
Copy link
Author

The path to yii framework seems to be incorrect. You need to install Yii framework via composer or adjust the framework path in file requirements.php. Please refer to the README on how to install Yii.

@timowevel1
Copy link
Author

But on composer install it tells me:
`> @php yii healthcheck/db
DB connection is established.

@php yii migrate/up --interactive=0
Yii Migration Tool (based on Yii v2.0.40)
`

@ganigeorgiev
Copy link
Member

@timololipop For the requirements check you'll have to copy the requirements.php file in the base application directory, something like:

cp  /path/to/your_presentator/vendor/presentator/api/requirements.php /path/to/your_presentator/requirements.php

and then call with php /path/to/your_presentator/requirements.php

The database healthcheck means only that the application was able to connect to your DB with the configured credentials.

Could you attach a phpinfo dump/screenshot?

@timowevel1
Copy link
Author

`Yii Application Requirement Checker

This script checks if your server configuration meets the requirements
for running Yii application.
It checks if the server is running the right version of PHP,
if appropriate PHP extensions have been loaded, and if php.ini file settings are correct.

Check conclusion:

PHP version: OK

Reflection extension: OK

PCRE extension: OK

SPL extension: OK

Ctype extension: OK

MBString extension: OK

OpenSSL extension: OK

Intl extension: OK

ICU version: OK

ICU Data version: OK

Fileinfo extension: OK

DOM extension: OK

IPv6 support: OK

PDO extension: OK

PDO SQLite extension: WARNING!!!
Required by: All DB-related classes
Memo: Required for SQLite database.

PDO MySQL extension: OK

PDO PostgreSQL extension: WARNING!!!
Required by: All DB-related classes
Memo: Required for PostgreSQL database.

Memcache extension: WARNING!!!
Required by: MemCache

GD PHP extension with FreeType support: OK

ImageMagick PHP extension with PNG support: OK

Expose PHP: WARNING!!!
Required by: Security reasons
Memo: "expose_php" should be disabled at php.ini

PHP allow url include: OK

PHP mail SMTP: OK


Errors: 0 Warnings: 4 Total checks: 23

`

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Jan 10, 2021

@timololipop The requirements check seems ok (if you are using MySQL). Could you provide more detailed server log(s) of the error?

You could also enable temporary dev and debug mode on application level by changing YII_DEBUG to true and YII_ENV to dev in your web/api/index.php.

@timowevel1
Copy link
Author

timowevel1 commented Jan 10, 2021

The sign up process seems to work now, but I got problems with the Mail Setup.

'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'useFileTransport' => false,
// Sends all mails to a file/db by default.
// You have to set 'useFileTransport' to false and
// configure a transport for the mailer to send real emails.
// eg.
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.ionos.de',
'username' => 'mail@mydomain.de',
'password' => 'mypassword',
'port' => '465',
'encryption' => 'tls',
],
],

https://www.ionos.de/hilfe/e-mail/allgemeine-themen/serverinformationen-fuer-imap-pop-und-smtp/

I also changed usefiletransport to false.
I dont receive any mails.

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Jan 10, 2021

@timololipop I'm glad that you managed to fix the error.

useFileTransport must be set to false for sending real emails. Unfortunately I'm not familiar with the mail server provider you use, but you could try replacing tls with ssl. If that doesn't work, to ensure that the issue is with the mail configuration and not your Presentator installation, you may want to test with mailtrap.io. If mailtrap works fine, than my suggestion would be to contact your mail server support to check if something additional need to be done at their end.

p.s. Currently activation emails can't be resent (will be added in the upcoming releases). You could manually activate your newly registered user by switching the status flag in the user table from inactive to active.

@timowevel1
Copy link
Author

Also tried gmail, didnt work. I will try mailtrap, thank you!

@timowevel1
Copy link
Author

Weird, they appear in mailtrap, but gmail or 1und1 didnt work.

@ganigeorgiev
Copy link
Member

@timololipop If you are seeing your mails in mailtrap, than the issue must be something with your mail server configuration. The last time I checked personal gmail accounts had some security restrictions and limitations for the number of allowed outgoing emails. For 1und1 I'd advice you to contact their support and ask them if something additional need to be done in order to be able to use their smtp server.

@timowevel1
Copy link
Author

Can you recommend any email provider you know it is working?

@ganigeorgiev
Copy link
Member

@timololipop I have previously successfully tested mailgun, sendgrid, aws ses. But really any mail provider should be fine. Contact the 1und1 support and ask them for the proper smtp configurations (their documentation could be outdated, the port/host could be different, etc.).

@timowevel1
Copy link
Author

I managed to get it working with "Mailjet". Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants