Lamp Environment Deployment: Apache Source installation +mysql binary installation +php source installation +nginx Source installation

Source: Internet
Author: User
Tags install php mysql version

Apache version: 2.2.27
MySQL version: 5.5.54-linux2.6-x86_64
PHP version: 5.3.27
First, source code installation Apache
1. First install the Upload tool

2, upload the lamp environment required installation package


3. Unzip all installation packages

4. Install Apache Dependency Package

5. Create the installation directory

6. Configure installation files

./configure \ #./configure is used to generate makefile files for compiling the installation

--prefix=/application/apache-2.2.27 \ #指定安装目录
--enable-deflate \ #开启压缩编码 (for tuning)
--enable-expires \ #用于提供客户端浏览器缓存时间
--enable-modules=most \ #开启大部分模块
--enable-headers \ #允许请求头控制
--ENABLE-SO \ #提供DSO服务
--with-mpm-worker \ #修改工作模式为worker (threads)
--enable-rewrite #开启重写机制

7. Compile and install Apache

8. Create a soft link

9, check the compilation

10. Start Apache Service

11, Apache Source Installation success:

Second, MySQL source installation
1. Create MySQL users and groups first

2. Move the source file to a local directory and create a soft link


3. Create the Data directory, and modify the owner of the genus Group

4. Copy the MySQL parameter file (depending on the business selection parameter file)

5. Initialize MySQL

6. Copy MySQL boot file to/etc/init.d/mysqld

7. Start MySQL

8. Add MySQL environment variable


9, MySQL binary installation success:

Third, PHP source installation
1, install the PHP dependency library:

Since there is no libiconv in the Yum source, this dependency package is installed using the source code:

Configuration makefile:

Compile && Install:

If this error occurs, go to the Srclib directory to execute Sed-i-E '/gets is a security/d './stdio.in.h and then recompile the installation
Make[2]: [Prognam E.O] Error 1
make[2]: Leaving directory '/home/lmos/libiconv-1.14/srclib '
Make[1]:
[All] Error 2
Make[1]: Leaving directory '/home/lmos/libiconv-1.14/srclib '

2, Configuration makefile: (according to the specific installation path to set parameters)

./configure \
--prefix=/application/php5.3.27 \
--WITH-APXS2=/APPLICATION/APACHE/BIN/APXS \
--with-mysql=/application/mysql \
--WITH-XMLRPC \
--WITH-OPENSSL \
--with-zlib \
--with-freetype-dir \
--WITH-GD \
--with-jpeg-dir \
--with-png-dir \
--with-iconv=/usr/local/libiconv \
--enable-short-tags \
--enable-sockets \
--enable-zend-multibyte \
--ENABLE-SOAP \
--enable-mbstring \
--enable-static \
--ENABLE-GD-NATIVE-TTF \
--with-curl \
--with-xsl \
--ENABLE-FTP \
--with-libxml-dir
3. Dependencies required for installation and compilation

4. Compile and install PHP

5. Configure Apache to enable Apapche to invoke PHP to parse


Exclude FQDN Error

PHP Configuration succeeded:

Iv. installation of Nginx source code

Wget http://nginx.org/download/nginx-1.12.2.tar.gz

./configure--prefix=/application/nginx-1.12.2--user=nginx--group=nginx--with-http_ssl_module--with-http_stub_ Status_module






Use Pkill to close Nginx

Lamp Environment Deployment: Apache Source installation +mysql binary installation +php source installation +nginx Source 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.