cmh Posted April 10, 2021 Posted April 10, 2021 (edited) I want to install a discordbot, but I can't even run a simple application. Where is my mistake? Server; tommy, user cmhI deployed few days ago. app.js register app where is my mistake?on the url i have 404 Edited April 13, 2021 by cmh
cmh Posted April 12, 2021 Author Posted April 12, 2021 Any solutions?i redeployed app to real project btw.
Krydos Posted April 14, 2021 Posted April 14, 2021 Posted on discord: Krydos — Today at 12:42 AM Try renaming /home/cmh/public_html/.htaccess for a minute and see if it works Your domain is automatically redirecting to add www to the front and that's probably causing the 404 error The other issue I'm seeing is your application manager shows the application is supposed to be located at /home/cmh/pingpbot/ but that directory doesn't exist. There is a pingbot directory (without the p in the middle) so probably just a typo.
cmh Posted April 14, 2021 Author Posted April 14, 2021 (edited) I still have 404, but now I have a button. if i press it (no error), the bot does not start Edited April 22, 2021 by cmh
cmh Posted April 14, 2021 Author Posted April 14, 2021 (edited) i have message, but bot still is down Edited April 22, 2021 by cmh
cmh Posted April 14, 2021 Author Posted April 14, 2021 (edited) new error Edited April 22, 2021 by cmh
Flaze Posted April 14, 2021 Posted April 14, 2021 Make sure you have all the dependencies installed inside the node_modules folder.
cmh Posted April 14, 2021 Author Posted April 14, 2021 (edited) Make sure you have all the dependencies installed inside the node_modules folder.i copy this folder from my pc. should be ok, but...also i found log npm WARN union-slave@1.0.0 No repository field. audited 94 packages in 1.419s 4 packages are looking for funding run `npm fund` for details found 0 vulnerabilities 1618419982.98945 Task completed with exit code 0 Edited April 15, 2021 by cmh
Krydos Posted April 16, 2021 Posted April 16, 2021 Literally all I did was log in to your account and click the button to enable your node app in the application manager, and now it works. http://bot.cmh.heliohost.org/ Something you may not be aware of is this In order for the Node.js application to be deployed it requires an Apache restart so this could take anywhere from a few minutes to a few hours. If it's been more than 2 hours and it still isn't working, please open a customer service ticket and let us know.Source: https://wiki.helionet.org/tutorials/node.js 1
cmh Posted April 16, 2021 Author Posted April 16, 2021 (edited) Unfortunately, no. Yes, the server at the domain displays the message, but the bot does not work, even status is Online. And I think that it started because of the cron. And now I can not restart it, kill the process P_text - hosted on heliohost. HelioBot - on my pc Sorce Code is same Edited April 22, 2021 by cmh
Krydos Posted April 18, 2021 Posted April 18, 2021 I think you're confusing and combining guides. The discord bot guide is more applicable to what you're trying to do I think. https://wiki.helionet.org/tutorials/discord-bot This guide is for starting and stopping a bot that runs more or less constantly. You'll still want to use python cgi to start and stop your bot, but instead of a python script for the bot you'll be running a node script. This is a passenger node.js guide. https://wiki.helionet.org/tutorials/node.js This guide is for setting up a node.js website through passenger. The way passenger works is when someone requests your page passenger starts up the node app and the visitors gets to interact with the website. Then after the website visitor goes away passenger stops the node app to save system resources. This obviously won't work well for a bot because you don't want your bot to only be online for 5 minutes everytime someone visits your website.
cmh Posted April 18, 2021 Author Posted April 18, 2021 Maybe. In this case, how i should stop/start my bot? for example src in .js located /home/myname/pingbot/Main file index.js i see sample only for python
gleason Posted April 21, 2021 Posted April 21, 2021 you use a python script to start and stop the botstart.py in public_html/cgi-bin:#!/usr/bin/python3.7import os, subprocess, signalprint("Content-Type: text/html\n\n")counter = 0p = subprocess.Popen(['ps', '-u', 'mule'], stdout=subprocess.PIPE)# must match your username --------^^^^^^^^out, err = p.communicate()for line in out.splitlines(): if 'node'.encode('utf-8') in line:# ^^^^^^^^^^^----- this has to match the filename of your bot script counter += 1 print("Bot already running.")if counter == 0: subprocess.Popen("/usr/bin/node /home/mule/node/index.js", shell=True)# ^^^^^^^^-- be sure to update it to your username print("Bot started!")and stop.py in same location:#!/usr/bin/python3.7import os, subprocess, signalprint("Content-Type: text/html\n\n")counter = 0p = subprocess.Popen(['ps', '-u', 'mule'], stdout=subprocess.PIPE)# must match your username --------^^^^^^^^out, err = p.communicate()for line in out.splitlines(): if 'node'.encode('utf-8') in line:# ^^^^^^^--- this has to match the filename of your loop counter += 1 pid = int(line.split(None, 1)[0]) print("Stopping bot.") os.kill(pid, signal.SIGTERM)if counter == 0: print("Already stopped.")
cmh Posted April 21, 2021 Author Posted April 21, 2021 (edited) I have no idea why it works for you, but it doesn't work for me. I took your code, but I see error 500. Of course, all files and folders have 755 permissions, including cgi-bin. start.py: # Edited April 22, 2021 by cmh
cmh Posted April 22, 2021 Author Posted April 22, 2021 (edited) Test page with code #!/usr/bin/python3.7 print("Content-Type: text/html\n\n") print("Heliohost rules!") also not displayed Edited April 22, 2021 by cmh
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now