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

Ability to see the hostname #396

Open
LoZio opened this issue Dec 9, 2017 · 16 comments
Open

Ability to see the hostname #396

LoZio opened this issue Dec 9, 2017 · 16 comments

Comments

@LoZio
Copy link

LoZio commented Dec 9, 2017

In a multi-server configuration it should be useful to see the server name

Expected Behavior

Have a config variable to enable this at two levels:
APP_SHOW_SERVER_NAME = 1
Show the server name in the top bar of the app
The same set to 2 can display the server name ALSO as a comment inside the html of the login page
Set to 0: non server name (same as today)

Current Behavior

Cannot know which server I'm going to

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

  • Version or latest commit hash (git rev-parse HEAD):
  • Environment name and version (e.g. Chrome 39, PHP 7.0, etc):
  • Instance link (optional):
@sndrr
Copy link
Contributor

sndrr commented Dec 12, 2017

How is your setup? One database with multiple frontend webservers (HA-setup)?

@LoZio
Copy link
Author

LoZio commented Dec 12, 2017

Confirm

@LoZio
Copy link
Author

LoZio commented Dec 12, 2017

AWS ELB in front to a pool of servers. Session stickyness to be able to configure the application. This is sub-optimal for load distribution but required since sessions are not kept in the DB so switching from one server to another breaks things. Would be useful to put the session in the DB/Redis to avoid using sticky connections. Not a real problem when you have a lot of clients clicking since they are evenly spread in any case.

@overint
Copy link
Contributor

overint commented Mar 27, 2018

@LoZio

You can set the session driver to redis in the .env file, line 106,

...
CACHE_DRIVER=file
SESSION_DRIVER=redis
QUEUE_DRIVER=database
...

@overint
Copy link
Contributor

overint commented Mar 29, 2018

Would showing the server name on /about-polr be an adequate solution? I don't think we need to be showing it in the nav.

@LoZio
Copy link
Author

LoZio commented Mar 29, 2018

Yes of course, but having it handy (even in some fine print format) whould be better.
Looking at my use-case also adding a specific X-HEADER in the redirect reply would be useful.

@LoZio
Copy link
Author

LoZio commented Mar 29, 2018

@overint Where do I find doc about configuring redis settings?

@overint
Copy link
Contributor

overint commented Mar 29, 2018

@LoZio
Copy link
Author

LoZio commented Mar 29, 2018

Ok, this shows me how to code using laravel and redis. My question was: is there some PolR documentation about how to setup redis sessions? You mentioned to change a line adding
SESSION_DRIVER=redis
but where do I find PolR docs about where to set the server name, port, cluster (if any), db number, user and password and so on?
Or where you suggesting: this is how to add the support to PolR go code it yourself?

@overint
Copy link
Contributor

overint commented Mar 29, 2018

You will need to add the redis vars to your .env, as below:

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

@LoZio
Copy link
Author

LoZio commented May 4, 2018

Sorry for the late reply, had time to test only today.
Just adding SESSION_DRIVER=redis (and filling all the redis variables) results in "Whoops, looks like something went wrong.".
Redis is online (on another host) and working.
Where do I find some log to further investigate? Apache error log contains no info, access log says it was a 500.

@LoZio
Copy link
Author

LoZio commented May 4, 2018

Also tried to create a config/database.php file from some online examples with no luck.

@overint
Copy link
Contributor

overint commented May 4, 2018

You will likely need to check your error.log not your access.log

@LoZio
Copy link
Author

LoZio commented May 4, 2018

I wrote it above, nothing in the error.log.

@overint
Copy link
Contributor

overint commented May 4, 2018

I meant to say the laravel.log in /storage/logs (in your polr folder)

@LoZio
Copy link
Author

LoZio commented May 4, 2018

No such file, but found lumen.log that says
[2018-05-04 08:27:43] lumen.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Fatal error: Class 'Illuminate\Redis\RedisServiceProvider' not found in /mnt/web/polr/vendor/laravel/lumen-framework/src/Application.php:268

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

No branches or pull requests

3 participants