Installing the following packages requires gcc, please install gcc yum install gcc
1. Install apr-1.5.1.tar.gz
[plain] view plaincopy
- tar -zxvf apr-1.5.1.tar.gz
- cd apr-1.5.1
- ./configure --prefix=/usr/local/apr
- make
- make install
2. Install apr-util-1.5.4.tar.gz
[html] view plaincopy
- tar -zxvf apr-util-1.5.4.tar.gz
- cd apr-util-1.5.4
- ./configure --with-apr=/usr/ local/apr
- make
- make install
3. Install pcre-8.36.tar.gz
[plain] view plaincopy
- tar -zxvf pcre-8.36.tar.gz
- cd pcre-8.36
- ./configure --prefix=/usr/local/pcre
- make
- make install
4. Install httpd-2.4.10.tar.gz
[plain] view plaincopy
- tar -zxvf httpd-2.4.10.tar.gz
- cd httpd-2.4.10
- ./configure --prefix=/usr/local/apache --with-apr= /usr/local/apr/ --with-pcre=/usr/local/pcre/
- make
- make install
5. Modify /usr/local/apache/conf/httpd. confFind #ServerName www.example.com:80 and change it to ServerName localhost:80
6. Add http to service
[plain] view plaincopy
- cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
7. Modify /etc/rc.d/init.d/httpd Add
[plain] view plaincopy under #!/bin/bash
- # chkconfig: 2345 50 90
- # description:Activates/Deactivates Apache Web Server)
8. Start apache
[html] view plaincopy
- service httpd start
9. Verify whether apache starts successfully
[plain] view plaincopy
- lsof -i:80
The following output proves that apache is started
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEhttpd 4158 root 4u IPv6 50349 0t0 TCP *:http ( LISTEN)httpd 4159 daemon 4u IPv6 50349 0t0 TCP *:http (LISTEN)httpd 4160 daemon 4u IPv6 50349 0t0 TCP *:http (LISTEN)httpd 4161 daemon 4u IPv6 50349 0t0 TCP *:http (LISTEN)
The above introduces the installation of apache24 on Centos66, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.