个人工具
119.28.94.63
该IP地址的讨论
登录
查看“UbuntuHelp:Danbooru”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:Danbooru”的源代码
来自Ubuntu中文
←
UbuntuHelp:Danbooru
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/Danbooru}} {{Languages|UbuntuHelp:Danbooru}} Danbooru is a powerful image board system which uses tagging extensively. It is built on [[UbuntuHelp:RubyOnRails|RubyOnRails]]. This HOWTO explains how to install it on Ubuntu and other Debian-like distros; it has been tested with Ubuntu 6.06 and Ubuntu Feisty. ==== Prerequisites ==== Install this and more. There used to be a more complete list on the wiki, most of which I had already installed. Additions are welcome. Note: Ensure that you have the Universe repository enabled in your /etc/sources.list. See [[UbuntuWiki:AddingRepositoriesHowto]]. <pre><nowiki> sudo apt-get install rails postgresql-8.1 postgresql-8.1-plruby rubygems libgd2-xpm-dev sudo gem install diff-lcs acts_as_versioned </nowiki></pre> ==== Get the source ==== <pre><nowiki> svn co svn://donmai.us/danbooru/trunk danbooru cd danbooru </nowiki></pre> Tell it where rails is installed system-wide <pre><nowiki> ln -sf /usr/share/rails vendor/ </nowiki></pre> Rebuild the image resizer binary. <pre><nowiki> rm -f lib/resizer/resizer make -C lib/resizer resizer </nowiki></pre> ==== Set up the database ==== Create a self-contained postgresql runtime <pre><nowiki> export PATH=$PATH:/usr/lib/postgresql/8.1/bin export LOCAL_DB=$PWD/var-db export PGDATA=$LOCAL_DB/data initdb export PGHOST=$LOCAL_DB pg_ctl -w -l $LOCAL_DB/server.log start -o "-c listen_addresses= -c unix_socket_directory=$LOCAL_DB" for i in dev test prod; do createdb danbooru-$i; done createuser -sDR danbooru-dbuser </nowiki></pre> Load a schema into the DB - I had some errors, but it still worked. For a real life example, use the schema recently published on http://mapored.net/dump.db.bz2 <pre><nowiki> psql danbooru-dev danbooru-dbuser -f db/postgres.sql </nowiki></pre> Optionally, play around with your new database <pre><nowiki> psql danbooru-dev danbooru-dbuser </nowiki></pre> Stop the database <pre><nowiki> LOCAL_DB=~+/var-db eval 'PGDATA=$LOCAL_DB/data /usr/lib/postgresql/8.1/bin/pg_ctl -w stop' </nowiki></pre> Write a DB config file for [[UbuntuHelp:RubyOnRails|RubyOnRails]] <pre><nowiki> cat <<EOF > config/database.yml common: &common adapter: postgresql host: $PGHOST username: danbooru-dbuser development: database: danbooru-dev <<: *common test: database: danbooru-test <<: *common production: database: danbooru-prod <<: *common EOF </nowiki></pre> ==== Setup the website, and test it ==== Edit the website settings You will probably change the e-mail address and the server address, where image and previews are found. <pre><nowiki> cp config/config_local.yml{.example,} sensible-editor config/config_local.yml </nowiki></pre> Run a few tests. Don't run just «rake» right now, you won't get meaningful error messages. First test with a specific target like test:functionals <pre><nowiki> rake test:functionals rake </nowiki></pre> ==== Start a server ==== Start a database <pre><nowiki> LOCAL_DB=~+/var-db eval 'PGHOST=$LOCAL_DB PGDATA=$LOCAL_DB/data /usr/lib/postgresql/8.1/bin/pg_ctl -w -l $LOCAL_DB/server.log start -o "-c listen_addresses= -c unix_socket_directory=$LOCAL_DB"' </nowiki></pre> Start a local web server until you type Ctrl-C <pre><nowiki> ruby script/server </nowiki></pre> Visit it, create the first user (who automagically becomes admin) <pre><nowiki> sensible-browser http://localhost:3000 </nowiki></pre> Enjoy your danbooru! [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:Danbooru
。