2022年LAMP----linux+apache+mysql+php详细安装步骤 .pdf

上传人:Che****ry 文档编号:34263493 上传时间:2022-08-15 格式:PDF 页数:6 大小:46.06KB
返回 下载 相关 举报
2022年LAMP----linux+apache+mysql+php详细安装步骤 .pdf_第1页
第1页 / 共6页
2022年LAMP----linux+apache+mysql+php详细安装步骤 .pdf_第2页
第2页 / 共6页
点击查看更多>>
资源描述

《2022年LAMP----linux+apache+mysql+php详细安装步骤 .pdf》由会员分享,可在线阅读,更多相关《2022年LAMP----linux+apache+mysql+php详细安装步骤 .pdf(6页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、LAMP-linux+apache+mysql+php详 细 安 装 步 骤 之 一APACHE篇(openldap等)linux 详细版本为RHEL5.3 rootlocalhost mail# uname -a Linux localhost.localdomain 2.6.18-128.el5 #1 SMP Wed Dec 17 11:42:39 EST 2008 i686 i686 i386 GNU/Linux 1、上传 apache源代码文件httpd-2.2.13.tar.bz2 其实纯粹安装一个apache很简单rootlocalhost apache# tar xvf http

2、d-2.2.13 rootlocalhost apache# cd httpd-2.2.13 rootlocalhost httpd-2.2.13# ./configure -prefix=/usr/local/apache rootlocalhost httpd-2.2.13# make rootlocalhost httpd-2.2.13# make install 通过以上命令就可以了,安装的目录为/usr/local/apache 一般还会添加些常用的模块,如apr,apr-util,open-ldap 等apache一般会自带apr 和 apr-util,在 srclib 目录里进入

3、 /root/apache/httpd-2.2.13/srclib/apr 目录rootlocalhost apr# ./configure -prefix=/usr/local/apr -enable-threads -enable-other-child rootlocalhost apr# make rootlocalhost apr# make install 然后进入 /root/apache/httpd-2.2.13/srclib/apr-util rootlocalhost apr-util# ./configure -prefix=/usr/local/apr-util -wi

4、th-apr=/usr/local/apr -with-mysql=/usr/local/mysql -with-ldap-lib=/usr/openldap/lib -with-ldap-include=/usr/openldap/include 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 6 页 - - - - - - - - - -with-ldap=ldap -with-berkeley-db=/usr/local/BerkeleyDB.4.4 执行以上操作肯

5、定会报错,因为LDAP 未装, berkeleyDB.4.4 也未装,所以还必须要先装这两个软件上传 openldap-stable-20100219.tgz 和 db-4.4.20.tar.gz,后者就是传说中的BerkeleyDB,也可以从 ORACLE 官网去下载他的源码包rootlocalhost apache# tar zxvf db-4.4.20.tar.gz rootlocalhost apache# cd db-4.4.20/build_unix/ rootlocalhost build_unix# ./dist/configure -prefix=/usr/local/Ber

6、keleyDB.4.4 这儿有点要注意,BerkeleyDB 不能在根目录下configure ,一般都采用上面的方式进行配置rootlocalhost build_unix# make rootlocalhost build_unix# make install 安装完毕后需要配置些东西rootlocalhost build_unix# vim /etc/ld.so.conf 在该文件中加入/usr/local/BerkeleyDB.4.4/lib rootlocalhost build_unix# /sbin/ldconfig rootlocalhost build_unix# vi /e

7、tc/profile 在末尾加上LD_RUN_PA TH=/usr/local/BerkeleyDB.4.4/lib LD_LIBRARY_PA TH=/usr/local/BerkeleyDB.4.4/lib export LD_RUN_PA TH LD_LIBRARY_PA TH rootlocalhost build_unix# source /etc/profile 下面开始安装openldap rootlocalhost apache# tar zxvf openldap-stable-20100219.tgz rootlocalhost apache# cd openldap-2.

8、4.21/ 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 6 页 - - - - - - - - - rootlocalhost openldap-2.4.21# env CPPFLAGS=-I/usr/local/BerkeleyDB.4.4/includeLDFLAGS=-L/usr/local/BerkeleyDB.4.4/lib./configure -prefix=/usr/local/openldap -enable-bdb 报错configure: err

9、or: BerkeleyDB version incompatible with BDB/HDB backends 版本错误rootlocalhost openldap-2.4.21# cp /usr/local/BerkeleyDB.4.4/include/* /usr/include/rootlocalhost openldap-2.4.21# cp /usr/local/BerkeleyDB.4.4/lib/* /usr/lib/全部覆盖然后再执行rootlocalhost openldap-2.4.21# env CPPFLAGS=-I/usr/local/BerkeleyDB.4.4

10、/includeLDFLAGS=-L/usr/local/BerkeleyDB.4.4/lib./configure -prefix=/usr/local/openldap -enable-bdb 就 OK 了,然后按照要求执行rootlocalhost openldap-2.4.21# make depend rootlocalhost openldap-2.4.21# make rootlocalhost openldap-2.4.21# make install 进入刚才apache 下的 apr-util 目录rootlocalhost apr-util# ./configure -p

11、refix=/usr/local/apr-util -with-apr=/usr/local/apr -with-mysql=/usr/local/mysql -with-ldap-lib=/usr/openldap/lib -with-ldap-include=/usr/openldap/include -with-ldap=ldap -with-berkeley-db=/usr/local/BerkeleyDB.4.4 然后 make make install 即可至此 apr,apr-util,BerkeleyDB,openldap安装完毕,下面正式进入apache安装rootlocal

12、host httpd-2.2.13# ./configure -prefix=/usr/local/apache -with-apr=/usr/local/apr -with-apr-util=/usr/local/apr-util -enable-mods-shared=ldap authnz-ldap actions alias asis auth-basic auth-digest authn-anon authn-dbd authn-dbm authn-default authn-file authz-dbm authz-default authz-groupfile authz-ho

13、st authz-owner authz-svn authz-user autoindex cern-meta cgi dav-fs dav-lock dav dav-svn dbd deflate dir dumpio env expires ext-filter filter headers ident imagemap include info log-config log-forensic logio mime-magic mime negotiation proxy-ajp proxy-balancer proxy-connect proxy-ftp proxy-http proxy

14、-scgi proxy reqtimeout rewrite setenvif 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 6 页 - - - - - - - - - speling ssl status substitute unique-id userdir usertrack version vhost-alias 以上我采用了动态模块的方式进行编译,每个模块可以通过httpd.conf 的配置来选择是否加载模块,比如ldap 模块在 httpd.conf 里通

15、过LoadModule ldap_module modules/mod_ldap.so 来加载这个模块只要将此行注释掉,apache将不再加载ldap 模块-enable-mods-shared=的编译方式为动态编译,详见http:/ 配置完成后make make install 即可在 /usr/local/apache 安装好 apache 安装完成LAMP-linux+apache+mysql+php详细安装步骤之二mysql 篇rootlocalhost mysql-5.1.36# ./configure -prefix=/usr/local/mysql -localstatedir=

16、/usr/local/mysql/data/ -without-innodb -without-debug -without-isam -with-charset=utf8 -with-collation=utf8_general_ci -with-extra-charsets=all -enable-assembler -with-pthread -enable-thread-safe-client -with-client-ldflags=-all-static -with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock rootlocal

17、host mysql-5.1.36# make rootlocalhost mysql-5.1.36# make install MYSQL 安装比较简单,从网上找了些文档,然后总结了几个对LINUX 下有帮助的参数,配置安装一下即可Mysql 配置rootlocalhost mysql-5.1.36# cp ./support-files/mysql.server /etc/init.d/mysql rootlocalhost mysql-5.1.36# groupadd mysql rootlocalhost mysql-5.1.36# useradd g mysql mysql root

18、localhost mysql-5.1.36# chmod 777 /etc/init.d/mysql 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 6 页 - - - - - - - - - rootlocalhost mysql-5.1.36# /usr/local/mysql/bin/mysql_install_db rootlocalhost mysql-5.1.36# chown -R mysql:mysql /usr/local/mysql/data/ 启动

19、Mysql rootlocalhost mysql-5.1.36# service mysql start rootlocalhost mysql-5.1.36# /usr/local/mysql/bin/mysqladmin u root p password rootpw / 设置密码为rootpw rootlocalhost mysql-5.1.36Enter password: / 默认密码为空,所以直接回车rootlocalhost mysql-5.1.36# /usr/local/mysql/bin/mysql u root p Enter password: / 输入新密码后,登

20、录成功mysql 安装配置完毕。LAMP-linux+apache+mysql+php详细安装步骤之三php 篇zlib-1.2.3.tar.bz2 libmcrypt-2.5.7.tar.gz mhash-0.9.9.9.tar.bz2 libiconv-1.13.1.tar.gz gd-2.0.33.tar.gz jpegsrc.v7.tar.gz libpng-1.2.10.tar.bz2 libXpm-3.5.5.tar.bz2 libxml2-2.7.4.tar.gz 以上是我单独安装的包,也可以使用REDHAT 自带的,如果是自带的,一般在配置PHP 时采用 /usr/includ

21、e/ 目录就能找到而单独装的包,可以使用./configure -prefix=/dir 来自定义路径,在配置PHP 时采用这个路径即可rootlocalhost php-5.2.13# ./configure -cache-file=./config.cache -prefix=/usr/local/php -sysconfdir=/usr/local/php/etc -infodir=/usr/local/php/info -mandir=/usr/local/php/man -with-apxs2=/usr/local/apache/bin/apxs -disable-debug -wi

22、th-config-file-path=/usr/local/php/lib -with-config-file-scan-dir=/usr/local/php/etc -enable-libxml -with-libxml-dir=/usr/local/libxml -with-zlib=/usr/local/zlib -enable-bcmath -with-bz2=/usr/bin/bzip2 -enable-calendar -enable-ctype -with-curl=/usr/include/curl -with-curlwrappers -enable-zip -enable

23、-ftp -with-gettext -enable-mbstring -with-mcrypt=/usr/local/libmcrypt 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 6 页 - - - - - - - - - -with-mhash=/usr/local/mhash -with-iconv=/usr/local/libiconv -with-xmlrpc -with-xsl=/usr/include/libxslt -with-gd=/usr/loc

24、al/gd2 -with-jpeg-dir=/usr/local/jpeg7 -with-png-dir=/usr/local/libpng -with-xpm-dir=/usr/local/libXpm -with-ttf -with-freetype-dir=/usr/include/freetype2/freetype -without-t1lib -enable-gd-native-ttf -enable-gd-jis-conv -with-mysqli=/usr/local/mysql/bin/mysql_config -with-mysql=/usr/local/mysql -wi

25、th-mysql-sock=/tmp/mysql.sock -with-ldap=/usr/local/openldap -with-gmp=/usr/local/gmp -enable-sigchild -enable-pdo -with-pdo-mysql=/usr/local/mysql make make isntall 后即可安装完成,make test 可做可不做在/usr/local/apache/conf/httpd.conf里找有没有加载PHP LoadModule php5_module modules/libphp5.so AddType application/x-ht

26、tpd-php .php AddType application/x-httpd-php-source .phps 如果没有可以手动加上,测试 PHP 是否安装完成可以在/usr/local/apache/htdocs 里新建一个index.php,内容如下 保存后运行/usr/local/apache/bin/apachectl -k start 启动 APACHE,在浏览器里访问该地址页面即可看到本机的安装的php 信息如果未出现,则证明PHP 未安装成功。名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 6 页 - - - - - - - - -

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高考资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁