Seedbox安裝

記錄我整個安裝的一些注意事項!

改時區


因為是美國的主機。改成自己的時區,這樣子在看流量時比較能夠清楚,我一共改動了二個設定,也不知道在否在第一個動作做完後,就不用改動第二個

sudo dpkg-reconfigure tzdata
cd /etc
mv localtime{,.bck}
ln -s /usr/share/zoneinfo/Asia/Taipei /etc/localtime

設定SSH,並增加安全性,放置RSA Key!只用Key 的方式認證!


把自己的id_rsa.pub 拷貝到VPS主機 .ssh下的 authorized_key(2),這裡因為不同的設定,有時使用authorized_key2 ,權限同時也要注意是否為 644,並測試一下是否不用輸入密碼就可以登入。

範例中的xxx請把他改成你自己的遠端服務器的帳號
scp ~/.ssh/id_rsa.pub xxx@"VPS IP":/home/xxx/.ssh/authorized_keys

接下來把遠端VPS內的 sshd_config 設定改變一下,不再利用密碼登入!


#不允許root登入
PermitRootLogin no

#只有某用戶可登入(改成你自己的帳號)
AllowUsers bbb

# 改成 no 不允許空白密碼
PermitEmptyPasswords no

# 改成 no 不允許用輸入密碼方式登入
PasswordAuthentication no

重新啟動 SSHD,請這時 KEY 如果有問題將無法再登入到主機!  超級麻煩,費了我九牛二虎之力不用寫客服單救回來,利用管理介面,安裝wget 取回新sshd_config ;mv回去;重啟!千萬不能再犯了!

service sshd restart

安裝所要的程式

webmin


主要用來管理MSSQL及其他的服務!安裝時因為有使用到舊的md5模組,只能手動的安裝

sudo wget http://mirrors.kernel.org/ubuntu/pool/universe/libm/libmd5-perl/libmd5-perl_2.03-1_all.deb

 

接下來安裝webmin所需要的其他模組!

sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl apt-show-versions libapt-pkg-perl

 

安裝webmin

sudo wget http://prdownloads.sourceforge.net/webadmin/webmin_1.530_all.deb
sudo dpkg -i webmin_1.530_all.deb
完成!改登入密碼,最好連同啟動的port 由原來的10000 改成一個比較特殊的port ,至少對script scanner 比較麻煩.

php5 + apache2


  • 用來跑vnStat,Wordpress,rutorrent , 這部分系統VPS在拿到時就已經安裝完成,有需要的部分大都是PHP模組增加!

vsftp


用來下載檔案,設定容易比proftpd來說快多了!

sudo apt-get install vsftpd
設定vsftpd.conf內容
#取消匿名登入
anonymous_enable=NO
#允許本機帳號登入
local_enable=YES
#允許上傳檔案
write_enable=YES
dirlist_enable=YES
download_enable=YES
guest_enable=NO
listen=YES
listen_ipv6=NO
local_umask=022
max_per_ip=0
pasv_enable=YES
port_enable=YES
pasv_promiscuous=NO
port_promiscuous=NO
pasv_min_port=0
pasv_max_port=0

rtorrent + rutorrent


接下來也是我使用VPS的主要目的,原因是我在老東家的伺服器所在網段的上游真的太糟了! 另外 rtorrent and rutorrent 也會改版,版本更新部分請參考者多加留意。

 

而這套軟件也是多數seebox使用的軟體,先前用transmission也還行,但搞技術的就是喜歡用新的看起來高級一點的,所以花了點時間設定!

更新系統的套件資訊及安裝所需要的程式!

由於 rutorrent plugin 有個geoip,php需要支援!

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install subversion build-essential automake libtool libcppunit-dev libcurl3-dev libsigc++-2.0-dev unzip unrar curl libncurses-dev
sudo apt-get install apache2 php5 php5-cli php5-geoip php5-gd

除此之外還需要 country or city database ,先建立 /usr/share/GeoIP 再利用以下的shell 下載,不然在rutorrent peer 列表內會看不到國別!

#!/bin/sh

exec 2> /dev/null

DATADIR="/usr/share/GeoIP"
GUNZIP="/bin/gunzip"
MAXMINDURL="http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry"
WGET="/usr/bin/wget -q -O -"
TMPDIR=$(mktemp -d)

if [ ! -d "$DATADIR" ] ; then
        echo "Data directory $DATADIR/ doesn't exist!"
        exit 1
fi

if [ ! -w "$DATADIR" ] ; then
        echo "Can't write to $DATADIR directory!"
        exit 1
fi

cd "${TMPDIR}"

${WGET} "${MAXMINDURL}/GeoIP.dat.gz" | ${GUNZIP} > GeoIP.dat

if [ $? != 0 ] ; then
        echo "Can't download a free Geo Country v4 database!"
        exit 1
fi

mv -f "GeoIP.dat" "${DATADIR}/"

if [ $? != 0 ] ; then
        echo "Can't move databases file to ${DATADIR}/"
        exit 1
fi

exit 0

安裝SCGI 給rutorrent 使用並預設載入

sudo apt-get install libapache2-mod-scgi
sudo ln -s /etc/apache2/mods-available/scgi.load /etc/apache2/mods-enabled/scgi.load

安裝XMLRPC

這個檔案需要自行編輯install xmlrpc-c,App是放檔案的目錄,可以隨便

sudo mkdir /App
cd /App
sudo svn checkout http://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable xmlrpc-c
cd xmlrpc-c
sudo ./configure --disable-cplusplus
sudo make
sudo make install

安裝Libtorrent

cd /App
sudo wget  http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.9.tar.gz
sudo tar xvf libtorrent-0.12.9.tar.gz
cd libtorrent-0.12.9
sudo ./autogen.sh
sudo ./configure
sudo make
sudo make install

此檔為rtorrent使用

安裝rtorrent

cd /App
sudo wget  http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.9.tar.gz
sudo tar xvf rtorrent-0.8.9.tar.gz
cd rtorrent-0.8.9
sudo ./autogen.sh
sudo ./configure --with-xmlrpc-c
sudo make
sudo make install

安裝ruTorrent,最下方目錄則端看自己給予不同目錄名!

cd /App
sudo wget http://rutorrent.googlecode.com/files/rutorrent-3.4.tar.gz
sudo tar xvf rutorrent-3.4.tar.gz
sudo mv rutorrent /var/www
sudo wget http://rutorrent.googlecode.com/files/plugins-3.4.tar.gz
sudo tar xvf plugins-3.4.tar.gz
sudo mv plugins /var/www/rutorrent
sudo rm -rf /var/www/rutorrent/plugins/darkpal
sudo chown -R www-data:www-data /var/www/rutorrent

 

設定瀏覽rutorrent 時需要密碼,把.htaccess 放置到 rutorrent所在的目錄

 

# 將下列內容儲存成 .htaccess AuthUserFile /var/www/rutorrent/.htpasswd AuthName "ruTorrent login" AuthType Basic Require Valid-User 

設定上面內的htpasswd 密碼檔!

sudo htpasswd -c /var/www/rutorrent/.htpasswd “用戶名“
輸入密碼二次

 

  • 這樣應該就可以了,其他的細節晚點再貼上來

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料