I'm trying to install the newest version of apache on my centos server. I did the following:

Download   $ wget http://httpd.apache.org/path/to/latest/version/
Extract     $ gzip -d httpd-2_0_NN.tar.gz
$ tar xvf httpd-2_0_NN.tar
Configure   $ ./configure 
Compile     $ make
Install     $ make install
Test            $ PREFIX/bin/apachectl start

And that all worked except the last step, when i type apachectl start it says 'command not found'. I ran this command from /usr/local/apache2/bin/ where it is installed but no cigar. Any idea what i am doing wrong? Thanks.

  • 2
    The current version in the official repositories is 2.2.3. Any reason you can't use it? – Scott Pack Jan 11 '11 at 18:18
  • i'm confused why every1 thinks it is bad to install new versions of software? I just completed installing 2.2.17 and got the 'it works!' page. So why not have a cigar? Their official site says 'This release represents fifteen years of innovation by the project, and is recommended over all previous releases!' See that, its recommended. – fivelitresofsoda Jan 11 '11 at 19:16
  • People think it is bad because, from the FAQ: "Server Fault is for system administrators and desktop support professionals, people who manage or maintain computers in a professional capacity." – mattdm Jan 11 '11 at 19:25

It's not working because you're literally giving it the string PREFIX/bin/apachectl start instead of replacing PREFIX with the location into which you installed Apache, as the instructions you are following intend.

In your case, that's apparently /usr/local/apache2, so run

/usr/local/apache2/bin/apachectl start

But, that still leaves us with the larger issue of Why Are You Doing This? The vendor packages provided by CentOS include bug fixes and security patches, and in fact are regularly updated to ensure that newly-discovered issues are fixed.

Meanwhile, Apache development within the 2.2.x branch is rather conservative, and there aren't major new features (if any!) you'll gain by going with 2.2.17 (the current latest). And, that's not even going into the fact that you seem to have gotten the rather old 2.0 version. Did you maybe want the incompatible, unstable 2.3 development version?

| improve this answer | |
  • i'm trying to install 2.2.17. The above quote was from their documentation on how to install it but its the procedure i followed. Centos offers really stable but really old software from the base repo. Php for example is 5.1.6 which is useless for me. I just thought i might as well have a newer apache too, how could it hurt me? – fivelitresofsoda Jan 11 '11 at 18:51
  • It can hurt you by increasing your maintenance load — you've now got a new thing you've got to watch individually for security vulnerabilities and update independently of your distribution as a whole. – mattdm Jan 11 '11 at 19:24
  • ok point taken. However you have to agree that upgrading php from 5.1.6 is a necessity. – fivelitresofsoda Jan 11 '11 at 19:27
  • Depending on your application, it may be. But don't make more work for yourself than necessary. – mattdm Jan 11 '11 at 19:30
  • It sounds like you are running Red Hat Enterprise Linux or CentOS 5.5. See: Actually, as of today, see: serverfault.com/questions/221251/… – mattdm Jan 13 '11 at 14:47

Is /usr/local/apache2/bin/ in your $PATH? Run echo $PATH on the command line to see.

If not, when in /usr/local/apache2/bin/ did you type in apachectl start or ./apachectl start?

If you left out the ./ then the shell is going to search in the various directories mentioned your PATH, and not find apachectl. If you have the ./ before the executable, it will run it from the directory you're in.

| improve this answer | |

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.