Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Encode explorer on nginx
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Encode explorer on nginx

Hi there. How to install encode explore to replace file browser on nginx?

https://github.com/marekrei/encode-explorer/blob/master/index.php

Can you give me some example of configuration?

Comments

  • iBotiBot Member

    You need php with it's dependencies installed and configure nginx php-fpm socket

  • @iBot said:
    You need php with it's dependencies installed and configure nginx php-fpm socket

    Any example?

  • HaxHax Member

    @mrlongshen said:

    @iBot said:
    You need php with it's dependencies installed and configure nginx php-fpm socket

    Any example?

    http://lmgtfy.com/?q=install+nginx+php

  • @Sixell said:

    @mrlongshen said:

    @iBot said:
    You need php with it's dependencies installed and configure nginx php-fpm socket

    Any example?

    http://lmgtfy.com/?q=install+nginx+php

    Hmm. Already install the php. But it cannot read the explorer

  • HaxHax Member

    @mrlongshen said:

    @Sixell said:

    @mrlongshen said:

    @iBot said:
    You need php with it's dependencies installed and configure nginx php-fpm socket

    Any example?

    http://lmgtfy.com/?q=install+nginx+php

    Hmm. Already install the php. But it cannot read the explorer

    There's something wrong with your nginx configuration probably.

  • @Sixell said:

    @mrlongshen said:

    @Sixell said:

    @mrlongshen said:

    @iBot said:
    You need php with it's dependencies installed and configure nginx php-fpm socket

    Any example?

    http://lmgtfy.com/?q=install+nginx+php

    Hmm. Already install the php. But it cannot read the explorer

    There's something wrong with your nginx configuration probably.

    Please share your configuration

  • mkshmksh Member

    @mrlongshen said:

    @Sixell said:

    @mrlongshen said:

    @iBot said:
    You need php with it's dependencies installed and configure nginx php-fpm socket

    Any example?

    http://lmgtfy.com/?q=install+nginx+php

    Hmm. Already install the php. But it cannot read the explorer

    What do you mean by "cannot read"?

  • @mksh said:

    @mrlongshen said:

    @Sixell said:

    @mrlongshen said:

    @iBot said:
    You need php with it's dependencies installed and configure nginx php-fpm socket

    Any example?

    http://lmgtfy.com/?q=install+nginx+php

    Hmm. Already install the php. But it cannot read the explorer

    What do you mean by "cannot read"?

    it downlaod the index.php

  • TomTom Member

    Have you added the location .php thing to your nginx config?

  • @Tom said:
    Have you added the location .php thing to your nginx config?

    ok, it work now,

    how to make it only read home user folder ? and require a password at.htpasswd

  • mkshmksh Member

    @mrlongshen said:

    @mksh said:

    @mrlongshen said:

    @Sixell said:

    @mrlongshen said:

    @iBot said:
    You need php with it's dependencies installed and configure nginx php-fpm socket

    Any example?

    http://lmgtfy.com/?q=install+nginx+php

    Hmm. Already install the php. But it cannot read the explorer

    What do you mean by "cannot read"?

    it downlaod the index.php

    That's a clear sign of nginx not being correctly configured to use php. Check your nginx configs.

  • @mksh said:

    @mrlongshen said:

    @mksh said:

    @mrlongshen said:

    @Sixell said:

    @mrlongshen said:

    @iBot said:
    You need php with it's dependencies installed and configure nginx php-fpm socket

    Any example?

    http://lmgtfy.com/?q=install+nginx+php

    Hmm. Already install the php. But it cannot read the explorer

    What do you mean by "cannot read"?

    it downlaod the index.php

    That's a clear sign of nginx not being correctly configured to use php. Check your nginx configs.

    it work now, may i know how to point it to my home folder ?
    for now i have this..

    location ~ ^/files/(.+?)(/.*)?$ {
    alias /home/$1$2;
    charset UTF-8;
    source_charset UTF-8;
    set $user $1;
    if ($remote_user = '') { break; }
    if ($user != $remote_user) { return 403; }
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/.htpasswd;
    index index.php index.html index.htm; autoindex on; autoindex_exact_size off;
    }

    I want to use the encode explorer on above, where to add ?

  • mkshmksh Member
    edited May 2018

    @mrlongshen said:
    it work now, may i know how to point it to my home folder ?
    for now i have this..

    location ~ ^/files/(.+?)(/.*)?$ { alias /home/$1$2; charset UTF-8; source_charset UTF-8; set $user $1; if ($remote_user = '') { break; } if ($user != $remote_user) { return 403; } auth_basic "Restricted"; auth_basic_user_file /etc/nginx/.htpasswd; index index.php index.html index.htm; autoindex on; autoindex_exact_size off; }

    I want to use the encode explorer on above, where to add ?

    Ouch that's one hell of a location directive. Let me ask what do you expect it to do? From what i see you are try to map /files/someuser/somedir to /home/someuser/somedir? Yes, the alias might actually archive that and even the if clause checking if someuser equals to user supplied to auth might work but beyond that? Why the break on empty user? charset directives? autoindex?

    In any case if the alias works nginx will start looking for index.php in /home/someuser/somedir is that what you want? Also unless your users homedirs are world readable this is likely to fail listing anything (even if the config is fine otherwise) let alone upload stuff unless you run php as root (extremly stupid idea) or use different php pools for different users.

    Edit: Having checked the script i don't think such multi user config is easily doable. You'd have to map the index.php into home paths while somehow passing the correct base path which doesn't seem to be supported by the script. Even if it did you'd still be stuck with the permission problem.

  • @mksh
    I want all my user use encode explorer.
    Do I have to add index.php manually in each user homedir ?
    Any other method ?

  • mkshmksh Member
    edited May 2018

    @mrlongshen said:
    @mksh
    I want all my user use encode explorer.
    Do I have to add index.php manually in each user homedir ?
    Any other method ?

    As said above i guess you could use an alias or even just a location passing a static script path to php but you'd confuse the index.php as to what directory it should actually operate on and even if you get around that you'd need to somehow fix the permissions problem. Admittedly per user pools might be overkill as a single special user that is member of every single user group should suffice but still it'll need some work.

  • @mksh hmm. I dont know what to do..

  • mkshmksh Member

    @mrlongshen said:
    @mksh hmm. I dont know what to do..

    Well, as for step by step instructions i don't know that either. Just that you need a/multiple php pool(s) with the sufficient rights to access files for all user and likely a tiny hack to the index.php script for passing a path. Not exactly my idea of fun so you are on your own from there i fear.

  • @mksh said:

    @mrlongshen said:
    @mksh hmm. I dont know what to do..

    Well, as for step by step instructions i don't know that either. Just that you need a/multiple php pool(s) with the sufficient rights to access files for all user and likely a tiny hack to the index.php script for passing a path. Not exactly my idea of fun so you are on your own from there i fear.

    I hope someone will give hint about this. Dont know.. Thanks for helping..

Sign In or Register to comment.