搭建 Lamp环境apache2412 php5512 mysql5613.docx
- 文档编号:9450006
- 上传时间:2023-02-04
- 格式:DOCX
- 页数:10
- 大小:17.14KB
搭建 Lamp环境apache2412 php5512 mysql5613.docx
《搭建 Lamp环境apache2412 php5512 mysql5613.docx》由会员分享,可在线阅读,更多相关《搭建 Lamp环境apache2412 php5512 mysql5613.docx(10页珍藏版)》请在冰豆网上搜索。
搭建Lamp环境apache2412php5512mysql5613
搭建Lamp环境【apache2.4.12+php5.5.12+mysql5.6.13】
搭建lamp环境【apache2.4.12+php5.5.12+mysql5.6.13】
[plain]viewplaincopy
centos6.6
1.Apache/2.4.12
2.php5.5.12
3.mysql5.6.13
#--------------------------------------------------------------------------------
#prepare
#1.installg++
yumlistgcc-c++
yuminstallgcc-c++.x86_64
#2.installncurses
yumlistncurses-devel
yuminstallncurses-devel.x86_64
#3.installhttpd-devel
yumlisthttpd-devel
yuminstallhttpd-devel.x86_64
#4.installlibXpm-devel.x86_64[forphp]
#installphpif(error:
X11/xpm.h:
Nosuchfileordirectory)
yumlistlibXpm-devel
yuminstalllibXpm-devel.x86_64
#5.installcmake
cd/usr/local/src&&wgethttp:
//www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz
tar-zxvfcmake-2.8.10.2.tar.gz&&cdcmake-2.8.10.2&&./bootstrap&&gmakeinstall&&cd-
#6.installlibtool
cd/usr/local/src&&wgethttp:
//ftp.gnu.org/gnu/libtool/libtool-2.2.6a.tar.gz
tarzxvflibtool-2.2.6a.tar.gz&&cdlibtool-2.2.6&&./configure&&make&&makeinstall
#almostviewtheblog
#7.installszrz
yuminstalllrzsz
#
#--------------------------------------------------------------------------------
#1.downloadapache'srefapachemysqlphp
cd/usr/local/src
wgethttp:
//archive.apache.org/dist/apr/apr-1.4.5.tar.gz
wgethttp:
//archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
wget
wget
wget
#2.extendpackageandinstallapacheref
tarzxvfapr-1.4.5.tar.gz&&cdapr-1.4.5&&./configure--prefix=/usr/local/apr&&make&&makeinstall&&cd-
tarzxvfapr-util-1.3.12.tar.gz&&cdapr-util-1.3.12&&./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr&&make&&makeinstall&&cd-
unzip-opcre-8.10.zip&&cdpcre-8.10&&./configure--prefix=/usr/local/pcre&&make&&makeinstall&&cd-
tarzxvfzlib-1.2.3.tar.gz&&cdzlib-1.2.3&&CFLAGS="-O3-fPIC"./configure&&make&&makeinstall&&cd-
#3.installapache
tarzxvfhttpd-2.4.12.tar.gz&&mvhttpd-2.4.12apache2
mkdir-p/usr/local/lamp/apache2
cd/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依赖的pcre
make&&makeinstall
vim/usr/local/lamp/apache2/conf/httpd.conf
#4.editconflike
-#ServerName:
80
+ServerName:
80
-
+AddTypeapplication/x-httpd-php.php
#5.startandtestapache
cd/usr/local/lamp/apache2/bin&&./apachectlstart
curllocalhost
#showthisforsuccess
#<html><body><h1>Itworks!
</h1></body></html>
#almostviewtheblog
#
#--------------------------------------------------------------------------------
#installmysql,>=mysql5.5mustcmake
#1.downloadmysql
wget
#2.adduserandgroup
groupaddgmysql
useradd-ggmysqlumysql
#./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-debugCFLAGS=-O3-mcpu=pentium4CXXFLAGS=-O3-march=pentium4-felide-constructors-fno-exceptions-fno-rttiCXX=gcc
#3.installmysql
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\
-DENABLED_LOCAL_INFILE=1\
-DWITH_INNOBASE_STORAGE_ENGINE=1\
-DWITH_SSL=bundled
make&&makeinstall
cd/usr/local/lamp/mysql&&chown-Rroot:
gmysql.&&chown-Rumysql:
gmysqldata
#4.defaultconf
cd/usr/local/lamp/mysql&&cp./support-files/my-f/etc/f
#initauthoritytable
cd/usr/local/lamp/mysql&&./scripts/mysql_install_db--user=umysql
cd/usr/local/lamp/mysql&&ln-s./bin/mysql/usr/bin
#5.startmysqldwith'umysql'
cd/usr/local/lamp/mysql&&suumysql&&./bin/mysqld
#almostviewtheblog
#6.updaterootpasswordto123456,defaultisblank
./bin/mysql
mysql>updatemysql.usersetpassword=password('123456')whereUser="root"andHost="localhost";
mysql>flushprivileges;
#
#--------------------------------------------------------------------------------
#downloadphp'srefandphp
wget
wget
wgethttp:
//ftp.yzu.edu.tw/nongnu//freetype/freetype-old/freetype-2.3.12.tar.gz
wget
wget
wget
wget
#wget#can't
wget#must
#wget#toonewtomatchapache2
wget#
#installphp'sref
tar-zvxfjpegsrc.v6b.tar.gz&&cdjpeg-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&&makeinstall&&makeinstall-lib&&cd-
tar-xvJflibpng-1.5.13.tar.xz&&cdlibpng-1.5.13&&./configure-prefix=/usr/local/libpng&&make&&makeinstall&&cd-
tar-zvxffreetype-2.3.12.tar.gz&&cdfreetype-2.3.12&&./configure-prefix=/usr/local/freetype&&make&&makeinstall&&cd-
tar-zvxfgettext-0.17.tar.gz&&cdgettext-0.17&&./configure-prefix=/usr/local/gettext--enable-shared&&make&&makeinstall&&cd-
tar-zvxflibxml2-2.7.4.tar.gz&&cdlibxml2-2.7.4&&./configure-prefix=/usr/local/libxml2--enable-shared&&make&&makeinstall&&cd-
tar-zvxfgdbm-1.9.1.tar.gz&&cdgdbm-1.9.1&&./configure-prefix=/usr/local/gdbm--enable-shared&&make&&makeinstall&&cd-
tar-zvxflibiconv-1.14.tar.gz&&cdlibiconv-1.14&&./configure-prefix=/usr/local/libiconv&&make&&makeinstall&&cd-
#tar-zvxfgd-2.0.33.tar.gz&&cdgd-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&&makeinstall&&cd-
mvgd-2.1.1gd-2.1.1.tar.gz&&tarzxvfgd-2.1.1.tar.gz&&cdlibgd-gd-2.1.1&&cmake.-DCMAKE_INSTALL_PREFIX=/usr/local/libgd2&&make&&makeinstall&&cd-
#installjpeg6if(libtool:
Commandnotfound)seetheblog(cpconfig.subconfig.guess./jpeg-6b)
#installgd2if(error:
ZLibnotinstalled)seetheblog(./configurewithoutthe'-prefix')
#installgd2if(error:
png.h:
Nosuchfileordirectory)vimMakefileserachinclude,andadd-I/usr/local/libpng/includeattheendline.
#installgd2mustvision>=libgd.so.2.1.0
#summaryinstallgd2,use'--with-gd'replace'--with-gd=/usr/local/libgd2'
##exportLDFLAGS="-L/usr/local/zlib/lib"nottestyet
##exportCPPFLAGS="-I/usr/local/zlib/include"nottestyet
#installphp
tar–zvxfphp-5.5.12.tar.gz&&cdphp-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/loc
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 搭建 Lamp环境apache2412 php5512 mysql5613 Lamp 环境 apache2412
![提示](https://static.bdocx.com/images/bang_tan.gif)