linux 下安装 php、apache、gd2、mysql与svn

需要的文件在网上找最新的下载,这里只记录安装过程。

安装mysql
   17  groupadd mysql
   18  useradd -g mysql mysql


   19  tar xzvf mysql-5.0.45.tar.gz
   20  cd mysql-5.0.45
   21  ./configure --prefix=/usr/local/mysql
   22  make
   23  make install
   24  cp support-files/my-medium.cnf /etc/my.cnf
   25  cd /usr/local/mysql/
   26  bin/mysql_install_db --user=mysql
   27  chown -R root .
   28  chown -R mysql var
   29  chgrp -R mysql .
   30  cd /usr/local/mysql/
   31  ll
   32  ./bin/mysqld_safe --user=mysql &

安装OpenSSL
   35  tar xzvf openssl-0.9.8k.tar.gz
   36  cd openssl-0.9.8k
   37  ./config --prefix=/usr/local/ssl
   38  make
   40  make install

安装APR
   69  tar xzvf apr-1.3.3.tar.gz
   70  cd apr-1.3.3
   71  ./configure
   72  make
   73  make install

安装APR-UTIL
   76  tar xzvf apr-util-1.3.4.tar.gz
   77  cd apr-util-1.3.4
   78  ./configure --with-apr=/usr/local/apr/
   79  make
   80  make install

安装apache
   为了使svn与apache集成,在安装apache时需要启用mod_dav模块,用--enable-dav=shared选择开启,成功后,会在apache/modules/下生成mod_dav.so.

   grooupadd apache

   useradd apache


   83  tar xzvf httpd-2.2.11.tar.gz
   84  cd httpd-2.2.11
   85  ./configure --prefix=/usr/local/apache2 --with-mysql=/usr/local/mysql --enable-ssl --with-ssl=/usr/local/ssl/ --enable-rewrite=shared --enable-speling=shared --enable-module=so --enable-dav=shared --enable-so --enable-maintainer-mode --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config
   86  make
   87  make install
   88  /usr/local/apache2/bin/apachectl start

安装CURL

   47  tar xzvf curl/ for/ Linux/ 7.192.gz
   48  cd curl
   49  cd curl-7.19.2/
   50  ./configure --prefix=/usr/local/curl
   51  make && make install
   52  history

安装expact

   55  tar -xzvf expat-2.0.1.tar.gz
   56  cd expat-2.0.1
   57  ./configure --prefix=/usr/local/expat
   58  make && make install

安装gzip

   93  tar xzvf gzip-1.3.5.tar.gz
   94  cd gzip-1.3.5
   95  ./configure --prefix=/usr/local/gzip
   96  make && make install

安装libxml2

   99  tar xzvf libxml2-2.6.30.tar.gz
  100  cd libxml2-2.6.30
  101  ./configure --prefix=/usr/local/libxml2
  102  make && make install

安装zlib

  105  tar xzvf zlib-1.2.3.tar.gz
  106  cd zlib
  107  cd 1.2.3/
  108  ./configure
  109  make && make install

安装jpeg6

  120  tar xzvf jpegsrc.v6b.tar.gz
  121  cd jpeg
  122  cd jpeg-6b/
  123  ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
  124  make && make install

安装libpng

  127  tar xzvf libpng-1.2.35.tar.gz
  128  cd libpng-1.2.35
  129  ./configure
  130  make && make install

安装freetype

  134  tar xzvf freetype-2.3.8.tar.gz
  135  cd freetype-2.3.8
  136  mkdir -p /usr/local/freetype
  137  ./configure --prefix=/usr/local/freetype
  138  make && make install

安装gd2
  安装gd时报错,possibly undefined macro: AM_ICONV,要先 yum install gettext-devel
  141  tar xzvf gd-2.0.35.tar.gz
  142  mkdir -p /usr/local/gd2
  143  cd gd-2.0.35
  144  ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/ --with-png --with-zlib --with-freetype=/usr/local/freetype/
  145  make && make install

安装php

  151  tar xzvf php-5.2.9.tar.gz
  152  cd php-5.2.9
  154  ./configure --prefix=/usr/local/php --with-openssl=/usr/local/ssl --with-apxs2=/usr/local/apache2/bin/apxs --with-freetype=/usr/local/freetype --enable-trace-avrs --with-mysql=/usr/local/mysql --with-zlib --with-libxml=/usr/local/libxml2 --enable-shared --with-curl=/usr/local/curl --with-expat=/usr/local/expat --with-gd=/usr/local/gd2 --with-jpeg-dir=/usr/local/jpeg6 --with-png --enable-mbstring=all --enable-mbregex --enable-so
  155  make
  156  make install

配置

  如果要让apache启动时支持ssl,需要运行下面的命令,否则会在启动时报错
  mkdir /usr/local/apache2/conf/ssl.crt
  openssl genrsa -des3 -passout pass:asecretpassword -out /usr/local/apache2/conf/ssl.crt/server.key.org 1024
  openssl req -new -passin pass:asecretpassword -passout pass:asecretpassword -key /usr/local/apache2/conf/ssl.crt/server.key.org -out /usr/local/apache2/conf/ssl.crt/server.csr -days 3650
  openssl req -x509 -passin pass:asecretpassword -passout pass:asecretpassword -key /usr/local/apache2/conf/ssl.crt/server.key.org -in /usr/local/apache2/conf/ssl.crt/server.csr -out /usr/local/apache2/conf/ssl.crt/server.crt -days 3650
  openssl rsa -passin pass:asecretpassword -in /usr/local/apache2/conf/ssl.crt/server.key.org -out /usr/local/apache2/conf/ssl.crt/server.key
  mkdir /usr/local/apache2/conf/ssl.key
  mv /usr/local/apache2/conf/ssl.crt/server.key /usr/local/apache2/conf/ssl.key/server.key
  chmod 400 /usr/local/apache2/conf/ssl.key/server.key

  /usr/local/apache2/conf 下编辑httpd.conf文件  
  For PHP 4:  LoadModule php4_module modules/libphp4.so
  For PHP 5:  LoadModule php5_module modules/libphp5.so
  AddType application/x-httpd-php .php .phtm
  AddType application/x-httpd-php-source .phps
  Include conf/extra/httpd-ssl.conf 去掉前面的#

  /usr/local/apache2/extra 下编辑httpd-ssl.conf
  将DocumentRoot设成与httpd.conf中的DocumentRoot一致
  SSLCertificateFile /usr/local/apache2/conf/ssl.crt/server.crt (修改了证书的路径)
  SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/server.key (修改了证书的路径)

  在/etc/rc.local中加入
  /usr/local/mysql/share/mysql/mysql.server start
  /usr/local/apache2/bin/httpd
  开机自动运行

  可能要重启电脑

安装svn

  195  tar xzvf subversion-1.5.1.tar.gz
  197  cd subversion-1.5.1
  198  ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr
  199  make
  200  make install

查看subversion两个动态库有没有安装成功
看到下面两个模块,说明安装成功
LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

配置SVN
vi /opt/apache/conf/httpd.conf
在apache的配置文件中,加下下面的配置信息:
 <Location /repos>
     DAV svn
     SVNParentPath /var/svn
     AuthType Basic
     AuthName "Subversion repository"
     AuthUserFile /etc/svn-auth-file
     AuthzSVNAccessFile /etc/svn-access-file
     Require valid-user
</Location>

新建svn帐户
   htpasswd -cm /etc/svn-auth-file admin    这个是新建第一帐户时使用的语句,-c 新建文件  -m 使用MD5加密密码。在Windows, Netware, TPF上这是默认方法,详细请参照htpasswd用法。
   htpasswd -m /etc/svn-auth-file shjiye    当已经存在密码文件时,再加入帐户不需要使用c参数,而且是不应该再使用,否则会丢失已经存在的帐户。
   创建后,svn-auth-file 内容如下:
      1 admin:$apr1$AXvKNNp3$PpA5OyxkgXW/sC0bPX3HM/
      2 shjiye:$apr1$H2yPGNx9$1kHivrM8N0LjKB0wMb5mZ.
      3 test:$apr1$JaZ2KCoY$gvMo7d.uF.DCbQe6Bmsam/

加入访问权限控制,svn-access-file内容如下,
      1 [groups]
      2 admin = admin,shjiye
      3 dev = shjiye,admin
      4 subdev = test
      5
      6 [/]
      7 @admin = rw
      8 * = r
      9
     10 [test:/]
     11 @dev = rw
     12
     13 [test:/subtest]
     14 @subdev = rw

新建 版本库。

     1029  svnadmin create /var/svn/test

修改版本库的访问权限

    chown –R apache.apache /var/svn

    apache.apache是当前运行apache的组与用户,当然你可以根据你当前运行apache的帐户设置,

    查看当前运行apache的用户:ps aux | grep httpd

可以用下面的url访问test版本库。


http://ip or url/repos/test
使用TortoisSVN浏览上面的URL,输入上面新的帐户密码后,登录成功。访问的url中,repos为httpd.conf的Location中指定的名称,test为新建的repository的名字。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值