Upgrade Apache to the latest version

Source: Internet
Author: User
Tags port number tomcat

Upgrading Apache to the latest version is not complicated, but because it involves not stopping the operation of an existing Apache instance, be careful.

Broadly divided into three steps:

Compiling the new Apache,

Configure the new Apache,

Replace the old Apache.

Here's a slow way:

1. Compile the new Apache,

Need to download the latest SRC on the official website, what depends on the package, please refer to the download of the source code package inside the Readme and install.

If you need to install the APR package, please download it to the official website and copy it to the correct location. Then there is:

./configure
Make
Make install

Installed to/usr/local/apache2 by default, you can specify the installation location in the Configure parameter.


2. Configure the new Apache,

If installed in the above location, then the configuration file in/usr/local/apache2/conf, at this time can be used in the Apache configuration file copied over,

If you can put the personalized configuration in the Conf file you created, such as can be called httpd.local.conf file, so that you can easily upgrade later, modify the configuration.

If you need any components, install them at this time. If you need to enable which module, enable it at this time.

After modified, you can test, before testing, remember to modify the listening port number, do not use the default 80.

During the test, you will find the missing configuration and the wrong configuration. After passing, you can change the port number back.

The command to start the new Apache is in the/usr/local/apache2/bin directory, called Apachectl.

If you intend to start the new Apache as a service, you can copy this file to/ETC/INIT.D and add it to the system service, for example, in SuSE,

CP apachectl/etc/init.d/apache2.4

Chkconfig-a apache2.4

For the service to look beautiful, you can copy the old Apache boot file from the beginning, that is, # # #BEGIN the section of INIT INFO.

In addition, the test, you may find the lack of libpcre or tomcat-connector, and so on, directly solve the line.

For example, you can use LDD httpd to see if a dynamic/static link library file is missing. What we need to do here is to be short of anything. Remember to repair, run a ldconfig, let Apache find.

Then, check all the Apache configuration files to see if there are any configuration files that refer to the old Apache path, and if so, replace them with a new path.


3. Replace the old Apache. This is the final step, to be very careful, first stop the old Apache, for example

Service Apache2 Stop

Then, start the new Apache, for example

Service apache2.4 Start

After confirming the business OK, remove the old Apache service, for example

Chkconfig-d apache2

At this point, a new Apache instance has been run. The next thing to do is to see what's in the system that relies on the old Apache, all of which are modified to rely on the new Apache.


A little supplement, if you use MOD_JK, be careful,

You need to explicitly specify the value of the worker's connection_pool_size in the Worker.properties file, and change it to how large. This is generally the same as the value of Threadsperchild in the MPM section of the Apache configuration file. Otherwise, the runtime will have a problem. An error message similar to this can appear in Mod_jk.log:

AJP_CONNECTION_TCP_GET_MESSAGE::JK_AJP_COMMON.C (1350): (Worker3) can ' t receive the response header message from Tomcat, Network problems or Tomcat (172.16.7.16:8009) is down (errno=11)



Reference, recommended to see Apache and related components of the official website information, if you look at Chinese, here are a few recommended.

1. Compile and install Apache http://www.cnblogs.com/alexqdh/archive/2012/11/20/2764810.html

2. apache2 Shared library Libpcre not found http://www.cnblogs.com/eastson/archive/2012/06/25/2561575.html when booting

3. Under Server apache2.4.* Virtual host configuration forbidden you do have permission to access/on this server. Http://www.cnblogs.com/unofficial/p/3931653.html





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.