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

Installation to subdirectory #8

Open
johlton opened this issue Oct 22, 2022 · 3 comments
Open

Installation to subdirectory #8

johlton opened this issue Oct 22, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@johlton
Copy link

johlton commented Oct 22, 2022

What steps will reproduce the problem?

I' trying to run this in a subdirectory /ldap-commander/ on an Apache2 webserver. I assumed there is a setting baseUrl and found it in config/params.php, but this apparently is mainly for loading assets. Not being an expert in Yii - especially not Yii3 - I found some older posts about setting this in config/main.php but as I see it the whole configuration ecosystem changed dramatically since then.
I tried to fix this via enabled rewrite module, .htaccess and RewriteBase /ldap-commander, but with no luck.

What is the expected result?

The login form for the app :)

What do you get instead?

I get a correctly styled 404 page with loaded assets saying "The page /ldap-commander/ not found." and navigation still pointing to /users, /groups and so on.

Additional info

Q A
Version 0.5.0
PHP version 8.1
Operating system Ubuntu 22.04

Should I stop looking for a baseurl setting and instead try to fix it via server config? Any hint would be highly appreciated. Thanks!

@luke-
Copy link
Contributor

luke- commented Oct 22, 2022

Good question, probably currently the easiest way to change this is via the WebServer for now.
Yii3 is still under active development and I haven't found any related documentation yet. Maybe somewhere in the Router component...

@luke- luke- added the enhancement New feature or request label Oct 22, 2022
@johlton
Copy link
Author

johlton commented Nov 9, 2022

Hey, sorry for late reply. I now installed it to root level and login comes up. After login I can even browse the several areas like

  • /users
  • /groups
  • /entity/browse

but if I click on "Edit" and the route goes e.g. to

  • /entity/edit?dn=xxx
  • /schema/object-class?oid=2.5.6.0

I get a 404 error / blank page. I really don't know why happens since /entity/browse works and /entity/edit does not. So I assume it's not a webserver configuration thing. I include the relevant part of my nginx config here for replicability:

server {
        [...]
        root /srv/git/ldap-commander/public/;
        index index.html index.php;

        location / {
                disable_symlinks off;
                index index.php;

                try_files $uri $uri/ /index.php;

                location ~ \.php$ {
                        try_files $uri =404;
                        fastcgi_split_path_info ^(.+\.php)(/.+)$;
                        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
                        fastcgi_index index.php;
                        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                        include fastcgi_params;
                }

                error_log /var/log/nginx/error.ldap-commander.log;
                access_log /var/log/nginx/access.ldap-commander.log;

                [...] 
        }
}

Any idea what could be the issue here? Thanks a lot in advance!

@luke-
Copy link
Contributor

luke- commented Nov 12, 2022

@johlton Hmm, I think that for this a subfolder Middleware has to be added in the code first.
I just tried that, but couldn't get it to work either.

Maybe it's better to wait until the Yii3 development is a bit further here...

Related: yiisoft/demo#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants