Pure Source Compilation installation Lamp,linux,httpd,php,mysql source compilation installation

Source: Internet
Author: User
Tags bz2 openssl

Pure Source Compilation installation Lamp,linux,httpd,php,mysql source compilation installation


Tutorial Goal: Use source code to compile the installed lamp, run the PHP web base

Date : August 19, 2015

Contact e-mail:[email protected]

Q q Group: 1851 15701

51CTO Blog Home: http://990487026.blog.51cto.com

Be a blogger responsible for the reader.
Install a clean system like mine and I can install it successfully and you can also install it successfully.
I can do it, you can do it!
================================================================
Installation Preparation:

Installation Environment:
1, new Installation, CentOS 6.6 X64, minimized installation
2, set the native ip:10.11.12.13
3, use the default Yum source to resolve the installation of the compilation environment

The required software is as follows:
[Email protected] lamp]# ll-h
Total dosage 52M
-rwxrwxrwx. 1 root root 997K June 7 18:02 apr-1.5.1.tar.gz
-rwxrwxrwx. 1 root root 678K June 7 18:01 apr-util-1.5.2.tar.bz2
-rwxrwxrwx. 1 root root 4.6M May 6 14:01 httpd-2.4.4.tar.bz2
-rw-r--r--. 1 root root 32M August 3 13:29 mysql-5.6.17.tar.gz
-rw-r--r--. 1 root root 14M August 3 10:00am php-5.6.11.tar.bz2

All the required documents can be searched directly from the following website
Http://www.wangpansou.cn/recommended
https://github.com/
Http://sourceforge.net
http://search.cpan.org/
http://www.filewatcher.com/

=================================================================
To start preparing for installation:

Tar XF httpd-2.4.4.tar.bz2-c/usr/src/
Tar XF apr-1.5.1.tar.gz-c/usr/src/
Tar XF apr-util-1.5.2.tar.bz2-c/usr/src/
Tar XF mysql-5.6.17.tar.gz-c/usr/src/
Tar XF php-5.6.11.tar.bz2-c/usr/src/

Because of the minimal installation of CentOS 6.6 X64, install the build tool and its dependent packages first

Yum install-y gcc gcc-c++ autoconf automake OpenSSL openssl-devel ncurses-devel libxml2-devel bison make CMake pcre pcre -devel zlib-devel libtool-ldtd-devel Libtool Flex vim

==================================================================
Install httpd and its dependent packages first

Cd/usr/src/apr-1.5.1/
./configure
Make
Make install

Cd/usr/src/apr-util-1.5.2/
./configure--with-apr=/usr/local/apr/
Make
Make install

What modules are needed when installing httpd, and what modules to add
cd/usr/src/httpd-2.4.4/
./configure--prefix=/usr/local/apache2--enable-so--enable-ssl--enable-rewrite--with-mpm=worker-- With-suexec-bin--with-apr=/usr/local/apr/
Make
Make install


To start the HTTPD service:
/usr/local/apache2/bin/apachectl start


Add firewall rules and save
Iptables-a input-p tcp-m TCP--dport 80-j ACCEPT
Service Iptables Save

See if Port 80 is turned on
Netstat-tnlp



==================================================================

Source code compiled installation mysql,3.4g clock server, compile time about 17-20 minutes or so

cd/usr/src/mysql-5.6.17/

Groupadd MySQL
Useradd-r-s/sbin/nologin-g MySQL MySQL

CMake. -denable_downloads=1
Make && make install

granting permissions
Chown-r mysql.mysql/usr/local/mysql/

Use mysql_install_db to initialize MySQL database, use user defined database account name Chen, basedir Specify database storage directory
/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql/--datadir=/usr/local/mysql/ data/

Copy a configuration file into the/etc/directory
Cp/usr/local/mysql/my.cnf/etc/my.cnf

Put the startup and shutdown scripts into the INIT.D directory
Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld

Chkconfig--add mysqld
Chkconfig mysqld on


granting permissions
Chown-r mysql:mysql/usr/local/mysql/


Modify the MySQL configuration file, point to the Set directory
Vim/etc/my.cnf
[Mysqld]
#datadir =/var/lib/mysql
Datadir=/usr/local/mysql/data
#socket =/var/lib/mysql/mysql.sock
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=/var/log/mysqld.log
#pid-file=/var/run/mysqld/mysqld.pid
Log-error=/usr/local/mysql/mysqld.log
Pid-file=/usr/local/mysql/mysqld.pid



echo "/usr/local/mysql/lib/" >>/etc/ld.so.conf

cd/usr/src/mysql-5.6.17/
Ldconfig


Start MySQL
Service mysqld Start

Netstat-tnlp
See if Port 3306 is being monitored

MySQL Installation complete

If you want to modify the default password **************************************************
For example: Change the root password to 123456
Mysql-u Root into MySQL

Modify MySQL account password
Use MySQL;
UPDATE user SET Password=password (' 123456 ') WHERE user= ' root ';
FLUSH privileges;
===================================================

Compiling and installing PHP

cd/usr/src/php-5.6.11/

What module is needed, what module is specified
./configure--PREFIX=/USR/LOCAL/PHP5--with-mysql=/usr/local/mysql/--with-apxs2=/usr/local/apache2/bin/apxs-- Enable-mbstring--enable-sockets

Make
Make install

Copying a copy of the php.ini configuration file
CP Php.ini-development/usr/local/php5/lib/php.ini




Modifying the httpd configuration file
Vim/usr/local/apache2/conf/httpd.conf

Add below this
AddType application/x-gzip. gz. tgz
AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps
Remove annotations servername www.example.com:80

Position to DirectoryIndex index.html
Modified to:
DirectoryIndex index.php index.html

echo "<?php phpinfo ();? > ">/usr/local/apache2/htdocs/index.php



======================================================================================

Browser access: 10.11.12.13
A PHP message appears, OK, install to this success.


Interested students, you can do a one-click Automatic installation script, complete the automated installation, improve operational efficiency.

Thank you for browsing, such as the question of this article, please email [email protected], open source community, you are more exciting!


This article comes from "Life is endless, tossing and turning." "Blog, be sure to keep this provenance http://990487026.blog.51cto.com/10133282/1686024

Pure Source Compilation installation Lamp,linux,httpd,php,mysql source compilation installation

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.