Linux-lamp Construction with minimized installation

Source: Internet
Author: User
Tags gettext install php install perl

1. Minimal installation of Linux
After the installation is complete, set the SELinux to disable, turn off iptables, turn off NetworkManager, set the installation CD as the local Yum source
Process slightly.
2. Install MySQL
Install gcc-c++ and GDB, install CMake, install ncurses, install Bison, install Perl
Yum install gcc-c++ gdb cmake ncurses ncurses-devel Bison bison-devel
cd/usr/src/
Download the MySQL source package http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.26.tar.gz
Unpacking the Tar XF mysql-5.6.26.tar.gz
CD mysql-5.6.26
Compile and install MySQL
Generate Makefile,
CMake \
-dcmake_install_prefix=/usr/local/mysql \
-dmysql_datadir=/usr/local/mysql/data \
-DSYSCONFDIR=/ETC \
-dwith_innobase_storage_engine=1 \
-dwith_partition_storage_engine=1 \
-dmysql_unix_addr=/tmp/mysql.sock \
-dmysql_tcp_port=3306 \
-ddefault_charset=utf8 \
-ddefault_collation=utf8_general_ci
Compile & Install
Make && make install
Confirm the installation results
Ls/usr/local/mysql

Configure MySQL
1) Configure the user
Use the following command to see if there are MySQL users and user groups
CAT/ETC/PASSWD View the list of users
Cat/etc/group viewing a list of user groups
If not, create
Groupadd MySQL
Useradd-r-G MySQL MySQL
Confirm the creation result
ID MySQL
Modify/usr/local/mysql Directory Permissions
Chown-r Mysql:mysql/usr/local/mysql
2) Initialize the configuration
Install Perl required to run the MySQL test script
Yum Install Perl
Go to installation path
Cd/usr/local/mysql
Execute the initialization configuration script to create the system's own database and table
scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql
To set mysqld as a system-independent service
Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
Set a password for MySQL
/usr/local/mysql/bin/mysqladmin-u root password ' [email protected] '
/usr/local/mysql/bin/mysqladmin-u root-h Zabbix password ' new-password '
Start the MySQL service
/usr/local/mysql/bin/mysqld_safe &
If not found, it will search for "$basedir/my.cnf", in this case,/USR/LOCAL/MYSQL/MY.CNF, which is the default location for the new MySQL configuration file.
3) Start MySQL
Add services, Copy service scripts to the INIT.D directory, and set boot boot
CP Support-files/mysql.server/etc/init.d/mysql
Chkconfig MySQL on
Service MySQL Start--start MySQL

3. Installing Apache
Download source packages and Dependency packages
APR, Apr-util, pcre,gcc-c++ must be installed
Cd/usr/src
wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.16-deps.tar.gz
wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.16.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz
Unzip separately
find/usr/src/-name "*.tar.gz" | Xargs-n 1 Tar XF
Install Apr
Cd/usr/src/httpd-2.4.16/srclib/apr
./configure--PREFIX=/USR/LOCAL/APR
Compile & Install
Make && make install
Installing Apr-util
Cd.. /apr-util/
./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr/
Compile & Install
Make && make install
Installing Pcre
Cd.. /pcre-8.37
./configure--prefix=/usr/local/pcre \
--with-apr=/usr/local/apr/bin/apr-1-config \
--with-apr-util=/usr/local/apr-util/bin/apu-1-config
Compile & Install
Make && make install
Installing Apache HTTP Server
Cd.. /httpd-2.4.16
./configure--prefix=/usr/local/apache2 \
--with-pcre=/usr/local/pcre \
--WITH-APR=/USR/LOCAL/APR \
--with-apr-util=/usr/local/apr-util
Compile & Install
Make && make install
Verify that the installation is successful
ls/usr/local/apache2/
Set permissions
Chown-r daemon:daemon/usr/local/apache2/
Set up Apache service to start automatically
Add a row at the end of/etc/rc.local/usr/local/apache2/bin/apachectl start

4. Install PHP
Installing the XZ compression tool
Yum-y Install XZ
Download the source Package
cd/usr/src/
wget Http://cn2.php.net/get/php-5.6.13.tar.xz/from/this/mirror
Tar XF php-5.6.13.tar.xz

Download and install the appropriate components
Installing jpeg-8d
wget http://www.ijg.org/files/jpegsrc.v8d.tar.gz
Tar XF jpegsrc.v8d.tar.gz
CD jpeg-8d/
./configure--prefix=/usr/local/jpeg-8d
Make && make install

Installing zlib
wget http://nchc.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
Tar XF zlib-1.2.8.tar.gz
CD zlib-1.2.8
Cflags= "-o3-fpic"./configure
Make && make install

Download libpng
wget FTP://FTP.SIMPLESYSTEMS.ORG/PUB/LIBPNG/PNG/SRC/LIBPNG16/LIBPNG-1.6.18.TAR.XZ
Tar XF libpng-1.6.18.tar.xz
CD libpng-1.6.18
./configure--prefix=/usr/local/libpng

Download FreeType
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.6.tar.gz
Tar XF freetype-2.6.tar.gz
./configure--prefix=/usr/local/freetype
Make && make install

Download GetText
wget HTTP://FTP.GNU.ORG/PUB/GNU/GETTEXT/GETTEXT-0.19.6.TAR.XZ
Tar XF gettext-0.19.6.tar.xz
CD gettext-0.19.6
./configure--prefix=/usr/local/gettext--enable-shared
Make && make install

Installing autoconf, Libtool
Yum-y Install Libtool autoconf
Download LIBXML2
wget HTTPS://GIT.GNOME.ORG/BROWSE/LIBXML2/SNAPSHOT/LIBXML2-2.9.2.TAR.XZ
Tar XF libxml2-2.9.2.tar.xz
CD libxml2-2.9.2
Execute the following command sequentially
Libtoolize--force
Aclocal
Autoheader
Automake--force-missing--add-missing
Autoconf
./configure--PREFIX=/USR/LOCAL/LIBXML2--with-zlib=/usr/local/zlib/
Make && make install

Installing GDBM
wget ftp://ftp.gnu.org/gnu/gdbm/gdbm-1.11.tar.gz
Tar XF gdbm-1.11.tar.gz
CD gdbm-1.11
./configure--prefix=/usr/local/gdbm--enable-shared
Make && make install

Installing Libiconv
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
Tar XF libiconv-1.14.tar.gz
CD Tar XF libiconv-1.14
./configure--prefix=/usr/local/libiconv
Make && make install

Installing GD
wget HTTPS://BITBUCKET.ORG/LIBGD/GD-LIBGD/DOWNLOADS/LIBGD-2.1.1.TAR.XZ
Tar XF libgd-2.1.1.tar.xz
CD libgd-2.1.1
./configure--prefix=/usr/local/libgd2-with-zlib=/usr/local/zlib--with-png=/usr/local/libpng--with-jpeg=/usr/ Local/jpeg-8d/--with-freetype=/usr/local/freetype/
Make && make install

Install PHP
Tar XF php-5.6.13.tar.xz
CD php-5.6.13
Install libxpm-devel before you install PHP
Yum-y Install Libxpm-devel
./configure \
--prefix=/usr/local/php \
--WITH-APXS2=/USR/LOCAL/APACHE2/BIN/APXS \
--WITH-JPEG-DIR=/USR/LOCAL/JPEG-8D \
--with-gettext \
--enable-mbstring \
--WITH-LIBXML-DIR=/USR/LOCAL/LIBXML2 \
--with-png-dir=/usr/local/libpng \
--with-zlib-dir=/usr/local/lib \
--WITH-GD=/USR/LOCAL/LIBGD2 \
--with-freetype-dir=/usr/local/freetype \
--enable-trace-vars \
--with-mysql=/usr/local/mysql \
--WITH-GDBM-DIR=/USR/LOCAL/GDBM \
--with-iconv \
--enable-sockets \
--disable-ipv6 \
--with-xpm-dir=/usr/lib64/libxpm.so \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--enable-fpm

Libtool--finish/usr/src/php-5.6.13/libs
Make && make install

To modify the Apache configuration file:
Vim/usr/local/apache2/conf/httpd.conf
Make sure the character is present
LoadModule Php5_module modules/libphp5.so
If not, add
In the next line of AddType application/*, add the following:
AddType application/x-httpd-php. php

Add index.php at the end of the DirectoryIndex index.html line, which becomes directory index index.html index.php

Linux-lamp Construction with minimized installation

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.