LiveJournal Server

来自开放百科 - 灰狐
2007年2月18日 (日) 23:51Allen (讨论 | 贡献)的版本

跳转到: 导航, 搜索

LiveJournal is an open source content management system, written mainly in Perl[o]» and utilizing MySQL as a database backend. By itself, it serves as a powerful content updating system. In other uses, it is the framework application behind many successful online communities, including LiveJournal.com and DeadJournal.com.

LiveJournal on Lighttpd

Install

# apt-get install apache 
# apt-get install libapache-mod-perl
LJHOME=/home/lj; export LJHOME
wget http://www.livejournal.org/download/code/ // 版本有些旧,可通过 svn 获得最新版

./bootstrap.pl

update httpd.conf

ServerType standalone
ServerRoot "/etc/apache-perl"
PidFile /var/run/apache-perl.pid
ScoreBoardFile /var/run/apache-perl.scoreboard
Timeout 30
KeepAlive Off
MinSpareServers 5
MaxSpareServers 40
StartServers 10
MaxClients 20
MaxRequestsPerChild 500
LoadModule mime_module        /usr/lib/apache/1.3/mod_mime.so
LoadModule autoindex_module   /usr/lib/apache/1.3/mod_autoindex.so
LoadModule dir_module         /usr/lib/apache/1.3/mod_dir.so
Port 80
User lj
Group lj
SendBufferSize 131072
ServerName   www.yoursite.com
PerlSetEnv   LJHOME /home/lj
PerlRequire  /home/lj/cgi-bin/modperl.pl
cp doc/ljconfig.pl.txt cgi-bin/ljconfig.pl

$LJHOME/bin/checkconfig.pl

Required Modules

DBI	libdbi-perl
DBD::mysql	libdbd-mysql-perl
Digest::MD5	libdigest-md5-perl
Digest::SHA1	libdigest-sha1-perl
Image::Size	libimage-size-perl
MIME::Lite	libmime-lite-perl
MIME::Words	libmime-perl
Compress::Zlib	libcompress-zlib-perl
MIME::Base64	libmime-base64-perl
URI::URL	liburi-perl
HTML::Tagset	libhtml-tagset-perl
HTML::Parser	libhtml-parser-perl
LWP::Simple	libwww-perl
LWP::UserAgent	libwww-perl
GD	libgd-perl
Mail::Address	libmailtools-perl
Unicode::MapUTF8	libunicode-maputf8-perl
Storable	libstorable-perl
Time::HiRes	libtime-hires-perl
IO::WrapTie	 

Use CPAN

# perl -MCPAN -e shell
cpan> install Bundle::CPAN
cpan> reload cpan
cpan> install DBI
cpan> install DBD::mysql
cpan> install Digest::MD5
cpan> install Digest::SHA1
cpan> install Image::Size
cpan> install MIME::Lite
cpan> install MIME::Words
cpan> install Compress::Zlib
cpan> install MIME::Base64
cpan> install URI::URL
cpan> install HTML::Tagset
cpan> install HTML::Parser
cpan> install LWP::Simple
cpan> install LWP::UserAgent
cpan> install GD
cpan> install Mail::Address
cpan> install Unicode::MapUTF8
cpan> install Storable
cpan> install Time::HiRes
cpan> install IO::WrapTie
cpan> install Net::SMTP
cpan> install GD::Graph
cpan> install Proc::ProcessTable
cpan> install RPC::XML
cpan> install SOAP::Lite
cpan> install XML::RSS
cpan> install String::CRC32

Debian Install

# apt-get install libdbi-perl libdbd-mysql-perl libdigest-md5-perl \
libdigest-sha1-perl libimage-size-perl libmime-lite-perl \
libmime-perl libcompress-zlib-perl libmime-base64-perl \
liburi-perl libhtml-tagset-perl libhtml-parser-perl \
libwww-perl libwww-perl libgd-perl \
libmailtools-perl libunicode-maputf8-perl libstorable-perl \
libtime-hires-perl  

# apt-get install libnet-perl libgd-graph-perl libproc-process-perl \
librpc-xml-perl libsoap-lite-perl libxml-rss-perl \
libstring-crc32-perl 
$ mysql -uroot -p
mysql> CREATE DATABASE livejournal;
mysql> GRANT ALL PRIVILEGES ON livejournal.* TO lj@'localhost' IDENTIFIED BY 'ljpass';  
mysql > flush privileges;
$ bin/upgrading/update-db.pl --runsql --populate
$ bin/upgrading/texttool.pl load // 成功创建 livejournal 数据库

crontab -e
LJHOME=/home/lj
[email protected]
# Essential:
* */12 * * * /home/lj/bin/ljmaint.pl clean_caches >/dev/null
# Optional, if you want birthday mail, and the random user feature:
# (you can remove parts)
5 1 * * * /home/lj/bin/ljmaint.pl bdaymail build_randomuserset >/dev/null
# If you want statistics:
30 1 * * * /home/lj/bin/ljmaint.pl genstats genstatspics genstats_size >/dev/null
5 2 * * 0 /home/lj/bin/ljmaint.pl genstats_weekly > /dev/null
# Various tasks
15 1 * * * /home/lj/bin/ljmaint.pl joinmail > /dev/null
30 * * * * /home/lj/bin/ljmaint.pl synsuck > /dev/null
5 2 * * 0 /home/lj/bin/ljmaint.pl memeclean > /dev/null
# If you're running a high-load site with $LJ::BUFFER_QUERIES on,
# there's another one to install:
*/5 * * * * /home/lj/bin/qbufferd.pl >/dev/null
apachectl restart
$LJHOME/bin/upgrading/make_system.pl

http://localhost/login.bml
system/system // OK, 安装成功 :)

Links

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱