(全程演示)Ubuntu8.04 Linux Apache+mysql+php+相关开发包环境搭建

主要针对Ubuntu8.04初始化环境进行的lamp安装.

说明:

这是对网上的资料进行了整理并实际操作成功后形成的文档.感谢网上提供相关资料的朋友!!

 

对不同版本的linux可能有所不同.最新的安装流程及方法请到以下网站交流:

http://blog.csdn.net/chuiyun

http://www.xfocus.com.cn
1.系统环境:
安装时不要选择apache和mysql,避免冲突
如果选择了安装,可用aptitude等工具进行删除

2.用户与密码.
添加了mysql组及其用户mysql
mysql的root默认密码置为:chuiyun(注意修改)

3.文件下载

注:具体下载位置...要麻烦各位GOOGLE一下了.非常欢迎有时间的网友整理一份出来下载列表出来.

  1. apr-1.3.3.tar.gz       
  2. libevent-1.4.7-stable.tar.gz  
  3. mhash-0.9.9.tar.gz
  4. apr-util-1.3.4.tar.gz  
  5. libiconv-1.12.tar.gz          
  6. mysql-5.1.26-rc.tar.gz
  7. curl-7.19.0.tar.gz     
  8. libmcrypt-2.5.8.tar.gz        
  9. neon-0.28.3.tar.gz
  10. freetype-2.3.7.tar.gz  
  11. libpng-1.2.31.tar.gz          
  12. php-5.2.6.tar.gz
  13. httpd-2.2.9.tar.gz     
  14. libxml2-2.7.1.tar.gz          
  15. zlib-1.2.3.tar.gz
  16. jpegsrc.v6b.tar.gz     
  17. mcrypt-2.6.7.tar.gz

4.执行命令
4.1执行命令之相关编译环境准备

  1. apt-get -y install g++ gcc make automake perl
  2. apt-get -y install manpages-dev
  3. apt-get -y install build-essential
  4. apt-get -y install libc6-dev libstdc++6-4.0-dev
  5. apt-get -y install autoconf automake1.9
  6. apt-get -y install binutils-doc cpp-doc gcc-doc glibc-doc
  7. apt-get -y install lrzsz
  8. apt-get -y install libncurses5-dev
  9. apt-get install ncurses-dev

4.2执行命令之相关安装包安装

  1. tar zxvf libiconv-1.12.tar.gz 
  2. cd libiconv-1.12/ 
  3. ./configure -prefix=/usr/local 
  4. make && make install
  5. cd ../ 
  6. tar zxvf freetype-2.3.7.tar.gz 
  7. cd freetype-2.3.7/ 
  8. ./configure 
  9. make && make install
  10. cd ../ 
  11. tar zxvf libpng-1.2.31.tar.gz 
  12. cd libpng-1.2.31/ 
  13. ./configure 
  14. make && make install
  15. cd ../ 
  16. tar zxvf jpegsrc.v6b.tar.gz 
  17. cd jpeg-6b/ 
  18. ./configure -enable-static -enable-shared 
  19. make && make install
  20. make install-lib 
  21. cd ../
  22. tar zxvf libmcrypt-2.5.8.tar.gz 
  23. cd libmcrypt-2.5.8/ 
  24. ./configure 
  25. make && make install
  26. /sbin/ldconfig 
  27. cd libltdl/ 
  28. ./configure -enable-ltdl-install 
  29. make && make install
  30. cd ../../ 
  31. tar zxvf mhash-0.9.9.tar.gz 
  32. cd mhash-0.9.9/ 
  33. ./configure 
  34. make && make install
  35. cd ../ 
  36. cp /usr/local/lib/libmcrypt.* /usr/lib 
  37. ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2 
  38. tar zxvf mcrypt-2.6.7.tar.gz 
  39. cd mcrypt-2.6.7/ 
  40. ./configure 
  41. make && make install
  42. cd ../
  43. tar zvxf  apr-1.3.3.tar.gz
  44. cd apr-1.3.3
  45. ./configure -with-apr=/usr/local/apr/
  46. make && make install
  47. cd ..
  48. tar zvxf  apr-util-1.3.4.tar.gz
  49. cd apr-util-1.3.4
  50. ./configure -prefix=/usr/local/apr-util -with-apr=/usr/local/apr
  51. make && make install
  52. cd ..
  53. tar zvxf libxml2-2.7.1.tar.gz
  54. cd libxml2-2.7.1
  55. ./configure
  56. make && make install
  57. cd ..
  58. tar zvxf neon-0.28.3.tar.gz 
  59. cd neon-0.28.3
  60. ./configure -prefix=/usr/local/neon
  61. make && make install
  62. cd ..
  63. tar zvxf zlib-1.2.3.tar.gz
  64. cd zlib-1.2.3
  65. ./configure --prefix=/usr/local/zlib
  66. make && make install
  67. cd ..
  68. tar zvxf curl-7.19.0.tar.gz
  69. cd curl-7.19.0
  70. ./configure --prefix=/usr/local/curl
  71. make && make install

4.2执行命令之Apache+mysql+php安装

  1. cd ..
  2. tar zvxf httpd-2.2.9.tar.gz
  3. cd httpd-2.2.9
  4. ./configure --prefix=/usr/local/apache2 --enable-expires --enable-proxy --enable-deflate --enable-rewrite --enable-headers --enable-dav --enable-so --enable-modules=all --enable-mods-shared=all --enable-rule=SHARED_CORE --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-z=/usr/local/zlib
  5. make && make install
  6. chmod 775 /usr/local/apache2/bin/*
  7. cd ..
  8. tar zvxf mysql-5.1.26-rc.tar.gz
  9. cd mysql-5.1.26-rc
  10. ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-unix-socket-path=/tmp/mysql.sock --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all -with-pthread -enable-thread-safe-client -without-debug
  11. make && make install
  12. groupadd mysql
  13. useradd -g mysql mysql
  14. cp support-files/my-medium.cnf /etc/mysql/my.cnf
  15. chown -R mysql .
  16. chgrp -R mysql .
  17. scripts/mysql_install_db --user=mysql
  18. /usr/local/mysql/bin/mysqld_safe --user=mysql 
  19. /usr/local/mysql/bin/mysqladmin -uroot password chuiyun
  20. apt-get -y install libxslt1-dev
  21. cd ..
  22. tar zvxf php-5.2.6.tar.gz
  23. cd php-5.2.6
  24. ./configure -prefix=/usr/local/php5 -with-apxs2=/usr/local/apache2/bin/apxs -with-config-file-path=/etc -disable-short-tags -with-iconv-dir=/usr/local -with-freetype-dir -with-jpeg-dir -with-png-dir -with-zlib -with-libxml-dir -enable-xml -disable-debug -disable-rpath -enable-discard-path -enable-safe-mode -enable-bcmath -enable-shmop -enable-sysvsem -enable-inline-optimization -with-curl -with-curlwrappers -enable-mbregex  -enable-mbstring -with-mcrypt -enable-ftp -enable-exif -enable-sockets -enable-soap -with-xmlrpc -enable-calendar -with-gettext -with-mhash  -with-mysql=mysqlnd -with-mysqli=mysqlnd -with-xsl -with-kerberos -disable-safe-mode -with-zlib=/usr/local/zlib -with-curl=/usr/local/curl -with-mysql=/usr/local/mysql -with-mysqli=/usr/local/mysql/bin/mysql_config --with-xsl=/usr/local/include/libxml2 -with-pdo-mysql=/usr/local/mysql/bin/mysql_config -enable-pdo 
  25. make && make install
  26. cp php.ini-dist /etc/php.ini

 

5.配置
vim /etc/php.ini

  1. extension=php_pdo.dll
  2. extension=php_pdo_mysql.dll

vim /usr/local/apache2/conf/httpd.conf

  1. LoadModule php5_module        modules/libphp5.so
  2. AddType application/x-httpd-php .php
  3. AllowOverride All

*加入自动启动.

vim /etc/rc.local

  1. /usr/local/mysql/bin/mysqld_safe --user=mysql 
  2. /usr/local/apache2/bin/apachectl start

允许mysql远程登陆

  1. mysql -u root -pchuiyun
  2. mysql>use mysql;
  3. mysql>update user set host='%' where host='localhost';
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值