CentOS 7.4 Source installs the latest version of Lamp architecture and build phpMyAdmin

Source: Internet
Author: User
Tags bz2 install php php language

CentOS 7.4 Source installs the latest version of Lamp architecture and build phpMyAdmin

The required compression packages, such as:

1. Install Apache Service
[[Email protected] ~]# tar xf apr-1.6.2.tar.gz-c/opt///apache Plugin
[Email protected] ~]# tar XF apr-util-1.6.0.tar.gz-c/opt/
[[email protected] ~]# Yum install-y bzip2//.tar.gz format is the default compressed file format
[Email protected] ~]# tar XF httpd-2.4.29.tar.bz2-c/opt/

[[Email protected] opt]# MV APR-1.6.2/HTTPD-2.4.29/SRCLIB/APR//The Apache plug-in Mobile installation package directory, and only named as the directory name, the following version number is not, convenient runtime identification
[Email protected] opt]# MV Apr-util-1.6.0/httpd-2.4.29/srclib/apr-util
[[email protected] opt]# yum-y install \
GCC \
gcc-c++ \
Make \
Pcre-devel \
Expat-devel \
Perl
[[Email protected] opt]# CD httpd-2.4.29///compilation needs to go into the extracted directory
[[email protected] httpd-2.4.29]#./configure \//Custom
--PREFIX=/USR/LOCAL/HTTPD \//Specify the installation path for the HTTPD program
--ENABLE-SO \//Enable dynamic load module support
--enable-rewrite \//Enable Web address rewriting feature
--enable-charset-lite \//Startup character Set support
--ENABLE-CGI//Enable CGI scripting support

[[email protected] httpd-2.4.29]# make && make install//compile and install

[[email protected] httpd-2.4.29]# cp/usr/local/httpd/bin/apachectl/etc/init.d/httpd//Add HTTPD system service during system boot up process
[[email protected] httpd-2.4.29]# vi/etc/init.d/httpd//Edit httpd System Services Script
#chkconfig: 35 85 21//35 level Auto Run 85th start 21st off
#description: Apache is a world Wide WEB server//Script description

[Email protected] httpd-2.4.29]# ln-s/usr/local/httpd/conf/httpd.conf/etc/
[[email protected] httpd-2.4.29]# ln-s/usr/local/httpd/bin/*/usr/local/bin///Optimize execution path, the httpd of the execution program files into the $PATH environment variable
[Email protected] httpd-2.4.29]# Systemctl stop Firewalld
[Email protected] httpd-2.4.29]# Setenforce 0
[[email protected] httpd-2.4.29]# httpd-t//Check Apache configuration file has a syntax error can also be used: apachectl-t
[[Email protected] httpd-2.4.29]# service httpd start
[Email protected] httpd-2.4.29]# NETSTAT-ANPT | grep//http service based on TCP port 80

Test: Use the browser client to enter the host IP address access;

2. Install MySQL Database
[[email protected] httpd-2.4.29]# yum-y install \//installation of MySQL database dependent packages and plugins required
ncurses \
Ncurses-devel \
Bison \
Cmake

[[email protected] httpd-2.4.29]# useradd-s/sbin/nologin mysql//create program user MySQL
[[Email protected] httpd-2.4.29]# CD
[[Email protected] ~]# tar XF mysql-boost-5.7.20.tar.gz-c/opt///extract MySQL database compression package into/OPT
[Email protected] ~]# cd/opt/mysql-5.7.20/

[[email protected] mysql-5.7.20]# cmake \//Enter the installation package directory to customize the function
-DCMAKE_INSTALL_PREFIX=/USR/LOCAL/MYSQL \//Specifies that the MySQL database program be installed in a directory
-dmysql_unix_addr=/usr/local/mysql/mysql.sock \//Set Mysql.sock path, must be absolute path
-DSYSCONFDIR=/ETC//Specify initialization parameter file directory
-dsystemd_pid_dir=/usr/local/mysql \//pid File path
-DDEFAULT_CHARSET=UTF8 \//Specifies the character set encoding used by default
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \//Specifies the character set collation rules used by default
-dwith_innobase_storage_engine=1 \///Storage engine option, statically compiles a storage engine to the server, 1 is on, add Innobase engine support no add table times wrong
-dwith_blackhole_storage_engine=1 \//Add Blackhole engine support, do not add table times wrong
-dwith_perfschema_storage_engine=1 \//Add Perfschema engine support, do not add table times wrong
-dmysql_datadir=/usr/local/mysql/data \//mysql Database File storage directory
-dwith_boost=boost \//pointing to the directory where the BOOST library is located
-dwith_systemd=1//can use SYSTEMD to control MySQL service

[[email protected] mysql-5.7.20]# make && make install
[[email protected] mysql-5.7.20]# chown-r mysql.mysql/usr/local/mysql///change attribution, easy to program user MySQL to run
[[email protected] mysql-5.7.20]# vi/etc/my.cnf//mysql default Master Profile
Add as Content

[Email protected] mysql-5.7.20]# chown mysql:mysql/etc/my.cnf
[Email protected] mysql-5.7.20]# echo ' path=/usr/local/mysql/bin:/usr/local/mysql/lib: $PATH ' >>/etc/profile/ /Easy Linux System identification
[[email protected] mysql-5.7.20]# echo ' export PATH ' >>/etc/profile//global variable
[[email protected] mysql-5.7.20]# Source/etc/profile effective

[[email protected] mysql]# bin/mysqld \
--initialize-insecure \/Initialize database
--user=mysql \//Specify program user
-- Basedir=/usr/local/mysql \//Set the base directory
--datadir=/usr/local/mysql/data//Set working directory

[[email protected] mysql]# CP usr/lib/systemd/system/mysqld.service/usr/lib/systemd/system///Add to System Manager
[[email protected ] mysql]# systemctl daemon-reload as daemon user reload
[[email protected] mysql]# systemctl start mysqld
[[email& Nbsp;protected] mysql]# NETSTAT-ANPT | grep 3306

[[email protected] mysql]# Systemctl enable MYSQLD//set to boot start
[[email protected] mysql]# mysqladmin-u root-p Password "abc123"//to the root account set password for abc123, prompted to enter the initial password, direct return

[[email protected] mysql]# Mysql-u root-p//root has a password, to-p input password, no do not-P

3. Install PHP
[[email protected] mysql]# yum-y install \//installing PHP plugin for easy identification of various pictures, animations, etc. when setting up
Libjpeg \
Libjpeg-devel \
Libpng libpng-devel \
FreeType freetype-devel \
LIBXML2 \
Libxml2-devel \
Zlib zlib-devel \
Curl curl-devel \
OpenSSL Openssl-deve

[Email protected] ~]# tar XF php-7.1.10.tar.bz2-c/opt/
[Email protected] ~]# cd/opt/php-7.1.10
[Email protected] php-7.1.10]#/configure \
--prefix=/usr/local/php \ Specify PHP program installation path
--WITH-APXS2=/USR/LOCAL/HTTPD/BIN/APXS \ Set the file location of the APXS module support program provided by Apache HTTP Server
--with-mysql-sock=/usr/local/mysql/mysql.sock \ PHP UNIX Socket communication file
--WITH-MYSQLI \
--with-zlib \
--with-curl \ Allow Curl extension
--WITH-GD \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--WITH-OPENSSL \
--enable-mbstring \
--enable-xml \
--enable-session \ Allow PHP sessions session
--ENABLE-FTP \
--ENABLE-PDO \
--enable-tokenizer \
--enable-zip

[[email protected] php-7.1.10]# make && make install

[email protected] php-7.1.10]# CP Php.ini-development/usr/local/php/lib/php.ini
[Email protected] php-7.1.10]# Vi/usr/local/php/lib/php.ini
Mysqli.default_socket =/usr/local/mysql/mysql.sock Specify sock file location
Date.timezone = Asia/shanghai specified time zone



[[email protected] php-7.1.10]#/usr/local/php/bin/php-m verifying the installed module

[[email protected] php-7.1.10]# vi/etc/httpd.conf New in suitable location, support PHP language
AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps
DirectoryIndex index.php index.html


[[email protected] php-7.1.10]# vi/usr/local/httpd/htdocs/index.php//Edit Web Test file

[Email protected] htdocs]# rm-f index.html
[Email protected] htdocs]# systemctl restart httpd
Test, enter 192.168.80.130 in the browser

[Email protected] htdocs]# mysql-u root-p
CREATE DATABASE Myadm;
GRANT all on Myadm. To ' myadm ' @ '% ' of ' identified by ' admin123 ';
GRANT all on Myadm.
To ' myadm ' @ ' localhost ' identified by ' admin123 ';
Flush privileges;

[[email protected] htdocs]# vi/usr/local/httpd/htdocs/index.php//test if PHP is connected to MySQL database

Test results, successful connection appears as prompt:

4, Installation phpMyAdmin
[email protected] htdocs]# Yum install-y unzip
[Email protected] ~]# Unzip phpmyadmin-4.7.6-all-languages.zip-d/opt/
[Email protected] ~]# Mv/opt/phpmyadmin-4.7.6-all-languages/usr/local/httpd/htdocs/myadm
[Email protected] ~]# Cd/usr/local/httpd/htdocs/myadm
[email protected] myadm]# CP config.sample.inc.php config.inc.php
[Email protected] myadm]# VI config.inc.php
Modify as content:

Test, enter 192.16880.130/myadm/index.php in the browser

Note: The management database uses root and the password previously configured for root login management system

CentOS 7.4 Source installs the latest version of Lamp architecture and build phpMyAdmin

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.