Run on cheap webspace

47 views
Skip to first unread message

Frederick Virchanza Gotham

unread,
Jan 31, 2024, 5:45:14 AM1/31/24
to Compiler Explorer Discussion

I have cheap webspace on a remote Linux server, and I want to run compiler explorer on it.

So far I've had to overcome a few obstacles:

1) Remote server hasn't got NodeJs installed
2) Remote server doesn't allow mprotect to set a page as executable
3) Remote server doesn't allow mprotect to set an executable page as writeable
4) Remote server only has glibc v2.27, so the prebuilt binary for NodeJs v20 won't run

So I had to download an old image of Ubuntu that uses glibc v2.27, and I used it to build NodeJs as a static executable (i.e. I linked it with the command line option "-static").

NodeJs composes CPU instructions at runtime and executes them -- that's why it uses mprotect as described above -- and so it won't run on my remote server. I had to edit the NodeJs source code so that it passes the option "--jitless" to v8 so that it doesn't try to do 'Just In Time' compilation at runtime.

So now I have a NodeJs binary (v21.6.0) that runs successfully on my remote web server. I can do "make run-only" and it starts the server listening on 10240.

Now my final problem is that because I have cheapo webspace, I can't map TCP port number 10240 to a public port such as 80. So I think I need to use PHP to get it to behave as a proxy -- I haven't got this part working yet.

Has anyone gotten this working? I'll share all my work when I have this working so that anyone can run compiler explorer on their cheapo webspace.

Frederick Virchanza Gotham

unread,
Jan 31, 2024, 6:04:56 AM1/31/24
to Compiler Explorer Discussion
On Wednesday, January 31, 2024 at 10:45:14 AM UTC Frederick Virchanza Gotham wrote:

Now my final problem is that because I have cheapo webspace, I can't map TCP port number 10240 to a public port such as 80. 
So I think I need to use PHP to get it to behave as a proxy -- I haven't got this part working yet.


I very nearly have it working:

    http://www.virjacode.com/godbolt1.php

I think I just need to find the right script PHP script for doing the proxying.
 

Frederick Virchanza Gotham

unread,
Jan 31, 2024, 6:33:05 AM1/31/24
to Compiler Explorer Discussion
On Wednesday, January 31, 2024 at 11:04:56 AM UTC Frederick Virchanza Gotham wrote:

I very nearly have it working:

    http://www.virjacode.com/godbolt1.php

I think I just need to find the right script PHP script for doing the proxying.
 


I've tried a second PHP script here:

      http://www.virjacode.com/godbolt3.php

Does anyone know why the webpage isn't displaying properly?

Frederick Virchanza Gotham

unread,
Jan 31, 2024, 7:27:30 AM1/31/24
to Compiler Explorer Discussion
On Wednesday, January 31, 2024 at 10:45:14 AM UTC Frederick Virchanza Gotham wrote:

So far I've had to overcome a few obstacles:


I forgot to mention that I had to edit "md4.js" so that it doesn't use WebAssembly -- because  NodeJs can't use WebAssembly if you pass "--jitless" to v8.
Reply all
Reply to author
Forward
0 new messages