架设packages.ubuntu.org.cn过程。

论坛日常站务以及建议或咨询
回复
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

架设packages.ubuntu.org.cn过程。

#1

帖子 oneleaf » 2005-11-18 17:46

担心忘记了,一点一点记录过程。

packages.ubuntu.com 的站长非不肯公布架设方法,只好一点一点摸索。
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#2

帖子 oneleaf » 2005-11-18 17:48

一:从服务器下载Debian的脚本

cvs -d :pserver:anonymous@cvs.debian.org:/cvs/webwml login
cvs -d :pserver:anonymous@cvs.debian.org:/cvs/webwml checkout packages
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#3

帖子 oneleaf » 2005-11-18 18:00

第二安装perl运行环境

apt-get install libapache2-mod-perl2
/etc/init.d/apache2 force-reload
apt-get install libxml-rss-perl
apt-get install libcompress-zlib-perl
apt-get install libdata-dumper-simple-perl
apt-get install libio-stringy-perl
apt-get install libmldbm-perl
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#4

帖子 oneleaf » 2005-11-18 18:20

第二 vim config.sh 根据情况修改如下:

代码: 全选

# Configuration for packages.debian.org
#

topdir=/share/packages

tmpdir=${topdir}/tmp
bindir=${topdir}/bin
scriptdir=${topdir}/htmlscripts
libdir=${topdir}/lib
filesdir=${topdir}/files
htmldir=${topdir}/www
archivedir=${topdir}/archive
podir=${topdir}/po
localedir=${topdir}/locale
staticdir=${topdir}/static
configdir=${topdir}/etc

# unset this if packages.debian.org moves somewhere where the packages files
# cannot be obtained locally
#
#localdir=/org/ftp.debian.org/ftp

# path to private ftp directory
#ftproot=/org/ftp.root

ftpsite=http://ubuntu.cn99.com/ubuntu
#nonus_ftpsite=http://ftp.uk.debian.org/debian-non-US
#security_ftpsite=http://security.debian.org/debian-security
#volatile_ftpsite=http://volatile.debian.net/debian-volatile
#amd64_ftpsite=http://amd64.debian.net/debian

# Architectures
#
polangs="de fi nl fr uk"
ddtplangs="de cs da eo es fi fr hu it ja nl pl pt_BR pt_PT ru sk sv_SE uk"
parts="main multiverse restricted universe"
dists="warty hoary breezy dapper"
arch_warty="i386 amd64 powerpc"
arch_hoary="i386 amd64 powerpc"
arch_breezy="i386 amd64 powerpc"
arch_dapper="i386 amd64 powerpc"
#arch_oldstable="alpha arm hppa i386 ia64 m68k mips mipsel powerpc s390 sparc"
#arch_stable="${arch_oldstable} amd64"
#arch_testing="${arch_stable}"
#arch_unstable="${arch_stable} hurd-i386"
#arch_experimental="${arch_unstable}"
#arch_testing_proposed_updates="${arch_testing}"
#arch_stable_proposed_updates="${arch_stable}"

# Miscellaneous
#
admin_email="root@ubuntu.org.cn"
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#5

帖子 oneleaf » 2005-11-18 18:24

vim cgi-bin/search_packages.pl 修改:

my $HOME = "http://www.debian.org";
my $ROOT = "";
my $SEARCHPAGE = "http://packages.debian.org/";
my @DISTS = qw( oldstable stable testing unstable experimental );



my $HOME = "http://www.ubuntu.org.cn";
my $ROOT = "";
my $SEARCHPAGE = "http://packages.ubuntu.org.cn";
my @DISTS = qw( warty hoary breezy dapper );
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#6

帖子 oneleaf » 2005-11-18 19:57

建立虚拟主机

代码: 全选

<VirtualHost *>
        ServerAdmin webmaster@localhost
        ServerName packages.ubuntu.org.cn
        CustomLog  /var/log/apache2/packages.wubuntu.org.cn-access.log combined
        ScriptAlias /cgi-bin /disk/packages/cgi-bin/
        DocumentRoot /share/packages/

        RewriteEngine on
        RewriteRule ^/([^/+]*)([+])([^/]*)$ "/$1%%{%}2B$3" [N]
        RewriteRule ^/src:([^/]+)$ http://packages.ubuntu.org.cn/cgi-bin/search_packages.pl?searchon=sourcenames&version=all&exact=1&keywords=$1 [R,L,NE]
        RewriteRule ^/file:(.+)$ http://packages.ubuntu.org.cn/cgi-bin/search_contents.pl?word=$1&searchmode=searchfiles [R,L,NE]
        RewriteRule ^/dirs:(.+)$ http://packages.ubuntu.org.cn/cgi-bin/search_contents.pl?word=$1&searchmode=searchfilesanddirs [R,L,NE]
        RewriteRule ^/word:(.+)$ http://packages.ubuntu.org.cn/cgi-bin/search_contents.pl?word=$1&searchmode=searchword [R,L,NE]
        RewriteRule ^/list:([^/]+)$ http://packages.ubuntu.org.cn/cgi-bin/search_contents.pl?word=$1&searchmode=filelist [R,L,NE]
        RewriteCond %{LA-U:SCRIPT_FILENAME} "!-f"
        RewriteCond %{LA-U:SCRIPT_FILENAME} "!-d"
        RewriteRule ^/([^/]+)$ http://packages.ubuntu.org.cn/cgi-bin/search_packages.pl?searchon=names&version=all&exact=1&keywords=$1 [R,L,NE]

        <Directory /share/packages/www/>
          Options +MultiViews +FollowSymLinks +Indexes
          AddHandler type-map var
          AllowOverride AuthConfig FileInfo
          AddType application/rss+xml .rdf .xml
        </Directory>

</VirtualHost>
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#7

帖子 oneleaf » 2005-11-18 20:09

修改 vim bin/daily
修改为 :topdir=/share/packages

修改 vim /bin/pkg2maint
$maintainerdb = "/share/packages/etc/maintainerdb";

然后运行: bin/daily
上次由 oneleaf 在 2005-11-18 23:17,总共编辑 1 次。
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#8

帖子 oneleaf » 2005-11-18 21:37

重新升级一下,试试。
perl -MCPAN -e 'install "IO/Scalar"'
perl -MCPAN -e 'install "Compress::Zlib"'
perl -MCPAN -e 'install "Class::Accessor"'
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#9

帖子 oneleaf » 2005-11-19 8:54

好了,站点雏型已经具备。剩下开始调整。
回复