Jump to content

Recommended Posts

Posted

Hello! On hosting accounts, secure shell access (SSH) is disabled for security reasons. However, it is possible to run jailed shell commands using Plesk's Scheduled Tasks (cron jobs) feature. In many cases, SSH is not actually necessary.

If you let us know what command you want to run, and we'll be happy to investigate other ways to accomplish the same task without SSH.

If you absolutely require SSH access, you will need a VPS. We offer a range of VPS plans, and a 10% discount when you pay for 6 months upfront. You can view the VPS plans we offer here: https://heliohost.org/vps/

Posted (edited)

I wanted to know the details of the server, installed software version, disk space usage in my space, etc. like

uname -os

ldd --version

python --version

node -v

du -sh *
du -sh .[^.]*

Edited by elevatecore
Posted

You can view how much space (out of the 1000 MB) is being used by checking inside Plesk > Statistics from the left side menu. Please note: Plesk doesn't recalculate in real time, so there's a delay between uploading and the statistics reflecting what's in your account. 

Node versions available on the Tommy server are: 23, 22, 21, 20, 18, 16. 
You can view them by logging into Plesk and going to: Websites & Domains > Get Started > Node.js button > Click on the Node.js Version value to view other versions of node available. 

A word of caution about Node: Node apps often require a lot of server resources, and exceeding the account load limits will cause your user account to be suspended for high server usage. You can keep an eye on your account load here: https://heliohost.org/dashboard/load/

I'll escalate this thread to the root admins for your OS-related questions.

Posted

Thanks for the info. This helps to some extent. I don't want run node app as service on any dedicated port. I want to execute a short-lived javascript like node getuser.js under (php shell_exec / popen) but I see my php configuration: disable_functions:opcache_get_status,exec,passthru,proc_nice,proc_open,shell_exec,system,popen,pcntl_exec

I don't want to run any service forever, just use node based code to run per request and exit. How can I do that?

Thanks in advance.

Posted

PHP functions such as proc_open(), exec(), popen(), etc. are disabled on our shared hosting servers for security reasons. If you need these, you will need to get a VPS. 

Can you provide more details about why you want to run these per-request scripts, and what you hope to accomplish with them? This will help us determine if there's an alternative method you can use that would be permitted on the shared hosting servers. 

Posted

I want to generate some mock data for my demo/workshop using node (javascipt) json. I don't want to run a dedicated node+express server wasting server resources like memory/cpu. These mock api calls will be called only during a workshop/demo otherwise there is no need of this service. So I have written a simple javascript to generate random json payload based on the request type. that I want to execute through simple php-node.php router where I will use shell_exec to run the node script on demand and it ends the request. Want to keep it simple and efficient on-demand execution instead of running a service forever on a different port. that causes CORS issue as well. Do you have a better alternate solution?

Posted

You could just use CGI or PHP. Can you give an example of the json payload you want it to send, and where you want it to be sent to?

Posted (edited)

I know it can be done with PHP/perl, I stopped coding in PHP/Perl for more than a decade now. I wanted to use JS tech stack to demonstrate for the workshop that I conduct, And I have many light-weight JS APIs, that don't want rewrite in PHP/Perl/Python now. BTW, what version of python is available? I prefer to use 3.12+

---

const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

const randomCPU = () => parseFloat((Math.random() * 100).toFixed(1));
const randomStatus = (cpu) => cpu > 80 ? "warning" : "healthy";

export default async function* serve(request) {
  let length = parseInt(request.query_string?._length || 10, 10);
  if (isNaN(length) || length < 1) length = 1;
  if (length > 100) length = 100;

  for (let i = 1; i <= length; i++) {
    await sleep(100);
    const cpu = randomCPU();
    yield {
      chunk_id: i,
      event: "telemetry_pulse",
      timestamp: new Date().toISOString(),
      metrics: {
        cpu_utilization: cpu,
        memory_free_bytes: Math.floor(Math.random() * 1000000) + 10000000,
        status: randomStatus(cpu)
      },
      engine: "ES Modules (.mjs)"
    };
  }
}

Just FYR. This JS generates max 100 dynamic streaming records, which will be consumed in browser UI to plot a graph or table or list...

Edited by elevatecore
Posted

Just to summarize, the bottom line is I can't run shot-lived JavaScript via PHP. But I can run dedicated node+express (app.js) on dedicated port (ex:3000) 24/7, which will use memory and CPU and may hit the daily limit, is that right?

Posted

You could start the short lived Javascript scripts via a dozen other ways, but not PHP shell. Unfortunately for the world Matt Mullenweg and Mike Little decided to use PHP to write Wordpress so bots are constantly looking for idiots dumb enough to install Wordpress. If we enable popen(), exec(), shell_exec() etc in PHP it will just make it even easier for hackers to send spam and set up phishing sites on our servers.

Posted (edited)

Sure Krydos, I totally understand the security concern and I respect that. I will find a way to run JavaScript on this platform as I am just going through the wiki on Node.js (I think, the Passenger is already doing what I was expecting) to avoid running node service 24/7👍. I haven't looked at the doc earlier as I came from other hosting service-hack and thought of the same approach - that was my bad. I think we don't need php/cgi middleware to run node scripts here. Looks like I can run node scripts natively without burning memory/cpu.👍👏

Apart from this. I just want to bring it to your notice that your payment system charged me $1 extra than the expected $2. Though $1 is insignificant and for the service you're offering it can be ignored, but it will be translated more than 100 times in other countries. I'm bringing it to your notice as you're the CEO and so need to know how your system works. People expect transparency in communication especially when money is involved. Please don't get me wrong, I could have ignored and moved on but felt like bringing it to your notice. Nothing against your service to the community. 🙏

Thanks for taking your time to understand my requirement, much appreciated.

Have a great day.

Paypal.png

Edited by elevatecore
Posted
10 hours ago, elevatecore said:

I think, the Passenger is already doing what I was expecting) to avoid running node service 24/7

Correct, if your Node.js doesn't get any page hits for 5-10 minutes it gets shut down to avoid wasting memory and CPU.

10 hours ago, elevatecore said:

I just want to bring it to your notice that your payment system charged me $1 extra than the expected $2.

It definitely wasn't us that charged you an extra $1. We only got $1.44 after $0.56 fees from you.

image.png.05f89e1263e1376124ce2057e4a28625.png

I've never seen anyone get charged a different amount from what our website lists before. I'm guessing your bank charged you the extra $1 for some reason. Maybe call them and ask about it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...