1

Ok, before you just go and say no, please read. I have seen a similar question but I think this one is slightly different.

I'm trying to install node.js on a shared hosting environment. Following this tutorial http://dandean.com/category/code/2010/installing-node-js-on-a-dreamhost-shared-server/ I have managed to eventually clone the git project after my host opened the git port, where I then hit the wall of having no c compiler.

When asking my host about this, they said I could recompile the code elsewhere and reupload, but c compiler is something not included.

My shared server is running CentOS.

I'm pretty new to this sort of thing and have only dabbled in nix CLI for a few months so you may have to explain a few things in more detail than you normally would.

Thanks in advance.

4
  • 4
    What is your concern with compiling on a different machine and then copying onto this box? That's definitely the simplest approach and the one you should try to follow if possible. Jan 21 '11 at 21:36
  • 1
    Your best bet might be to do what Phil suggests. Follow the steps on blog.ibd.com/how-the-world-works/…
    – teknikqa
    Jan 21 '11 at 21:39
  • This is certainly the way things work in another world - that of most commercial closed-source software, particularly for Windows, but not exclusively so. The vendor compiles and packages it on their machines, and then you install it on yours. Voila.
    – mfinni
    Jan 21 '11 at 21:42
  • I wasn't sure how practical doing something like that was, but sounds like what I might end up doing. thanks. Jan 21 '11 at 21:43
7

It sounds like your best bet will be to take the tutorial above, and follow those directions on another machine. If you don't have access to one, you can get a CentOS Live CD from the CentOS project, and boot into that live CD.

Basically, you'll download the stuff needed to build node.js to an alternate location, build it, and then copy/upload it to your webhost.

1
  • I expect this will work, however I have no end of problems. For example not being able to boot CentOS live CD on any of my 4 machines, and then the VM of the live CD crashing randomly. Gave up and moved on. Feb 16 '11 at 11:22
5

You cannot compile C without access to a C compiler. This is like trying to bake a cake with no oven.
You have three options immediately available:

  1. Do what your hosting provider suggested: Find a server with the same OS and compile your stuff there (you probably want to statically link it too), then upload it to your server.
    If you have your own Linux box you can compile stuff there...

  2. Convince your host to install a C compiler (a box that can't build software is fairly well neutered...)

  3. Find a pre-compiled version of what you're looking for and install it that way.
    This is probably easier if you don't have much experience.

4
  • 1
    Hmmm. Perhaps this should be asked on cooking.stackexchange.com
    – mattdm
    Jan 21 '11 at 21:38
  • 2
    Ahaha! cooking.stackexchange.com/questions/4626
    – mattdm
    Jan 21 '11 at 21:39
  • 1
    @mattdm so what you're saying is I should put the server in the oven? Or the cake pan in the hot aisle? I'm confused! :'(
    – voretaq7
    Jan 21 '11 at 21:42
  • you guys! =]. Might try for your 3rd point raised, as I expect someone else might have compiled it for centos using that directory/commands before. Thanks for the suggestion. Jan 21 '11 at 21:44
1

I haven't verified this, but these steps should give you an idea of what to do.

  • Download and extract gcc to a tmp folder (say ~/bin/gcc).
  • Modify permissions as necessary. (Probably do a chmod +x ~/bin/gcc/gcc or similar)
  • Add the path to this location to your ~/.bash_profile (export PATH="$HOME/bin:$PATH")
  • Add an alias to gcc under ~/.bash_profile (alias gcc=$HOME/bin/gcc/gcc)

gcc should work, unless you need additional binaries.

Note: You may have to tweak these to get it to work as you need.

Update: See https://stackoverflow.com/questions/216102/installing-gcc-3-4-6-in-rhel4

2
  • On my shared host I am in a jailed shell, in which gcc is prohibited. Jan 21 '11 at 21:30
  • Shared hosting installs do not have root and cannot install stuff. Jan 21 '11 at 23:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.