Gforge安裝指南(RH Linux 4.4 32bits)

前言:

安裝gforge需要安裝以下套件,包括:

Openssl

Apache

Postgresql

Php

Bdb

Svn

我的Server版本是Redhat Enterprise 4.4 32bits 不安裝DefaultWeb Server, Database Server等等

我準備了這些tar包:

Openssl-0.9.8e.tar.gz

httpd-2.2.6.tar.gz

postgresql-8.2.5.tar.gz

php-5.2.4.tar.gz

db-4.4.20.tar.gz

subversion-1.2.1.tar.bz2

gforge-4.5.16.tar.bz2

都能從網路上找到並下載。


我依照以下順序安裝以上這些包。

. openssl

#tar -zvxf openssl-0.9.8e.tar.gz

#cd openssl-0.9.8e

# ./config --prefix=/usr/local/openssl

#make

#make install

. apache

# tar -zxf httpd-2.2.6.tar.gz

# cd httpd-2.2.6

# ./configure --prefix=/usr/local/apache --enable=-dav--enable-so --enable-ssl --with-ssl=/usr/local/openssl --enable-rewrite --enable-maintainer-mode

#make

#make install

: dav, so maintainer-mode都是必需的。

. postgresql

#tar -zxvf postgresql-8.2.5.tar.gz

# cd postgresql-8.2.5

# ./configure --prefix=/usr/local/pgsql --with-openssl

#gmake

#gmake install

#adduser postgres

#passwd postgres

#mkdir /usr/local/pgsql/data

#chown postgres /usr/local/pgsql/data

#/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data (初始數據庫)

# /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 & (會在後台運行並返回一pid)

. php

#tar zxf php-5.2.4.tar.gz

#cd php-5.2.4

# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-pgsql=/usr/local/pgsql --enable-mbstring --enable-ftp

#make

#make install

#cp php.ini-dist /usr/local/php/lib/php.ini

#vi php.ini

修改

register_globals=On

magic_quotes_gpc=On

file_uploads=On

include_path=".:/var/www/gforge:/var/www/gforge/www:/var/www/gforge/www/include:/etc/gforge:/var/www/gforge/www/admin/:/var/www/gforge/plugins/scmcvs/etc:/var/www/gforge/plugins/scmsvn/etc"#vi /usr/local/apache/conf/httpd.conf

寫入

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

尋找DirectoryIndex

加入 index.htm index.php

reboot apache

五. BDB

# tar zxf db-4.4.20.tar.gz

# cd db-4.4.20/build_unix/

#../dist/configure --prefix=/usr/local/bdb (注意 不能在dist/裡面config)

#make

#make install

六. SVN

#tar xvfj subversion-1.2.1.tar.bz2

#cd subversion-1.2.1

# ./configure --with-berkeley-db=/usr/local/bdb --with-apxs=/usr/local/apache/bin/apxs --with-ssl --with-libs=/usr/local/openssl --enable-maintainer-mode

#make

#make install

#svnadmin –version (檢查svnversion)

#svnserve –d (啟動svn service)

(如果path沒設好,請到目標目錄裡嘗試啟動, prefix不設沒關係)

七. gforge

#tar xvfj gforge-4.5.16.tar.bz2

#mv gforge-4.5.16 /var/www/gforge

#mkdir /etc/gforge

# cp /var/www/gforge/etc/local.inc.example /etc/gforge/local.inc

#vi /etc/gforge/local.inc

修改

$sys_dbhost="localhost"

$sys_dbname="gforge"

$sys_dbuser="postgres"

$sys_dbpasswd="你剛給予的postgresql密碼"

$sys_urlroot='/var/www/gforge/www/';

$sys_themeroot='/var/www/gforge/www/themes/';

$sys_default_domain = 'gforge.company.com';

$sys_forum_return_domain = "gforge.company.com";

$sys_download_host = 'download.gforge.company.com';

$sys_shell_host = 'shell.gforge.company.com';

$sys_users_host = 'users.gforge.company.com';

$sys_scm_host = 'cvs.gforge.company.com';

(gforge.company.com轉換成你自己的 domain)

$svndir_prefix='/usr/local/bin';

$sys_plugins_path='/var/www/gforge/plugins/';

以上是必須注意要改的變量,還有將所有/var/lib/gforgepath改成/var/www/gforge (因為我們安裝在/var/www/gforge)

八. 準備gforge用的database

# vi /usr/local/pgsql/data/pg_hba.conf

加入

host gforge gforge 127.0.0.1 255.255.255.255 md5


# vi /usr/local/pgsql/data/postgresql.conf

修改或加入

tcpip_socket = true


#su - postgres

#/usr/local/pgsql/bin/psql template1

template1=# CREATE USER gforge NOCREATEUSER NOCREATEDB PASSWORD 'gfpwd';

CREATE ROLE

template1=# CREATE DATABASE gforge OWNER gforge ENCODING 'UNICODE';

CREATE DATABASE

template1=# \q

#/usr/local/pgsql/bin/createlang plpgsql gforge

#cd /var/www/gforge/www/db

#/usr/local/pgsql/bin/psql gforge

gforge=# \i gforge.sql

gforge=# \q

九. 設定ApacheVirtual Server連到/var/www/gforge/www

(Server Name一定要與gforgelocal.incdomain一致才能運作)

設置Virtual Server範例(假設我是要以8080 Port連到gforge):


Listen 8080

DocumentRoot "/var/www/gforge/www"

ForceType application/x-httpd-php

ForceType application/x-httpd-php

Options FollowSymLinks

AllowOverride None

Order allow,deny

allow from all

ServerName yourdns.com

如果你是使用Webmin來設定virtual host,你只要修改httpd.conf文件,並照著以上範例增減就可以了。

現在嘗試連到你的gforge伺服器。

留言

vacillating寫道…
二. apache
# tar -zxf httpd-2.2.6.tar.gz
# cd httpd-2.2.6
# ./configure --prefix=/usr/local/apache --enable=-dav--enable-so --enable-ssl --with-ssl=/usr/local/openssl --enable-rewrite --enable-maintainer-mode
#make
#make install
註: dav, so 和 maintainer-mode都是必需的


./configure裡面 第一個enable後面多了一個"=",把他去掉就可以跑囉

Back to Title

熱門文章

Back to Title