LAM p Compile and install

Source: Internet
Author: User

First, the experimental target

Compile and install lamp on CentOS 7 platform

Second, the experimental planning

Apache
172.18.12.7
httpd-2.4.9.tar.bz2
Mairadb 172.18.12.8
mariadb-5.5.43
Php
172.18.12.8
php-5.4.26.tar.bz2

Provides a common development environment

# yum Groupinstall "Development Tools" "Server Platform Development


Third, compile lamp

1.Apache Compilation

Providing a development environment to address dependencies

# yum Install-y pcre-devel Openssl-devel

Get the source package to the local/usr/local

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7F/C2/wKioL1cr476zlypRAAAh0jQMlew699.png "title=" 001. PNG "alt=" Wkiol1cr476zlypraaah0jqmlew699.png "/>

Requires sequential installation depending on dependency relationship

Install Apr Package

# TAR-XF apr-1.5.0.tar.bz2# cd apr-1.5.0/#./configure--prefix=/usr/local/apr# Make&&make Install

Installing the Apr-util Package

# tar-xf apr-util-1.5.3.tar.bz2 #cd apr-util-1.5.3#./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/ Apr#make && make Install


Installing Apache

# TAR-XF httpd-2.4.9.tar.bz2 # CD Httpd-2.4.9/#./configure--prefix=/usr/local/apache--sysconfdir=/etc/httpd24-- Enable-so--enable-ssl--enable-cgi--enable-rewrite--with-zlib--with-pcre--with-apr=/usr/local/apr-- With-apr-util=/usr/local/apr-util--enable-modules=most--enable-mpms-share=all--with-mpm=prefork
#make && make Install

--prefix=/usr/local/apache: Specifying the program installation path

--SYSCONFDIR=/ETC/HTTPD24: Specify the configuration file storage path

--ENABLE-SO: Allows the runtime to load the DSO module

--ENABLE-SSL: Provides high-intensity encrypted transmission of Secure Sockets Layer (SSL) and Transport Layer Security (TLS) protocols

--ENABLE-CGI: Provides support for CGI script execution

--enable-rewrite: Support Rewriting

--with-zlib: Support zlib Library

--with-pcre: Enable regular expressions

--enable-modules=most: Enable most common modules.

--enable-mpms-shared=all: Enables all modes of MPM .

--with-mpm=prefork: Sets the default mpm to prefork.

Launch Apache

Because the installation is compiled, the boot service needs to specify a specific path:

#/usr/local/apache/bin/apachectl Start

Power-on self-booting

1) # vim/etc/profile.d/httpd.sh export path=/usr/local/apache/bin: $PATH 2) #. /ETC/PROFILE.D/HTTPD.SH3) # Apachectl start

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7F/C2/wKioL1cr5C-Bsg22AAAj20VERJ0758.png "title=" 002. PNG "alt=" Wkiol1cr5c-bsg22aaaj20verj0758.png "/>

2. Install the MARIADB with the binary

2.1 Creating a MARIADB Storage directory

# Mkdir/mysqldata

2.2 Create a system user to manage the secondary service

Useradd-r MySQL is used when it is hijacked without causing great security to the system

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7F/C5/wKiom1cr6NmiNujTAAARxsBtBFk961.png "title=" 004. PNG "alt=" Wkiom1cr6nminujtaaarxsbtbfk961.png "/>

Modify the permissions that mariadb hangs in the directory

# chown mysql.mysql/mysqldata/to get MySQL to write data

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7F/C5/wKiom1cr6TziyvI-AAAVAV5nNIg558.png "title=" 005. PNG "alt=" Wkiom1cr6tziyvi-aaavav5nnig558.png "/>

Compiling and installing MARIADB

Get binary package to local/usr/local

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7F/C7/wKiom1csDcHBzgFfAAAhmRkuau4025.png "title=" 010. PNG "alt=" Wkiom1csdchbzgffaaahmrkuau4025.png "/>

#tar-XF mariadb-5.5.43-linux-x86_64.tar.gz must be expanded to this directory #ln-sv mariadb-5.5.43-linux-x86_64 MySQL must be linked to mysql# CD mysql/# C Hown-r root.mysql./* Because it is a linked file, use this format


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7F/C4/wKioL1csDr2Q3XwEAAAoXzLAdtk711.png "title=" 011. PNG "alt=" Wkiol1csdr2q3xweaaaoxzladtk711.png "/>

# scripts/mysql_install_db--user=mysql--datadir=/mysqldata must be in this directory to store directory initialization # CP support-files/my-large.cnf/etc/ MY.CNF Provisioning Profile # VIM/ETC/MY.CNF

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7F/C4/wKioL1csD7ez2xuRAAAiQCd4wRc087.png "title=" 007. PNG "alt=" Wkiol1csd7ez2xuraaaiqcd4wrc087.png "/>

# CP Support-files/mysql.server/etc/init.d/mysqld#chkconfig--add/etc/init.d/mysqld# systemctl start mysqld

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7F/C7/wKiom1csEDKzCi4XAAAv7QNFazA945.png "title=" 015. PNG "alt=" Wkiom1csedkzci4xaaav7qnfaza945.png "/>

Iii. php-5.4 Compilation and Installation

Get the source package

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7F/C9/wKiom1csT5uiWL6CAAAgX73iTic482.png "title=" 001. PNG "alt=" Wkiom1cst5uiwl6caaagx73itic482.png "/>

Provide additional dependent environments

# yum install-y libxml2-devel libmcrypt-devel bzip2-devel openssl-devel
# cd/usr/local
# TAR-XF PHP-5.4.26.TAR.BZ2
# CD php-5.4.26/
#./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql--with-openssl--with-mysqli=/usr/local/mysql/ Bin/mysql_config--enable-mbstring--with-png-dir--with-jpeg-dir--with-freetype-dir--with-zlib--with-libxml-dir= /usr--enable-xml--enable-sockets--with-apxs2=/usr/local/apache24/bin/apxs--with-mcrypt--with-config-file-path= /etc--WITH-CONFIG-FILE-SCAN-DIR=/ETC/PHP.D--with-bz2
# MAKE-J 4 && make install















LAM p Compile and install

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.