Issues compiling Apache via SSH

Discussion in 'Linux, BSD and Other OS's' started by athomas, Apr 18, 2009.

  1. athomas

    athomas Geek Trainee

    Likes Received:
    0
    Trophy Points:
    0
    I followed this to the "T" and I am still not able to hit anything via http:

    Compiling and Installing - Apache HTTP Server

    I try to run that $ apachectl start command, and it doesn't see it as a command. Maybe someone can compile for me and tell me how it's done on here? Or, give me a less crap tutorial?
     
  2. Anti-Trend

    Anti-Trend Nonconformist Geek

    Likes Received:
    118
    Trophy Points:
    63
    First question: why would you want to compile Apache by hand?
     
  3. athomas

    athomas Geek Trainee

    Likes Received:
    0
    Trophy Points:
    0
    Whelp it's a terminal only sever, no gui or anything... didn't know there was an easier way.
     
  4. Anti-Trend

    Anti-Trend Nonconformist Geek

    Likes Received:
    118
    Trophy Points:
    63
    You don't need a GUI for Apache, that's definitely true. None of my servers run a GUI; it'd be a waste of resources. But that certainly doesn't mean you have to compile apache. Most of the time, you will want to rely on your distribution to provide the LAMP stack. That is, Linux Apache MySQL PHP.
    It's a nightmare to manage all that by hand, since there are many dependencies that will have to rebuilt whenever there is an update.

    What distribution is your server running? Also, is this a home lab, or a server in a DC someplace?
     
  5. athomas

    athomas Geek Trainee

    Likes Received:
    0
    Trophy Points:
    0
    It's CentOS 5.2, it's VM I got from somewhere outside of my own DC for testing and messing around with? I don't do much with Unix in my own company so I figured it'd be worth a shot.
     
  6. Anti-Trend

    Anti-Trend Nonconformist Geek

    Likes Received:
    118
    Trophy Points:
    63
    This server also runs CentOS 5.x, and as you can tell it works quite well. With CentOS you definitely don't want to compile apache and friends by default! It's an RPM-based distro with a good package manager that will handle all of that for you, including dependencies and updates down the road. Unfortunately, to be frank it sounds like you've already made a mess of things. It'd be a lot more straight-forward if you could start from a clean slate. Do you think the hosting company would be kind enough to respin that VPS for you?
     
  7. athomas

    athomas Geek Trainee

    Likes Received:
    0
    Trophy Points:
    0
    Well I had Fedora 10 on it last night, but I am used to CentOS and similar so I reinstalled with that. But since they only manage the physical box and connectivity and etc they are zero help. So all I have to go on is forums and Google, which has been no help.
     
  8. Anti-Trend

    Anti-Trend Nonconformist Geek

    Likes Received:
    118
    Trophy Points:
    63
    Well, do you have physical access to the system in order to reinstall clean? What I'm afraid of is that you have a half-assed apache install that might cause problems when you install apache through the package manager.
     
  9. athomas

    athomas Geek Trainee

    Likes Received:
    0
    Trophy Points:
    0
    No physical access. I had it working before on Fedora 10, but for some reason on CentOS it won't work. No httpd service in init.d, I'm used to just saying 'service httpd start'

    Not sure what the problem is.
     
  10. Anti-Trend

    Anti-Trend Nonconformist Geek

    Likes Received:
    118
    Trophy Points:
    63
    Well, like I said, building from source on RPM-based distros like Red Hat/CentOS or Fedora is a bad idea. Try doing a make uninstall on apache, purging out the build tools like GCC (use yum, the package manager for this!), and deleting all the temp apache source stuff when you're finished. Then use yum to install packages you need. For example, if you wanted to install apache, mysql, apache and php5:
    Code:
    # yum install httpd php mysqld php-mysql
    ... yum will take care of the rest. If these things are aleady installed and are broken, try replacing 'install' with 'reinstall'. Unless you have a good reason, always install software with your distro's package manager. Avoid drop-in ready-made environments like XAMPP and the like, because it's a nightmare to maintain. Especially avoid compiling from source, since this can make a mess of your OS, and leave it looking like a typical Windows install with half uninstalled bits of crap everywhere. Instead, install and remove software with the package manger whenever possible. If there's something you have to build for some strange reason, and this should be really rare in a typical environment, build an RPM and install it with the package manager.

    As for running LAMP on CentOS, I'm using the following extra repos on my Cent-based LAMP servers:

    RPMforge - RPMRepo Wiki
    atomicrocketturtle.com :: digital turtlist - Home

    These will add extra packages and some more up-to-date ones than those shipped with CentOS/RH. And it all goes through the package manager. :)

    Good luck!
     

Share This Page