✓ Tarzxvfapr-1.4.6.ta
Apache2.4.2 + mysql5.5.7 + php5.4 Apache install wget http://mirror.bjtu.edu.cn/apache//apr/apr-1.4.6.tar.gzwget http://mirror.bjtu.edu.cn/apache//apr/apr-util-1.4.1.tar.gzwget http://apache.etoak.com//httpd/httpd-2.4.2.tar.gztar zxvf apr-1.4.6.ta
Apache2.4.2 + mysql5.5.7 + php5.4
Install Apache
wget http://mirror.bjtu.edu.cn/apache//apr/apr-1.4.6.tar.gzwget http://mirror.bjtu.edu.cn/apache//apr/apr-util-1.4.1.tar.gzwget http://apache.etoak.com//httpd/httpd-2.4.2.tar.gztar zxvf apr-1.4.6.tar.gzcd apr-1.4.6./configure –prefix=/usr/local/aprmakemake installtar zxvf apr-util-1.4.1.tar.gz./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/makemake installtar zxvf httpd-2.4.2.tar.gzcd httpd-2.2./configure --prefix=/usr/local/apache2 --enable-so --enable-mods-shared=all --enable-vhost-alias --enable-expires --enable-rewrite --enable-authn-dbm=shared --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/makemake installcp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpdchmod 755 /etc/rc.d/init.d/httpd/etc/rc.d/init.d/httpd start
Test
Lynx localhost
Remote connection failure. Disable the firewall.
Service iptables stop
Remote Access
If you do not want to disable the firewall, open port 80.
Iptables-I INPUT-p tcp -- dport 80-j ACCEPTservice iptables save # vi/etc/sysconfig/iptables add A line-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 80-j ACCEPT # service iptables restart // restart the Firewall
Install Mysql
Install mysql using rpm
Wget http://cdn.mysql.com/Downloads/MySQL-5.5/MySQL-server-5.5.27-1.linux2.6.i386.rpm
Wget http://cdn.mysql.com/Downloads/MySQL-5.5/MySQL-client-5.5.27-1.linux2.6.i386.rpm
Install mysql
Rpm-ivh MySQL-server-5.5.27-1.linux2.6.i386.rpm
Rpm-ivh MySQL-client-5.5.27-1.linux2.6.i386.rpm
Start mysql
/Usr/bin/mysqld_safe &
Add mysql service to auto start
View the running status of mysql
Service mysql status
Check whether mysql is in the auto-start list
Chkconfig-list
If you do not join
Chkconfig-add mysql
Php installation
Install common libraries
yum install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-serverswget http://cn2.php.net/distributions/php-5.4.5.tar.gztar zxvf php-5.4.5.tar.gzcd php-5.4.5./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-mysqli --prefix=/usr/local/php5 --disable-cgi --with-zlib --with-gettext --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soapmakemake installcp -p .libs/libphp5.so /usr/local/apache/modules
Modify apache configuration
# Make sure there's only ** 1 ** line for each of these 2 ctictives:
# Use for PHP 4.x:
# LoadModule php4_module modules/libphp4.so
# AddHandler php-script. php
# Use for PHP 5.x:
LoadModule php5_module modules/libphp5.so
Php5-script. php AddHandler
# Add index. php to your DirectoryIndex line:
DirectoryIndex index.html index. php
AddType text/html. php
# PHP Syntax Coloring
# (Optional but useful for reading PHP source for debugging ):
AddType application/x-httpd-php-source phps
Add the php configuration file to httpd. conf.
PHPINIDir/etc/php. ini
Start the gd library php. ini and add
Extension = curl. so
Session. auto_start = 1
Automatically start apache
Vi/etc/rc. d/rc. local
Join
/Usr/local/apache2/bin/httpd-f/usr/local/apache2/conf/httpd. conf
Statement:In this article, "centos installation of apache2.4.2 + mysql5.7 + php5.4" using the BY-NC-SA protocol for authorization.
For more information, see link:Http://blog.ueder.info/934.html