UnamSanctam / UnamWebPanel

MIT License
164 stars 61 forks source link

Miners not connecting to panel after changing panel url in remote configuration. #255

Closed slezercc closed 1 year ago

slezercc commented 1 year ago

I changed my web panel to an ip in my remote config and the bots are now all gone from my old panel but none of them are showing on my new panel (which is an IP and not a domain.) Also, it's http and my domain used https. Does the ssltls have anything to do with panel connection in remote config or it's simply for the pool?

UnamSanctam commented 1 year ago

The miners only check the "Remote Configuration" every 100 minutes to prevent bans, if they check too often then any paste site will eventually ban the entry. The ssltls option is only for the pool connection, for the web panel connection it simply relies on whether you entered http or https in the URL.

slezercc commented 1 year ago

Okay so my best bet would be to simply wait?

UnamSanctam commented 1 year ago

Yes that's correct.

slezercc commented 1 year ago

Okay, I'll wait 100 minutes and let you know if my issue persists.

slezercc commented 1 year ago

I just checked for an error.log file and I found this in it:

__UNAM_LIB/Logs/php-error-04-09-2023.html): Failed to open stream: Permission denied in /redacted/__UNAM_LIB/unam_lib.php on line 235

How do I check who the files are being executed by to chown to the correct user?

UnamSanctam commented 1 year ago

The error pertains to the custom error log, make the __UNAM_LIB\Logs folder writable. Though you shouldn't get that error if all the permissions are set up correctly. To see what user it's running under you can use htop and find the apache/apache2/http process.

slezercc commented 1 year ago

What are the correct permissions?

slezercc commented 1 year ago

__UNAM_LIB is owned by root.

Also, would I need to open any ports on my vps for the bots to connect or not?

I also forgot to mention, I didn't copy my database file from my old panel to my new one, I only changed the panel URL in my remote config.

UnamSanctam commented 1 year ago

You should set everything in your html (or domain) folder to be owned by the user (or web user), and then also set 755 (as far as I remember).

If you're running Apache then usually one executes the following commands: sudo chown -R $USER:$USER /var/www/html sudo chmod -R 755 /var/www/html Or the whatever you chose instead of html if a virtual host is set up for the site.

Also, would I need to open any ports on my vps for the bots to connect or not?

http uses port 80 and https uses port 443 so that would be the only thing you need, though if you're getting that error then they're probably already open unless you triggered the error from inside the VPS.

I also forgot to mention, I didn't copy my database file from my old panel to my new one, I only changed the panel URL in my remote config.

Then the miners they will just be re-added whenever they connect.

slezercc commented 1 year ago

Its been more than 100 minutes and there's still no bots on my new panel.

UnamSanctam commented 1 year ago

Set up a miner (no "Startup" or anything needed) on your own computer with the new "API Endpoint URL" to easily test if your webserver works as it should.

slezercc commented 1 year ago

I just did and it is not connecting.

UnamSanctam commented 1 year ago

Check your access logs to make sure that your web sever is accepting the connection and also check the __UNAM_LIB\Logs folder for any error files. Also, are you able to visit the web panel endpoint directly from your computers browser? Make sure that you don't have forced http to https redirection as well.

slezercc commented 1 year ago

How do I check my access logs? There is no error in all the logs. I am able to access the Endpoint from my browser, and I am not forcing https

UnamSanctam commented 1 year ago

Usually they are at the same place as the Apache error logs, in the web panel try creating a new configuration inside the "Configurations" tab and then see if it's still there after reloading.

slezercc commented 1 year ago

the config doesnt stay after I create it and reload the page.

UnamSanctam commented 1 year ago

Then it cannot write to the database, did you set the permissions? You can try setting the permissions of the db folder and db file to 777 just to see if it's due to an incorrect owner.

slezercc commented 1 year ago

I just did chmod 777to the db folder and unamwebpanel.db and its still doing the same, what do I need to do? I ran this: sudo chown -R $USER:$USER /var/www/html/mypanelfolder

UnamSanctam commented 1 year ago

Did you do the same for the html folder (sudo chown -R $USER:$USER /var/www/html)? If you check all the permissions do they look right?

slezercc commented 1 year ago

I just ran that command and the issue persists, do i need to change $USER to something else or I paste the line as is? All the permissions look right, maybe I could try to set them to 777 for the whole panel folder?

slezercc commented 1 year ago

just waited 10 hours and there is still no miners.

UnamSanctam commented 1 year ago

Yes it can't add any miners if your webserver doesn't allow the database to be written to, print the permissions of all the files and post screenshots here.

slezercc commented 1 year ago

which command do I run to do so?

UnamSanctam commented 1 year ago

You can do ls -l to list the files in the current directory and their permissions.

slezercc commented 1 year ago

image

UnamSanctam commented 1 year ago

Right so the db folder has 777 and the rest has 775. Since you're not using the web panel in the web directory then does the parent folder have permissions 777 as well?

slezercc commented 1 year ago

this is the permissions for the folder that contains the panel files image

UnamSanctam commented 1 year ago

Since you're testing then that should have 777 probably as well.

slezercc commented 1 year ago

I ran chmod -R 777 redacted/ But when I create a config it still doesnt save it

Edit: endpoint-errors.log now says: ENDPOINT ERROR: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database, LINE: 66

Those are the new permissions: image

Why is it unable to write to the database??? The permissions are 777...

slezercc commented 1 year ago

Do I need to chown the file?

edit: I did: sudo chown -R www-data:www-data /panelfolder/ The same thing happens. im on the edge of jumping off a bridge ngl

slezercc commented 1 year ago

lol. I rebooted my vps and it worked. Thanks for your help, I'll assume the problem was I needed to chown the panel folder to www-data.