LAMP安装详细步骤(带安装包,suse10 64位环境通过)
2012-11-27 12:16
645 查看
######################## #组件;apache,php,mysql,gd2(画图),soap(OA认证需要).... ######################## 下载安装包(sam在各官网原版下载) MainPath=/usr/local/soft mkdir ${MainPath} cd ${MainPath} wget http://10.130.73.48/lamp.tar.gz tar -zxf lamp.tar.gz 一、安装mysql 通过凯莉系统安装(http://db.ied.com) 注意:编译php时使用的mysql路径是凯莉默认安装的路径,如果自行安装的mysql,要修改编译php对应的mysql路径。 二、安装apache mkdir /usr/local/apache2 cd ${MainPath};tar -zxf httpd-2.2.21.tar.gz cd httpd-2.2.21/ ./configure --prefix=/usr/local/apache2 --enable-module=so --enable-rewrite make make install make clean 三、安装libxml2 mkdir -p /usr/local/modules/libxml cd ${MainPath};tar -zxf libxml2-2.7.8.tar.gz cd libxml2-2.7.8/ ./configure --prefix=/usr/local/modules/libxml make make install make clean cp /usr/local/modules/libxml/bin/xml2-config /usr/bin/xml2-config 四、安装zlib mkdir /usr/local/modules/zlib cd ${MainPath};tar -zxf zlib-1.2.5.tar.gz cd zlib-1.2.5/ ./configure --prefix=/usr/local/modules/zlib make make install make clean 五、安装jpeg mkdir -p /usr/local/modules/jpeg mkdir -p /usr/local/modules/jpeg/bin mkdir -p /usr/local/modules/jpeg/lib mkdir -p /usr/local/modules/jpeg/include mkdir -p /usr/local/modules/jpeg/man mkdir -p /usr/local/modules/jpeg/man1 mkdir -p /usr/local/modules/jpeg/man/man1 cd ${MainPath};tar -zxf jpegsrc.v6b.tar.gz cd jpeg-6b/ ./configure --prefix=/usr/local/modules/jpeg --enable-shared --enable-static 如果你的机器是64位,并且在安装gd时候出现下面错误: /usr/bin/ld: /server/apache2/modlib/jpeg6//lib/libjpeg.a(compress.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC /server/apache2/modlib/jpeg6//lib/libjpeg.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** [libgd.la] Error 1 修补办法(接上面步骤): vi Makefile 找到 CFLAGS= -O2 -I$(srcdir) 在后面加入-fPIC,即变成CFLAGS= -O2 -I$(srcdir) -fPIC(configure后改),然后继续: cp /usr/bin/libtool ./ make make install-lib make install make clean 六、安装libpng mkdir /usr/local/modules/libpng cd ${MainPath};tar -zxf libpng-1.5.4.tar.gz cd libpng-1.5.4/ ./configure --prefix=/usr/local/modules/libpng make make install make clean 七、安装freetype mkdir /usr/local/modules/freetype cd ${MainPath};tar -zxf freetype-2.4.6.tar.gz cd freetype-2.4.6/ ./configure --prefix=/usr/local/modules/freetype make make install make clean 八、安装gd2 mkdir /usr/local/modules/gd2 cd ${MainPath};tar -zxf gd-2.0.35.tar.gz cd gd/2.0.35/ chmod 640 gd_png.c vi gd_png.c 将 #include "png.h"修改为 #include "/usr/local/modules/libpng/include/png.h"(注意是libpng路径) ./configure --prefix=/usr/local/modules/gd2 --with-zlib=/usr/local/modules/zlib/ --with-png=/usr/local/modules/libpng/ --with-jpeg=/usr/local/modules/jpeg/ --with-xml2=/usr/local/modules/libxml/ --with-freetype=/usr/local/modules/freetype/ make make install make clean 九、安装libmcrypt mkdir /usr/local/modules/libmcrypt cd ${MainPath};tar -zxf libmcrypt-2.5.7.tar.gz cd libmcrypt-2.5.7/ ./configure --prefix=/usr/local/modules/libmcrypt make make install make clean 十、安装mhash mkdir /usr/local/modules/mhash cd ${MainPath};tar -zxf mhash-0.9.9.9.tar.gz cd mhash-0.9.9.9/ ./configure --prefix=/usr/local/modules/mhash make make install make clean 十一、安装mcrypt mkdir /usr/local/modules/mcrypt cd ${MainPath};tar -zxf mcrypt-2.6.8.tar.gz cd mcrypt-2.6.8/ LD_LIBRARY_PATH=/usr/local/modules/libmcrypt/lib:/usr/local/modules/mhash/lib ./configure --prefix=/usr/local/modules/mcrypt --with-libmcrypt-prefix=/usr/local/modules/libmcrypt make make install make clean 十二、安装curl mkdir /usr/local/modules/curl cd ${MainPath};tar -zxf curl-7.22.0.tar.gz cd curl-7.22.0/ ./configure --prefix=/usr/local/modules/curl make make install make clean 十三、安装php5 mkdir /usr/local/php5 cd ${MainPath};tar -zxf php-5.3.8.tar.gz cd php-5.3.8/ ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-jpeg-dir=/usr/local/modules/jpeg/ --with-png-dir=/usr/local/modules/libpng/ --with-libxml-dir=/usr/local/modules/libxml/ --with-gd=/usr/local/modules/gd2/ --with-freetype-dir=/usr/local/modules/freetype/ --with-zlib-dir=/usr/local/modules/zlib/ --with-mysql=/usr/local/mysql --enable-soap --enable-sockets --enable-mbstring --enable-gd-native-ttf --enable-calendar --with-config-file-path=/usr/local/php5/etc/ --with-mcrypt=/usr/local/modules/libmcrypt/ --with-curl=/usr/local/modules/curl make make install make clean 十四、安装后的配置 #创建空的php.ini文件,以后需要增加模块或者对php参数做额外配置时使用 touch /usr/local/php5/etc/php.ini #创建网站主目录 mkdir /data/website echo "<?php phpinfo();?>" >/data/website/index.php #修改apache参数 cp /usr/local/apache2/conf/httpd.conf /usr/local/apache2/conf/httpd.conf.bak.new #绑定内网端口,172.17.148.115需要修改为你的内网IP sed -i 's/^Listen 80/Listen 172.17.148.115:80/g' /usr/local/apache2/conf/httpd.conf sed -i 's/^#ServerName www.example.com:80/ServerName localhost/g' /usr/local/apache2/conf/httpd.conf sed -i 's/\/usr\/local\/apache2\/htdocs/\/data\/website/g' /usr/local/apache2/conf/httpd.conf sed -i 's/Options Indexes FollowSymLinks/Options FollowSymLinks/g' /usr/local/apache2/conf/httpd.conf sed -i 's/DirectoryIndex index.html/DirectoryIndex index.html index.htm index.php/g' /usr/local/apache2/conf/httpd.conf sed -i "s/AddType application\/x-gzip .gz .tgz/AddType application\/x-gzip .gz .tgz\n AddType application\/x-httpd-php .php/g" /usr/local/apache2/conf/httpd.conf 拉起apache /usr/local/apache2/bin/apachectl -k start 到这一步,安装配置已经全部完成! 通过浏览器打开http://youdomain.com,尽情享受LAMP的强大吧!
相关文章推荐
- 64位CentOS 6.5下搭建LAMP环境详细步骤
- 64位CentOS6.5搭建LAMP环境详细步骤
- Android实战(一)------Myeclipse10搭建android运行环境图文详细步骤--------SDK的安装配置
- Windows7(64位)环境下安装openssl详细步骤+图解
- Android实战(一)------Myeclipse10搭建android运行环境图文详细步骤--------SDK的安装配置
- lamp环境安装(linux apache mysql php)步骤及详细解说
- 在CentOS6.4中安装配置LAMP环境的详细步骤
- 在CentOS6.4中安装配置LAMP环境的详细步骤
- Android实战(三)------Myeclipse10搭建android运行环境图文详细步骤--------ADT插件在线安装
- 64位CentOS 6.0下搭建LAMP环境详细步骤
- Android实战(三)------Myeclipse10搭建android运行环境图文详细步骤--------ADT插件在线安装
- 64位CentOS 6.0下搭建LAMP环境详细步骤
- ubuntu系统安装lamp环境和配置的详细步骤
- 64位CentOS 6.0下搭建LAMP环境详细步骤
- Node.js安装及环境配置之Windows篇 一、安装环境 1、本机系统:Windows 10 Pro(64位) 2、Node.js:v6.9.2LTS(64位) 二、安装Node.js步骤
- linux环境下oracle 10 R2安装详细步骤
- spss23安装教程(附详细破解步骤及安装包)
- SUSE环境下通过YaST安装软件
- Centos7环境安装下安装Apache+php7+mysql详细步骤
- Linux通过RPM安装搭建LAMP环境