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)