Instructions to upgrade Apache

Posted on 2003-02-24
Medium Priority
Last Modified: 2010-03-04

I'm thinking of installing Apache via source, because I don't know how to get the fine control I need (individually disable certain modules and enable others, choose which directories things end up in, get any possible speed gains by compiling for my processor, etc) via an rpm-based install (but I'll give the points to anyone who can show me).

So I'll build my config file, and make, etc, and all will be fine, but what happens when I want to upgrade?  

If I grab the new source, I can use the same config file, and make, make install, but will it overwrite my existing install without overwriting my website?  Will it overwrite my painstakingly configured httpd.conf?

Lastly, how can I make my source install start automatically?  I'm sure it's something in the rc world, but does that need to be re-done after each upgrade as well?

Thanks for your help

Question by:edmund_mitchell
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8009994

If you didn't really choice your Linux Version, you should  adopt debian one. Nothings is more easy on debian, just by doing: apt-get upgrade apache, then you get the last stable version, you keep your conf file, etc...

I've forgotten the RedHat command, just watch the man on rpm.

1) First find your httpd.conf, you should find it around /etc/apache.
2) copy all your config files in a temp directory
3) Upgrade with rpm command
4) It should works, and you have nothing to be worry about your website, the only files touch, should be the conf file
and of course, binary and modules.

It should put the stop/start file in the rcX.d directory

Or watch in the inittab file to check your initdefault runlevel.



Expert Comment

ID: 8015347

You just need to be cautious when upgrading a source-compiled version, i.e. take a copy of your httpd.conf just to be on the safe side.

The default DocumentRoot is /usr/local/apache/htdocs, so the install will create an index.html there. However, its unlikely that's where your real website is so no problems with the website being overwritten.

With source-compiled Apache, the start/stop commands are different from the Red Hat RPM.

To start, run /usr/local/apache/bin/apachectl start

If you put this command in /etc/rc.local it will start automatically on boot.


Accepted Solution

heskyttberg earned 800 total points
ID: 8029914

I would strongly recommend against compiling it by your own in redhat.

You would have to do this first rpm -e apache, this might delete your httpd.conf.

If you just want compiled speed download the RedHat apache.src package and do a rpm --rebuild

This will still give a RH binary but with som optimisations.

The final built package will be found in /usr/src/redhat/

There is SPEC, SRC BUILD and so on I think the final package can be found under BUILD.

If you really want to hack now, you can go into SPEC dir edit the apache.spec or if it is httpd.spec and change any of the configure parameters.

Then do cd .. ; rpm -some switch SPEC/httpd.spec

Now you will get RPM files with your own build specifications.

Isn't this great.

As far as loading unloading modules the RedHat apache RPM is well built this is just done in the beginning of httpd.conf.

For the option to rebuild using the spec file do man rpm, it will be displayed in there I don't remeber, but I have done this with a few packages.

Hope this helps.

/Hans - Erik Skyttberg

Author Comment

ID: 8033348
That's the ticket.  Many thanks for a very useful answer.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question