cryptoeax / arbbot

Arbitrator, a bitcoin/altcoin arbitrage trading bot
https://gitter.im/cryptoeax-arbbot/Lobby
GNU General Public License v3.0
199 stars 78 forks source link

Webinterface problem #19

Closed kingchenx closed 6 years ago

kingchenx commented 6 years ago

hi, i have some problems with the webinterface^^ because i get this error after i logged in with my correct username and password, that i created with htpasswd... 500 Internal Server Error nginx/1.10.3 (Ubuntu) thx :)

remipaeta commented 6 years ago

Use this command: sudo chown -R www-data:www-data /var/www/'yourdirectory"

remipaeta commented 6 years ago

Use it without " " of course ^^

kingchenx commented 6 years ago

Mhmm, this works not for me, get the same error :/

remipaeta commented 6 years ago

Ok try this: chmod 754 -R /var/www/yourdirectory

kingchenx commented 6 years ago

Nope, still not work :/

born2hate commented 6 years ago

the simplest way is to install vestacp nginx+php-fpm on fresh version of server. works for me :)

cryptoeax commented 6 years ago

I suggest looking at the error logs for your web server, this error message is very generic and it basically means "something went wrong" so it's hard to say more without knowing the specifics.

For example if you are using nginx on Ubuntu, the following command should reveal the issue if you run it right after the error 500 has shown up in a web browser (you can run the date command immediately after it to dump out the current server date to see which lines in the log are current.)

sudo tail /var/log/nginx/error.log
kingchenx commented 6 years ago

this is the error.log

2017/12/13 22:29:01 [error] 15986#15986: 1 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost" 2017/12/13 22:29:01 [error] 15986#15986: 2 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost" 2017/12/13 22:29:01 [error] 15988#15988: *3 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost"

cryptoeax commented 6 years ago

Hmm, in your nginx config, if you replace the line that starts with try_files with try_files $uri $uri/ =404;, does the problem go away?

cryptoeax commented 6 years ago

(basically replace /index.html there with =404)

kingchenx commented 6 years ago

i dont know what i am doing wrong....

i now replaced try_files $uri $uri/ =404; and try_files $uri $uri/ /index.html; with try_files $uri/ $uri /index.php?$query_string;, and now the sudo tail /var/log/nginx/error.log give ->

try_files $uri/ $uri /index.php?$query_string; ----> 2017/12/14 00:20:02 [error] 871#871: *1 user "xY": password mismatch, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost"

try_files $uri $uri/ /index.html; ------> 2017/12/14 00:38:57 [error] 3206#3206: *1 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost"

try_files $uri $uri/ =404;-------> 2017/12/14 00:38:00 [error] 872#872: *3 user "xY" was not found in "/var/www/conf/arbitrage.passwd", client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost"

im just confused, 3 various errors ... and yes, all Nick/Pass is 100% correct, if i use a wrong password, the page refuse the login, with the correct logins the page let me in and give me the erros..

cryptoeax commented 6 years ago

What happens if you completely remove the try_files lines altogether? This is something that I have inherited from the original repo and I don't actually understand why it's necessary, now that I am consulting the documentation.

The first and last log lines suggest that the user and password you are using isn't working, can you delete /var/www/conf/arbitrage.passwd and try regenerating it again please?

kingchenx commented 6 years ago

didnt work to generate a new arbitrage.passwd, and after removingtry_files .... i get this -> 404 Not Found -----> 2017/12/14 02:02:52 [warn] 2265#2265: conflicting server name "localhost" on 0.0.0.0:80, ignored 2017/12/14 02:02:59 [error] 2268#2268: *1 "/var/www/arbitrage-production/web/index.html" is not found (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost"

cryptoeax commented 6 years ago

OK there is something completely wrong with your nginx configuration. Sorry but resolving it is beyond the scope of this project. :-) Please ask for help in places like https://serverfault.com/.

But from the errors you're getting, it's clear that:

cryptoeax commented 6 years ago

I removed try_files from the instructions in 36e6e46. Closing the issue since the rest of the problems seem to be configuration issues on @kingchenx's side.

kingchenx commented 6 years ago

@cryptoeax , what a fail from me :( im sorry for wasting your time... The path was rly not correct in the nginx, now looks good for me so.. "arbbot-production" - after fresh installation/unzip and not arbitrage-production ;)

the server {

    listen 80;
    root /var/www/arbbot-production/web;
    index index.html;
    server_name localhost;

    location / {

            auth_basic           "Restricted area";
            auth_basic_user_file /var/www/conf/arbitrage.passwd;

    }

    location ~ \.php$ {

      include snippets/fastcgi-php.conf;
      fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;

    }

}

cryptoeax commented 6 years ago

Thanks, updated the instructions in 502a739.