搭建 lamp環境【apache2.4.12 + php5.5.12 + mysql5.6.13】

來源:互聯網
上載者:User

標籤:lamp   apache   mysql   php   cmake   

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. install ncursesyum list ncurses-develyum install ncurses-devel.x86_64# 3. install httpd-develyum list httpd-develyum install httpd-devel.x86_64# 4. install 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 cmakecd /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 && 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 http://mirrors.cnnic.cn/apache//httpd/httpd-2.4.12.tar.gz# 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 && 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 && make install && cd -unzip -o pcre-8.10.zip && cd pcre-8.10 && ./configure --prefix=/usr/local/pcre && make && make install && cd -tar zxvf zlib-1.2.3.tar.gz && cd zlib-1.2.3 && CFLAGS="-O3 -fPIC" ./configure && make && 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安裝路徑--sysconfdir=/usr/local/lamp/apache2/conf \  httpd設定檔路徑--with-z=/usr/local/zlib \                  依賴的zlib--with-included-apr \                       使用捆綁apr的副本(可以不裝)--disable-userdir \                         請求的映象到使用者特定的目錄--enable-so \                               以動態共用對象編譯(必須安裝)--enable-rewrite=shared \                   基於規則的url操控--enable-deflate=shared \                   縮小傳輸編碼的支援--enable-expires=shared \                   期滿頭控制--enable-static-support  \                  建立一個靜態連結版本的支援--with-apr=/usr/local/apr \                 依賴的apr--with-apr-util=/usr/local/apr-util \       依賴的apr-util--with-pcre=/usr/local/pcre                 依賴的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 apachecd /usr/local/lamp/apache2/bin && ./apachectl startcurl localhost# show this for success # <html><body><h1>It works!</h1></body></html># 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 groupgroupadd gmysqluseradd -g gmysql umysql# ./configure --prefix=/usr/local/lamp/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler --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 mysqlcmake . -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 -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_SSL=bundledmake && make installcd /usr/local/lamp/mysql && chown -R root:gmysql . && chown -R umysql:gmysql data# 4. default confcd /usr/local/lamp/mysql && cp ./support-files/my-default.cnf /etc/my.cnf# init authority tablecd /usr/local/lamp/mysql && ./scripts/mysql_install_db --user=umysqlcd /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 the blog http://www.cnblogs.com/xiaoit/p/3994092.html# 6. update root password to 123456, default is blank./bin/mysqlmysql> update mysql.user set password=password('123456') where User="root" and Host="localhost";mysql> flush privileges; ##--------------------------------------------------------------------------------# download php's ref and phpwget http://down1.chinaunix.net/distfiles/jpegsrc.v6b.tar.gzwget http://down1.chinaunix.net/distfiles/libpng-1.5.13.tar.xzwget http://ftp.yzu.edu.tw/nongnu//freetype/freetype-old/freetype-2.3.12.tar.gzwget http://down1.chinaunix.net/distfiles/gettext-0.17.tar.gzwget http://down1.chinaunix.net/distfiles/libxml2-2.7.4.tar.gzwget http://down1.chinaunix.net/distfiles/gdbm-1.9.1.tar.gzwget http://down1.chinaunix.net/distfiles/libiconv-1.14.tar.gz#wget http://down1.chinaunix.net/distfiles/gd-2.0.33.tar.gz   #can'twget 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 apache2wget http://cn2.php.net/distributions/php-5.5.12.tar.gz     ## install php's reftar -zvxf jpegsrc.v6b.tar.gz && cd jpeg-6b cp /usr/local/share/libtool/config/config.sub ./ && cp /usr/local/share/libtool/config/config.guess ./mkdir -p /usr/local/jpeg6/include && mkdir -p /usr/local/jpeg6/lib && mkdir -p /usr/local/jpeg6/bin && mkdir -p /usr/local/jpeg6/man/man1./configure -prefix=/usr/local/jpeg6/ --enable-shared -enable-static && make && make install && make install-lib && cd -tar -xvJf libpng-1.5.13.tar.xz && cd libpng-1.5.13 && ./configure -prefix=/usr/local/libpng && make && make install && cd -tar -zvxf freetype-2.3.12.tar.gz && cd freetype-2.3.12 && ./configure -prefix=/usr/local/freetype && make && make install && cd -tar -zvxf gettext-0.17.tar.gz && cd  gettext-0.17 && ./configure -prefix=/usr/local/gettext --enable-shared && make && make install && cd -tar -zvxf libxml2-2.7.4.tar.gz && cd libxml2-2.7.4 && ./configure -prefix=/usr/local/libxml2 --enable-shared && make && make install && cd -tar -zvxf gdbm-1.9.1.tar.gz && cd gdbm-1.9.1 && ./configure -prefix=/usr/local/gdbm --enable-shared && make && make install && cd -tar -zvxf libiconv-1.14.tar.gz && cd libiconv-1.14 && ./configure -prefix=/usr/local/libiconv && make && 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/jpeg6 --with-freetype=/usr/local/freetype && make && 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 && make install && cd -# install jpeg6 if (libtool:Command not found) see the blog http://www.2cto.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 phptar –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/jpeg6 --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-ipv6make && 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.htmlcp php.ini-dist /usr/local/php/lib/php.ini##--------------------------------------------------------------------------------

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

搭建 lamp環境【apache2.4.12 + php5.5.12 + mysql5.6.13】

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.