Lamp Environment Construction

Source: Internet
Author: User
Tags mcrypt fully qualified domain name

I'm working on the centos6.5 32 bit.


Download

[[Email protected]]# cd/usr/local/src

[Email protected] src]# wget http://mirrors.sohu.com/apache/httpd-2.2.31.tar.gz

[Email protected] src]# wget http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.73-linux-i686-glibc23.tar.gz

[Email protected] src]# wget http://cn2.php.net/distributions/php-5.6.28.tar.gz


Apache Installation

Extract

[Email protected] src]# TAR-ZXVF httpd-2.2.31.tar.gz

[Email protected] src]# CD httpd-2.2.31


Configuring compilation parameters

[Email protected] httpd-2.2.31]#/configure--prefix=/usr/local/apache2--with-included-apr--enable-so-- enable-deflate=shared--enable-expires=shared--enable-rewrite=shared--with-pcre


Error

Error:mod_deflate have been requested but can is built due to prerequisite failures

Workaround:

#yum install-y Zlib-devel


Compile

[[email protected] httpd-2.2.31]# make

Note: The error is missing the library file, with the Yum list to search for the corresponding package, there is a yum whatprovides

Installation

[[email protected] httpd-2.2.31]# make install


Start:

#/usr/local/apache2/bin/apachectl start


Start Error:

Httpd:could not reliably determine the server ' s fully qualified domain name, using 127.0.0.1 for ServerName

Workaround:

#vim/usr/local/apache2/conf/httpd.conf

ServerName www.example.com:80

Change to ServerName localhost:80


Restart without error

#/usr/local/apache2/bin/apachectl Restart


MySQL Installation

Extract

# tar-zxvf/usr/local/src/mysql-5.1.73-linux-i686-glibc23. tar.gz

Reposition position

# mv Mysql-5.1.73-linux-i686-glibc23. Tar.gz/usr/local/mysql


Create a MySQL user

# useradd-s/sbin/nologin MySQL

# Cd/usr/local/mysql

Create DataDir, database file storage location

# mkdir-p/data/mysql

# Chown-r Mysql:mysql/data/mysql

#./scripts/mysql_install_db--user=mysql--datadir=/data/mysql/

Note: If you see 2 OK, the execution is correct.


Configure MySQL

Copy configuration file

[email protected] mysql]# CP support-files/my-large.cnf/etc/my.cnf

CP: Do you want to overwrite "/etc/my.cnf"? Y

Copy the startup script and modify its properties

[email protected] mysql]# CP support-files/mysql.server/etc/init.d/mysqld

[Email protected] mysql]# chmod 755/etc/init.d/mysqld


modifying startup scripts

[Email protected] mysql]# Vi/etc/init.d/mysqld

Note: Where modifications are required

Basedir=/usr/local/mysql

Datadir=/data/mysql


Add the startup script to the system service entry, set the boot start

[Email protected] mysql]# chkconfig--add mysqld

[Email protected] mysql]# chkconfig mysqld on

[[Email protected] mysql]# service mysqld start

Starting MySQL. success!

Note: If you cannot start, review the error log.


PHP Installation

Unzip, go to PHP directory

[Email protected] php-5.3.27]# /configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs--w   Ith-config-file-path=/usr/local/php/etc--with-mysql=/usr/local/mysql--with-libxml-dir--with-gd--with-jpeg-dir   --with-png-dir--with-freetype-dir--with-iconv-dir--with-zlib-dir--with-bz2--with-openssl--with-mcrypt --enable-soap--enable-gd-native-ttf--enable-mbstring--enable-sockets--enable-exif--disable-ipv6


Error:

Configure:error:xml2-config not found. Please check your LIBXML2 installation.

Workaround:

Yum Install-y libxml2-devel

Error

Configure:error:Cannot find OpenSSL ' s <evp.h>

Workaround:

Yum Install-y OpenSSL Openssl-devel

Error :

Checking for BZIP2 in default path ... not foundconfigure:error:Please reinstall the BZIP2 distribution

Workaround:

Yum install-y bzip2 Bzip2-devel

Error:

Configure:error:png.h not found.

Workaround:

Yum install-y libpng Libpng-devel

Error:

Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.


Compile Make:

[[email protected] php-5.6.28]# make

Error:

Make: Warning: A clock error was detected. Your creation may not be complete.

Cause: The compilation process is more time-dependent than the system time

FIX: Modify Time


Installation:

[[email protected] php-5.6.28]# make install


The above installation process is complete, but Once the PHP installation is complete, it cannot be used directly and requires some configuration


This article is from the "Liew" blog, make sure to keep this source http://walterliew.blog.51cto.com/11286797/1882834

Lamp Environment Construction

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.