Build a lamp Environment [apache2.4.12 + php5.5.12 + mysql5.6.13]

Source: Internet
Author: User

Build a lamp Environment [apache2.4.12 + php5.5.12 + mysql5.6.13]

Centos 6.61. apache/2.4.122. php 5.5.123. mysql 5.6.13 # ---------------------------------------------------------------------------------- # prepare #1. install g ++ yum list gcc-c ++ yum install gcc-c ++. x86_64 #2. installing ncursesyum list ncurses-develyum install ncurses-devel.x86_64 #3. install httpd-develyum list httpd-develyum install httpd-devel.x86_64 #4. install the libXpm-devel.x86_64 [for php] # install php if (error: X11/xpm. h: No such file or directory) http://www.th7.cn/Program/php/201406/213224.shtmlyum list libXpm-develyum install libXpm-devel.x86_64 #5. install cmakmcm/usr/local/src & wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gztar-zxvf cmake-2.8.10.2.tar.gz & cd cmake-2.8.10.2 &&. /bootstrap & gmake install & cd-#6. install libtoolcd/usr/local/src & wget http://ftp.gnu.org/gnu/libtool/libtool-2.2.6a.tar.gztar zxvf libtool-2.2.6a.tar.gz & cd libtool-2.2.6 &&. /configure & make install # almost view the blog http://www.cnblogs.com/mophee/archive/2013/03/19/2969456.html# 7. install sz rzyum install lrzsz # ------------------------------------------------------------------------------ #1. download apache's ref apache mysql phpcd/usr/local/srcwget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gzwget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gzwget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zipwget http://down1.chinaunix.net/distfiles/zlib-1.2.3.tar.gzwget 2. extend package and install apache reftar zxvf apr-1.4.5.tar.gz & cd apr-1.4.5 &&. /configure -- prefix =/usr/local/apr & make install & cd-tar zxvf apr-util-1.3.12.tar.gz & cd apr-util-1.3.12 &&. /configure -- prefix =/usr/local/apr-util -- with-apr =/usr/local/apr & make install & cd-unzip-o pcre-8.10.zip & & cd pcre-8.10 &&. /configure -- prefix =/usr/local/pcre & make install & cd-tar zxvf zlib-1.2.3.tar.gz & cd zlib-1.2.3 & CFLAGS = "-O3-fPIC ". /configure & make install & cd-#3. install apache tar zxvf httpd-2.4.12.tar.gz & mv httpd-2.4.12 apache2mkdir-p/usr/local/lamp/apache2cd/usr/local/src/apache2. /configure -- prefix =/usr/local/lamp/apache2 -- sysconfdir =/usr/local/lamp/apache2/conf -- with-z =/usr/local/zlib -- disable- userdir -- enable-so -- enable-rewrite = shared -- enable-deflate = shared -- enable-expires = shared -- enable-static-support -- with-apr =/usr/local/apr -- with-apr-util =/usr/local/apr-util -- with-pcre =/usr/local/pcre. /configure \ -- prefix =/usr/local/lamp/apache2 \ apache installation path -- sysconfdir =/usr/local/lamp/apache2/conf \ httpd configuration file path -- with-z =/usr/local/zlib \ dependent zlib -- with-bundled ded-apr \ use a copy of the bound apr (this can be left empty) -- disable-userdir \ The requested image is mapped to a specific user directory -- enable-so \ compiled with dynamic shared object (must be installed) -- enable-rewrite = shared \ rule-based url control -- enable-deflate = shared \ supports narrowing Transfer Encoding -- enable-expires = shared \ expiration header control -- enable-static-support \ create a static link version to support -- with-apr =/usr/local/apr \ dependent apr -- with-apr-util =/usr/local/apr-util \ dependency apr-util -- with-pcre =/usr/local/pcre dependent pcremake & make installvim/usr/local/lamp/apache2/conf/httpd. conf #4. edit conf like-# ServerName www.example.com: 80 + ServerName www.example.com: 80-+ AddType application/x-httpd-php. php #5. start and test apachmcm/usr/local/lamp/apache2/bin &&. /apachectl startcurl localhost # show this for success #
It works! # Almost view the blog http://blog.163.com/wb_zhaoyuwei/blog/static/183075439201341511589479/ # ------------------------------------------------------------------------------ # install mysql,> = mysql5.5 must cmake #1. download mysql wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.13.tar.gz #2. add user and group groupadd gmysql useradd-g gmysql umysql #. /configure -- prefix =/usr/local/lamp/mysql -- with-extra-charsets = complex -- enable-thread-safe-client -- enable-local-infile -- enable-attacker -- disable-shared -- with-client-ldflags =-all-static -- with-mysqld-ldflags =-all-staticm -- with-embedded-server -- with-innodb -- with-extra- charsets = gbk, gb2312, big5 -- without-debug CFLAGS =-O3-mcpu = pentium4 CXXFLAGS =-O3-march = pentium4-felide-constructors-fno-exceptions-fno-rtti CXX = gcc #3. install mysql cmake. \-DCMAKE_INSTALL_PREFIX =/usr/local/lamp/mysql \-DSYSCONFDIR =/usr/local/lamp/mysql/conf \-DMYSQL_DATADIR =/usr/local/lamp/mysql/data \-DMYSQL_TCP_PORT = 3306 \-DMYSQL_USER = umysql \-DMYSQL_UNIX_ADDR =/tmp/mysqld. sock \-DDEFAULT_CHARSET = utf8 \-DDEFAULT_COLLATION = utf8_general_ci \-DEXTRA_CHARSETS = all \-character = 1 \-character = 1 \-DWITH_SSL = bundled make & make install cd/usr/ local/lamp/mysql & chown-R root: gmysql. & chown-R umysql: gmysql data #4. default conf cd/usr/local/lamp/mysql & cp. /support-files/my-default.cnf/etc/my. cnf # init authority table cd/usr/local/lamp/mysql &&. /scripts/mysql_install_db -- user = umysql cd/usr/local/lamp/mysql & ln-s. /bin/mysql/usr/bin #5. start mysqld with 'umysql' cd/usr/local/lamp/mysql & su umysql &&. /bin/mysqld # almost view of the blog http://www.cnblogs.com/xiaoit/p/3994092.html #6. update root password to 123456, default is blank. /bin/mysql> update mysql. user set password = password ('000000') where User = "root" and Host = "localhost"; mysql> flush privileges; # sources # download php's ref and php wget http://down1.chinaunix.net/distfiles/jpegsrc.v6b.tar.gz wget http://down1.chinaunix.net/distfiles/libpng-1.5.13.tar.xz wget http://ftp.yzu.edu.tw/nongnu//freetype/freetype-old/freetype-2.3.12.tar.gz wget http://down1.chinaunix.net/distfiles/gettext-0.17.tar.gz wget http://down1.chinaunix.net/distfiles/libxml2-2.7.4.tar.gz wget http://down1.chinaunix.net/distfiles/gdbm-1.9.1.tar.gz wget http://down1.chinaunix.net/distfiles/libiconv-1.14.tar.gz # wget http://down1.chinaunix.net/distfiles/gd-2.0.33.tar.gz # can't wget https://codeload.github.com/libgd/libgd/tar.gz/gd-2.1.1 # must # wget http://cn2.php.net/distributions/php-5.6.9.tar.gz # too new to match apache2 wget http://cn2.php.net/distributions/php-5.5.12.tar.gz # install php's ref tar-zvxf ready src.v6b.tar.gz & cd jpeg-6b cp/usr/local/share/libtool/config. sub. /& cp/usr/local/share/libtool/config. guess. /mkdir-p/usr/local/release 6/include & mkdir-p/usr/local/release 6/lib & mkdir-p/usr/local/release 6/bin && mkdir-p/usr/local/users 6/man/man1. /configure-prefix =/usr/local/versions 6/-- enable-shared-enable-static & make install-lib & cd-tar-xvJf libpng-1.5.13.tar.xz & cd libpng-1.5.13 &&. /configure-prefix =/usr/local/libpng & make install & cd-tar-zvxf freetype-2.3.12.tar.gz & cd freetype-2.3.12 &&. /configure-prefix =/usr/local/freetype & make install & cd-tar-zvxf gettext-0.17.tar.gz & cd gettext-0.17 &&. /configure-prefix =/usr/local/gettext -- enable-shared & make install & cd-tar-zvxf libxml2-2.7.4.tar.gz & cd libxml2-2.7.4 &&. /configure-prefix =/usr/local/libxml2 -- enable-shared & make install & cd-tar-zvxf gdbm-1.9.1.tar.gz & cd gdbm-1.9.1 &&. /configure-prefix =/usr/local/gdbm -- enable-shared & make install & cd-tar-zvxf libiconv-1.14.tar.gz & cd libiconv-1.14 &&. /configure-prefix =/usr/local/libiconv & make install & cd-# tar-zvxf gd-2.0.33.tar.gz & cd gd-2.0.33 &&. /configure-prefix =/usr/local/gd2-with-zlib =/usr/local/zlib -- with-png =/usr/local/libpng -- with-jpeg =/usr /local/defaults 6 -- with-freetype =/usr/local/freetype & make install & cd-mv gd-2.1.1 gd-2.1.1.tar.gz & tar zxvf gd-2.1.1.tar.gz & cd libgd-gd-2.1.1 && cmake. -DCMAKE_INSTALL_PREFIX =/usr/local/libgd2 & make install & cd-# install versions 6 if (libtool: Command not found) see the blog http://www.bkjia.com/ OS /201403/289110.html (cp config. sub config. guess. /jpeg-6b) # install gd2 if (error: ZLib not installed) see the blog http://blog.csdn.net/sebarsunny/article/details/6123179 (. /configure without the '-prefix') # install gd2 if (error: png. h: No such file or directory) vim Makefile serach include, and add-I/usr/local/libpng/include at the end line. # install gd2 must vision> = libgd. so.2.1.0 # summary install gd2, use '-- with-gd 'replace' -- with-gd =/usr/local/libgd2' # export LDFLAGS = "-L/usr/local/zlib/lib" not test yet # export CPPFLAGS = "-I/usr/local/zlib/include" not test yet # install php tar-zvxf php-5.5.12.tar.gz & cd php-5.5.12. /configure \-prefix =/usr/local/lamp/php/-with-apxs2 =/usr/local/lamp/apache2/bin/apxs \-with-jpeg-dir =/usr /local/defaults 6 \ -- with-gettext \-enable-mbstring \-with-libxml-dir =/usr/local/libxml2 \-with-png-dir =/usr/local /libpng \-with-zlib-dir =/usr/local/zlib \ # -- with-gd =/usr/local/libgd2 \ -- with-gd \ -- with-freetype- dir =/usr/local/freetype \-enable-trace-vars \ -- with-mysql =/usr/local/lamp/mysql \-with-gdbm-dir =/usr/ local/gdbm \ -- enable-wddx \ -- with-iconv \-enable-sockets \-disable-ipv6 make & make install # install php if (error: x11/xpm. h: No such file or directory) see prepare: 4. # install php if (undefined symbol: unixd_config) see the blog http://blog.sina.com.cn/s/blog_5f66526e0100jac7.html cp php. ini-dist/usr/local/php/lib/php. ini ##--------------------------------------------------------------------------------

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.