免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1646 | 回复: 0
打印 上一主题 下一主题

安装linux+apache+mysql+php [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-09-20 23:53 |只看该作者 |倒序浏览

[color="#0000ff"]本人最近得到兄弟给的一份     安装linux+apache+mysql+php   的文档,十分高兴希望大家一起学习一下!
1安装linux5
    (1)安装时,不安装任何服务,但是要安装开发库
   (2)在安装到选择安装级别设置时选择禁止

2安装apache
安装的版本为httpd-2.2.4.tar
    (1)解压缩
            tar zxvf httpd-2.2.4.tar
               cd httpd-2.2.4
   (2)配置apache安装信息
            ./configure --prefix=/usr/local/apache2 --enable-module=so
   (3)执行make安装
        make
         make install
完成安装后执行 /usr/local/apache2/bin/apachectl start

[color="#0000ff"]打开浏览器,输入本机ip,如果出现it work 证明安装成功
3安装mysql
安装的版本是mysql-5.0.27.tar.gz
    (1) 即压缩
     tar zxvf  mysql-5.0.27.tar.gz
    (2)配置Mysql安装信息
    cd mysql-5.0.27

[color="#0000ff"]///这段代码为一行   注意 : 后面的 ./configure.....都为一行!!!!!!!!
    ./configure --prefix=/usr/local/mysql
--localstatedir=/var/lib/mysql --with-comment=Source
--with-server-suffix=-Comsenz --with-mysqld-user=mysql--without-debug
--with-big-tables --with-charset=utf8 --with-collation=utf8_general_ci
--with-extra-charsets=all
--with-pthread--enable-static--enable-thread-safe-client
--with-client-ldflags=-all-static
--with-mysqld-ldflags=-all-static--enable-assembler--without-isam--without-innodb--without-ndb-debug

[color="#0000ff"]///!!!!!!!!
   (3)执行make安装
        make
        make install
   (4) 建立mysql群组以及使用者,并以mysql的身份起动server
          groupadd mysql
          useradd mysql
         cd /usr/local/mysql
         bin/mysql_install_db --user=mysql
         chown -R root:mysql .
         chown -R mysql /var/lib/mysql
         cp share/mysql/my-huge.cnf /etc/my.cnf
          cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld
         chmod 755 /etc/rc.d/init.d/mysqld
         chkconfig --add mysqld
        /etc/rc.d/init.d/mysqld start
        bin/mysql -u root password "password_for_root"
        如果能够启动,说明安装成功  



安装GD库(让PHP支持GIF,PNG,JPEG)
安装 jpeg6
建立目录
      mkdir /usr/local/jpeg6
      mkdir /usr/local/jpeg6/bin
      mkdir /usr/local/jpeg6/lib
      mkdir /usr/local/jpeg6/include
      mkdir /usr/local/jpeg6/man
      mkdir /usr/local/jpeg6/man/man1

[color="#0000ff"]///"#"为root命令提示符   !!!!!!!忽略不计
# tar -zxf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
# make; make install

安装zlib (安装libpng和gd前需要先安装zlib)
# tar zxvfzlib-1.2.2.tar.gz
# cd zlib-1.2.2.tar.gz
# ./configure --prefix=/usr/local/zli
# make;make install

安装libpng
# cd /root/soft
# tar -jxf libpng-1.2.8.tar.bz2
# cd libpng-1.2.8.tar.bz2
# cp scripts/makefile.std makefile
# make; make install

安装 freetype
# cd /root/soft
# tar -zxf freetype-2.3.2.tar.gz
# cd freetype-2.3.2.tar.gz
# ./configure --makeprefix=/usr/local/freetype
# make;make install

安装最新的GD库
# cd /root/soft
# tar -zxf gd-2.0.33.tar.gz
# cd gd-2.0.33
# ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/
--with-png --with-zlib=/usr/local/zlib
--with-freetype=/usr/local/freetype/
# make; make install

安装最新的Curl库
# tar -zxf curl-7.15.0.tar.gz
# cd curl-7.15.0.tar.gz
# ./configure --prefix=/usr/local/curl
# make; make install

编译安装PHP
  
  由于php5需libxml2的支持, 所以先下载并安装libxml2
# tar -zxf libxml2-2.6.19.tar.gz
# cd libxml2-2.6.19
# ./configure --prefix=/usr/local/libxml2
# make; make install
安装php
# tar xjvf php-5.2.1.tar.bz2
    # cd php-5.2.1.tar.bz2
    # ./configure --prefix=/usr/local/php
--with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/
--with-curl=/usr/local/curl--enable-ftp
--with-libxml-dir=/usr/local/libxml2 --with-expat-dir=/usr/lib
--with-gd=/usr/local/gd2 --with-jpeg-dir=/usr/local/jpeg6/
--with-zlib-dir=/usr/local/zli/ --with-png=/usr/local/lib/
    # make
    # make install
# cp php.ini-dist /etc/php.ini
修改apache配置文件
1 DocumentRoot 为自己放置页面的路径
2
  LoadModule php5_module modules/libphp5.so
  AddType application/x-httpd-php .php   
  AddType application/x-httpd-php-source .phps

3 DirectoryIndex 在此项后添加index.php

修改php.ini
register-golbals = On
将php.ini文件移动到etc下

               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/78815/showart_1211945.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP