(apache2.4.7 php5.4.25 MySQL 5.5.23) compile and install

Source: Internet
Author: User
Tags chmod install php iptables phpmyadmin

Environmental requirements

GCC, gcc-c++, CMake, bison (possible) support

1.Yum install gcc gcc-c++ cmake Bison

2, modify the Yum configuration, to achieve the search local settings

Remove or rename/etc/yum.repos.d/centos-base.repo

Modify Vi/etc/yum.repos.d/centos-media.repo

      Baseurl=file:///mnt/cdrom

Enabled=1

  3, uninstall the original Apache, MySQL and so on    

Rpm-qa |grep MySQL is installed

Ps-le |grep Whether the MySQL process is started

    Yum Remove httpd Uninstall

4. Disable SELinux and Netfilter/iptables

Vi/etc/sysconfig/selinux

Netfilter/iptables Firewall (default 80 disabled)
iptables-f Disable

Resource pool Requirements

LIBXML2, Libmcrypt, zlib, libpng, JPEG, FreeType, GD, Pcre, Apr, and Apr-util libraries

  Installation steps

1, decompression. tar.gz TAR-ZXF
2./configure Configuration
3. Make compile
4. Make install, copy

----------------------------------------------------------------------

  Installing LIBXML2

./configure--prefix=/usr/local/libxml2/

----------------------------------------------------------------------

  Installing Libmcrypt
./configure--prefix=/usr/local/libmcrypt/--enable-ltdl-install

----------------------------------------------------------------------
  Installing zlib

./configure do not specify the installation directory (cannot be located after specified)

Uninstalling a program that does not specify an installation directory
Make install >/bakcup/zlib_20150905.install.log

----------------------------------------------------------------------

  Installing libpng
./configure--prefix=/usr/local/libpng/

----------------------------------------------------------------------

  Install JPEG to manually create the required directory first
Mkdir/usr/local/jpeg
Mkdir/usr/local/jpeg/bin
Mkdir/usr/local/jpeg/lib
Mkdir/usr/local/jepg/include
Mkdir-p/usr/local/jepg/man/man1 Create multiple directories at the same time
./configure--prefix=/usr/local/jpeg6/--enable-shared--enable-static

----------------------------------------------------------------------

  Installing FreeType
./configure--prefix=/usr/local/freetype/

----------------------------------------------------------------------

  Install GD to use the previously installed library
./configure--prefix=/usr/local/gd/--with-jpeg=/usr/local/jpeg/--with-freetype=/usr/local/freetype/
--enable-m4_pattern_allow (this item may be used in case of an error)

----------------------------------------------------------------------

  Installing Pcre
./configure--prefix=/usr/local/pcre/

----------------------------------------------------------------------

  Install Apache for pre-installed libraries
./configure--prefix=/usr/local/apache/--sysconfdir=/etc/httpd/--with-pcre=/usr/local/pcre/--with-included

-APR--disable-userdir--enable-so--enable-deflate=shared--enable-expires-shared--enable-rewrite=shared--
Enable-static-support

Some versions require that APR and apr-util libraries be copied to srclib under the Apache installation directory or installed separately

----------------------------------------------------------------------

Install MySQL without configure file         

Add MySQL Account

/usr/sbin/groupadd MySQL

/usr/sbin/useradd-g MySQL MySQL

Cmake-dcmake_install_prefix=/usr/local/mysql-dwith_extra_charsets:string=gbk,gb2312,utf8-dwith_myisam_storage_ engine=1-dwith_innobase_storage_engine=1-dwith_readline=1-denabled_local_infile=1-dmysql_datadir=/var/ mysql-data/

Increase permissions

chmod +w/usr/local/mysql

Chown-r Mysql:mysql/usr/local/mysql

Mkdir-p/var/mysql/mysql-data/

Mkdir-p/var/mysql/mysql-log/

Chown-r mysql:mysql/var/mysql/

Copy my.cnf file

CD support-files/

CP my-large.cnf/opt/mysql/my.cnf (Note: my-large.cnf suitable for 1G memory of the server, you can choose according to their own configuration my-large.cnf or my-huge.cnf different configurations)

CP Mysql.server/etc/init.d/mysqld

Initializing the installation

/usr/local/mysql/scripts/mysql_install_db--defaults-file=/var/mysql/mysql-data/my.cnf--basedir=/usr/local/ MySQL--datadir=/var/mysql/mysql-data--user=mysql

Add MySQL to start

chmod +x/etc/init.d/mysqld

Vi/etc/init.d/mysqld (if there is a special directory, edit this file, such as the base directory, and Data directory)

Basedir=/usr/local/mysql

Datadir=/var/mysql/mysql-data

Chkconfig--add mysqld

Chkconfig--level mysqld on

Start MySQL

Service mysqld Start

Change root password

mysqladmin-u root Password "newpwd"

----------------------------------------------------------------------

  Install PHP
./configure--prefix=/usr/local/php/--with-config-file-path=/usr/local/php/etc/--with-apxs2=/usr/local/apache/ Bin/apxs--with-mysql=/usr/local/mysql/--with-libxml-dir=/usr/local/libxml2/--with-jpeg-dir=/usr/local/jpeg/-- with-freetype-dir=/usr/local/freetype/--with-gd=/usr/local/gd/--with-mcrypt=/usr/local/libmcrypt/--with-mysqli =/usr/local/mysql/bin/mysql_config--enable-soap--enable-mbstring=all--enable-sockets

Missing Libtool-ltdl

Yum Install Libtool-ltdl Installation

CP Php.ini-dist/usr/local/php/etc/php.ini

Vi/etc/httpd/httpd.conf
AddType application/x-httpd-php. php. phtml
/usr/local/apache/bin/apachectl start

----------------------------------------------------------------------

  Installing the Zend Accelerator
The./install.sh interface is similar to Windows and agrees

/usr/local/php/etc/Specifying the PHP configuration file path
/usr/local/apache/bin/apachectl Specifying a boot path

----------------------------------------------------------------------
  Installing phpMyAdmin
Cp-r./phpmyadmin-3.0.0-rc1-all-languages/usr/local/apache/htdocs/phpmyadmin
CP config.sample.inc.php config.inc.php

VI config.inc.php
Modify $cfg [' Servers '] [$i] [' auth_type '] = ' http ';//default is cookie

(apache2.4.7 php5.4.25 MySQL 5.5.23) compile and install

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.