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

Running it from webroot subfolder #42

Open
goldencut opened this issue Mar 12, 2018 · 7 comments
Open

Running it from webroot subfolder #42

goldencut opened this issue Mar 12, 2018 · 7 comments

Comments

@goldencut
Copy link

Hi,
I have a management server (runs nginx) where I keep a lot of web-based tools, each in its own webroot subfolder, that I use to manage servers. I added supervisord-monitor there to its own subfolder, and it runs but it looks really ugly as if no css is loaded etc. Any chance of getting it to work there?
screenshot 2018-03-12 15 45 51

BR,
G.

@elementzonline
Copy link

I also have the same issue. Please send suggestion on how to run from subfolder

@felixzh2020
Copy link

You need to see nginx log. May be user's authorization is not ok.

@YOzaz
Copy link
Contributor

YOzaz commented Jul 6, 2018

Hi! You should modify your application config:
https://github.com/mlazarov/supervisord-monitor/blob/master/application/config/config.php
In our case, we had to amend these lines:

$config['base_url'] = '';   // change to your absolute or relative URL
$config['index_page'] = '';   // change to 'index.php' if you don't have rewrite configured

@mlazarov my suggestion would be adding this file into .gitignore, or leave base_url empty so it works on relative paths as well.

@goldencut
Copy link
Author

Thanks to @YOzaz, I got the UI part working. But clicking on any of the server's service controls (https://my_server/supervisord-monitor/public_html/index.php/control/stopall/server01) I still get '404 Not Found'. Nginx gives "[error] 23778#0: *392955 open() "/var/www/html/supervisord-monitor/public_html/index.php/control/stopall/server01" failed (20: Not a directory)".. What is the correct link and should happen when I click on that control?

BR,
M.

@YOzaz
Copy link
Contributor

YOzaz commented Nov 5, 2018

@goldencut you should check your nginx configuration and rewrite rules - it looks like either they're strict (looking for exact path), either rewrite is not configured.

@goldencut
Copy link
Author

Ok, so it seems I got the controls maybe working with:
try_files $uri $uri/ /supervisord-monitor/public_html/index.php$is_args$args;
But for some reason I get blank page when I configure some remote server IP in config .. :/

@sonyzhang
Copy link

nginx+php, run this app, as follow setups:

cat /etc/redhat-release

Red Hat Enterprise Linux Server release 7.4 (Maipo)
#vim /etc/nginx/nginx.conf
add server section in http
server {
listen 80;
server_name localhost;
index index.html index.htm index.php;
root /home/supervisord-monitor/public_html; 指向web应用的映射目录
#autoindex on;
#charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        #root   html;
        #index  index.html index.htm index.php;
        #try_files $uri $uri/ /index.php;
        try_files $uri $uri/ /index.php?s=$uri&$args;
    }
    location ~ [^/]\.php(/|$) {
        try_files $uri =404;
        fastcgi_pass 127.0.0.1:9000;  
        fastcgi_index index.php;
        include fastcgi.conf;   
        set $real_script_name $fastcgi_script_name;
        if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
             set $real_script_name $1;
             set $path_info $2;
        }
        fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
        fastcgi_param SCRIPT_NAME $real_script_name;

    }

othersides, create fastcgi.conf

vim fastcgi.conf

fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

start php-fpm and nginx

Repository owner deleted a comment from KoNekoD May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants