The latest source code package based on the CentOS 6.8 Platform Lamp Environment Building (apache+mysql+php)

Source: Internet
Author: User

Deployment environment

System: CentOS6.8 x86_64

apache:2.4.23

mysql:5.7.14

php:7.0.10

apr:1.5.2

apr-util:1.5.4

boost:1.59.0

cmake:3.6.1

pcre:8.39

Package Preparation

Here CentOS6.8 system (no graphics environment) installation process slightly, using the PC (Windows system) browser to visit the official Apache website http://www.apache.org/Click the download page tab

Click on the suggested image download site

Find the APR directory

Download the latest version of the APR package in tar.gz format and right click to select "Copy link Address"

Log in to the CentOS6.8 system, switch to the/USR/SRC directory, and use the Curl tool to download the linked file you just copied

Curl-o http://mirrors.cnnic.cn/apache/apr/apr-1.5.2.tar.gz

Follow this method to download the Apr-util software package to the/USR/SRC directory

Go back to the top level directory

Locate the httpd directory

Download the latest version of Apache software to the/USR/SRC directory

Visit Pcre website http://www.pcre.org/access the download link

Download the latest version of the Pcre package to the/USR/SRC directory

Visit the Boost website http://www.boost.org/enter 1.59.0 Release Information

Click the. tar.gz format File Package

Jump to the download page, activate the browser downloader automatically, copy to the CentOS system download.

Visit CMake official website https://cmake.org/download page tab

Download the latest release version

Visit the MySQL website https://www.mysql.com/

Since MySQL has been acquired by Oracle, the download for MySQL Enterprise Edition requires Oracle's authorization, so download the free community version here.

Go to download page

Available versions Select a source code package

Tar source code package for the Universal Linux platform

Do not log in to the account, download only.

Copy the download address for download

Visit PHP official website http://www.php.net/Download the latest release version

Select a node to download from our nearest mirror site.

Copy the download link address to download

Required Package Download complete

Deployment process

Install the necessary system packages using Yum

Yum install-y gcc gcc-c++ ncurses ncurses-devel perl libxml2 libxml2-devel curl-devel Libpng-devel

Install Apr software, unzip, configure, have an error that cannot be deleted, can be ignored.

Tar zxf apr-1.5.2.tar.gz

CD apr-1.5.2

./configure--PREFIX=/USR/LOCAL/APR

Compiling the installation

Make && make install

Switch to/USR/SRC directory to continue installing Apr-util software

Tar zxf apr-util-1.5.4.tar.gz

CD apr-util-1.5.4

./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr/

Compiling the installation

Make && make install

Switch back to the/USR/SRC directory and continue installing the PCRE software

Tar zxf pcre-8.39.tar.gz

CD pcre-8.39

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

Compiling the installation

Make && make install

Switch back to the/USR/SRC directory and install Apache

Tar zxf httpd-2.4.23.tar.gz

CD httpd-2.4.23

./configure--prefix=/usr/local/apache--enable-so--with-apr-util=/usr/local/apr-util/--with-pcre=/usr/local/ Pcre/

Compiling the installation

Make && make install

Switch back to/USR/SRC directory to install boost software

Tar zxf boost_1_59_0.tar.gz

CD Boost_1_59_0

./bootstrap.sh

Compile and install, the process is long, patient wait.

./b2

Installation

./B2 Install--prefix=/usr/local/boost

Switch back to the/USR/SRC directory and continue with the installation CMake

Tar zxf cmake-3.6.1.tar.gz

CD cmake-3.6.1

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

Compiling the installation

Make && make install

Switch back to the/USR/SRC directory to install the MySQL database and create the MySQL user.

Useradd MySQL

Tar zxf mysql-5.7.14.tar.gz

CD mysql-5.7.14

/usr/local/cmake/bin/cmake-dcmake_install_prefix=/usr/local/mysql-dsysconfdir=/usr/local/mysql/etc-dmysql_ Datadir=/usr/local/mysql/data-dmysql_unix_addr=/usr/local/mysql/mysql.sock-ddefault_charset=utf8-ddefault_ Collation=utf8_general_ci-dmysql_tcp_port=3306-dmysql_user=mysql-dwith_myisam_storage_engine=1-dwith_innobase_ Storage_engine=1-dwith_archive_storage_engine=1-dwith_blackhole_storage_engine=1-dwith_memory_storage_engine=1 -dwith_boost=/usr/local/boost/include

Compile the installation and wait long.

Make && make install

Initialize the database, and note that a temporary login account and password are generated.

/usr/local/mysql/bin/mysqld--initialize--user=mysql--basedir=/usr/local/mysql/--datadir=/usr/local/mysql/data

[Mysqld]

Datadir=/usr/local/mysql/data

Socket=/usr/local/mysql/mysql.sock

User=mysql

# Disabling Symbolic-links is recommended to prevent assorted security risks

Symbolic-links=0

[Mysqld_safe]

Log-error=/usr/local/mysql/log/mysqld.log

Pid-file=/usr/local/mysql/run/mysqld.pid

Create related directories and permissions

Mkdir-p/usr/local/mysql/data

Mkdir-p/usr/local/mysql/log

Mkdir-p/usr/local/mysql/run

Chown-r Mysql/usr/local/mysql

Start the database service

/usr/local/mysql/bin/mysqld_safe &

/usr/local/mysql/bin/mysql-u root-p-s/usr/local/mysql/mysql.sock

Modify Database Login Password

Alter user ' root ' @ ' localhost ' identified by ' [email protected] ';

Modify the startup script file/usr/local/mysql/support-files/mysql.server the following parameters

Basedir=/usr/local/mysql

Datadir=/usr/local/mysql/data

Mysqld_pid_file_path=/usr/local/mysql/run/mysqld.pid

Test startup scripts

View MySQL process and port status

Tar zxf php-7.0.10.tar.gz

CD php-7.0.10

./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-apxs2=/usr/local/apache/bin /apxs--enable-mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--enable-mbstring--with-curl--WITH-GD-- enable-fpm

Compiling the installation

Make && make install

Copy configuration file

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

Modify the configuration file/usr/local/php/etc/php.ini modify the parameters to remove the preceding semicolon.

Date.timezone = Asia/shanghai

Modify the Apache configuration file/usr/local/apache/conf/httpd.conf, modify the servername, and add the PHP index.

Add at the end

<filesmatch "\.ph (p[2-6]?| tml) $ ">

SetHandler application/x-httpd-php

</FilesMatch>

<filesmatch "\.phps$" >

SetHandler Application/x-httpd-php-source

</FilesMatch>

Create a PHP test file in the Apache documentation directory index.php

/usr/local/apache/htdocs/index.html

vi/usr/local/apache/htdocs/index.php

The contents are as follows

<?php

Phpinfo ();

?>

Launch the Apache service to see the process and port status.

/usr/local/apache/bin/apachectl start

MySQL-related information

Create Apache and MySQL boot scripts

cp/usr/local/apache/bin/apachectl/etc/init.d/

Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql

Edit/etc/init.d/apachectl Add

# chkconfig:2345 65 35

# description:a very fast and reliable Apache engine.

Add to Chkconfig service management

Chkconfig--add Apachectl

Chkconfig--add MySQL

This article is from the "Server System Communication" blog, so be sure to keep this source http://1130739.blog.51cto.com/1120739/1845208

The latest source code package based on the CentOS 6.8 Platform Lamp Environment Building (apache+mysql+php)

Related Article
Large-Scale Price Reduction
  • 59% Max. and 23% Avg.
  • Price Reduction for Core Products
  • Price Reduction in Multiple Regions
undefined. /
Connect with us on Discord
  • Secure, anonymous group chat without disturbance
  • Stay updated on campaigns, new products, and more
  • Support for all your questions
undefined. /
Free Tier
  • Start free from ECS to Big Data
  • Get Started in 3 Simple Steps
  • Try ECS t5 1C1G
undefined. /

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.