Install Apache 2.2.24 in CentOS

Source: Internet
Author: User
Tags install php centos

1. Unzip the installation package: tar-zxvf httpd-2.2.24.tar.gz
2. Enter the unzipped installation package: cd httpd-2.2.24
3. configure the compilation and installation path and parameters:./configure -- prefix =/opt/httpd/-- enable-so -- enable-ssl -- enable-rewrite -- with-zlib
4. Compile and install: make & make install
5. Clear the compilation cache file: make clean
6. Configure the startup item: cp/opt/httpd/bin/apachectl/etc/rc. d/init. d/httpd
7. Grant execution permission: chmod + x/etc/rc. d/init. d/httpd
8. Modify the local name:

Vim/opt/httpd/conf/httpd. conf (: set nu |: 98)

ServerName 127.0.0.1: 80
9. Solve the problem of service httpd does not support chkconfig:

Vim/etc/rc. d/init. d/httpd
# Chkconfig: 2345 10 90
# Description: Activates/Deactivates Apache Web Server

10. add a system startup item: chkconfig -- add httpd
11. Boot: chkconfig httpd on
12. start Apache service: service httpd start


Problems encountered during apache installation and solutions:

1. [warn] module php5_module is already loaded, skipping --> httpd under the conf directory of apache installation. A line of LoadModule php5_module modules/libphp5.so is repeated in the conf file. Just delete the duplicate line.

2. Cannot load /... /Libphp5.so into server :/... /Libphp5.so: undefined symbol: _ efree --> This error occurs because apache is not disabled when php is reinstalled. Solution: go to the php installation directory, execute "make clean", and then install php again. Remember to disable apache before installation.

3. When installing apache2 from the source code, the following error occurs: cannot install 'libaprutil-1. La' --> because configure has not been cleared once, it needs to be cleared. You can delete the source code directory, decompress the source code, reinstall it, or make clean.

4. apache startup error (98) Address already in use: make_sock: cocould not bind to address [:]: 80

--> # Netstat-lnp | grep 80

# Process with ps port 80

# Kill-9 process with Port 80 (more than one process may exist)

Related Article

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.