2012年3月21日 星期三

Debian 安裝 domjudge 步驟


1. 安裝相關軟體
    sudo apt-get install gcc g++ make libcurl4-gnutls-dev mysql-server apache2 php5 php5-cli libapache2-mod-php5 php5-mysql php-geshi ntp sudo procps sharutils phpmyadmin xsltproc libboost-regex-dev libgmp3-dev linuxdoc-tools transfig texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended

2. 安裝相關軟體
    sudo apt-get install make sudo php5-cli php5-mysql ntp xsltproc procps sharutils gcc g++ gcj openjdk-6-jre-headless openjdk-6-jdk ghc fp-compiler

3. 安裝瀏覽器
    sudo apt-get install chromium-browser

4. 抓取source code
    wget -c http://downloads.sourceforge.net/project/domjudge/domjudge/3.2.2/domjudge-3.2.2.tar.gz

5. 解壓縮
    tar zxvf domjudge-3.2.2.tar.gz

6. confige 環境
   cd domjudge-3.2.2/
   ./configure

7. 編譯code
    make domserver judgehost docs

9. 安裝domserver
    sudo make install-domserver

10. 安裝judgehost
    sudo make install-judgehost

11. 安裝docs
    sudo make install-docs

12. 建立資料庫
    cd /opt/domjudge/domserver/bin/
    ./dj-setup-database -u root -r install

14. 建立web路徑
      sudo ln -s /opt/domjudge/domserver/etc/apache.conf /etc/apache2/conf.d/domjudge.conf

15. 重啟apache
      sudo apache2ctl graceful

16. 建立web admin 帳號
      cd /opt/domjudge/domserver/etc/
      htpasswd htpasswd-jury admin

17. cd /opt/domjudge/judgehost/bin/
      sudo ./dj_make_chroot /opt/chroot/ i386

18. cd /opt/domjudge/judgehost/lib/judge/
      sudo gedit chroot-startstop.sh
      edit CHROOTORIGINAL="/opt/chroot"

19. cd /opt/domjudge/judgehost/etc/
      sudo gedit judgehost-config.php
      edit define('CHROOT_SCRIPT', 'chroot-startstop.sh');

20. 啟動編譯程式
      /opt/domjudge/judgehost/bin/judgedaemon


PS: manual裡寫需 sudo visudo ,加上



judge  ALL=(root) NOPASSWD: /opt/domjudge/judgehost/bin/runguard *
judge  ALL=(root) NOPASSWD: /bin/cp -pR /dev/null ./dev/null

judge  ALL=(root) NOPASSWD: /bin/mount -n -t proc -bind /proc proc
judge  ALL=(root) NOPASSWD: /bin/umount /*/proc
judge  ALL=(root) NOPASSWD: /bin/mount -bind /opt/chroot/*
judge  ALL=(root) NOPASSWD: /bin/umount /opt/domjudge/judgehost/judgings/*


但仍會出現需要輸入sudo密碼...
故先加上 

judge ALL=(ALL) NOPASSWD:ALL

可先正常運作,之後再查明原因。

沒有留言: