Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
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. –  Phil Hollenback 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. –  Relequestual Jan 21 '11 at 21:43

3 Answers 3

up vote 6 down vote accepted

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.

share|improve this answer
    
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. –  Relequestual Feb 16 '11 at 11:22

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.

share|improve this answer
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. –  Relequestual Jan 21 '11 at 21:44

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 http://stackoverflow.com/questions/216102/installing-gcc-3-4-6-in-rhel4

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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