ablog

不器用で落着きのない技術者のメモ

さくらVPS CentOS 6.4 のセットアップ

環境

# cat /etc/issue
CentOS release 6.4 (Final)
Kernel \r on an \m

# uname -r
2.6.32-358.18.1.el6.x86_64

ユーザ作成

# useradd yoheia
# passwd yoheia

Apache

  • インストール
# yum install httpd
Is this ok [y/N]: y
# chkconfig --list httpd
httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
# chkconfig httpd on
# chkconfig --list httpd
httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off
# htpasswd -c -b /etc/httpd/conf/.htpasswd <ユーザ名> <パスワード>
# vi /etc/httpd/conf/httpd.conf

...

<Directory />

...

    # Added for Basic Auth 2013.09.23
    AuthUserFile /etc/httpd/conf/.htpasswd
    AuthGroupFile /dev/null
    AuthName "Basic Auth"
    AuthType Basic
    Require valid-user
</Directory>

...

<Directory "/var/www/cgi-bin">

...

    # Added for Basic Auth 2013.09.23
    AuthUserFile /etc/httpd/conf/.htpasswd
    AuthGroupFile /dev/null
    AuthName "Basic Auth"
    AuthType Basic
    Require valid-user
</Directory>
...

Perl

# install perl-core
# curl -L http://cpanmin.us | perl - App::cpanminus

FreeStyleWiki設置

# cd /usr/local/src
# mkdir fswiki364
# chown yoheia:yoheia fswiki364
# su - yoheia
$ cd /usr/local/src/fswiki364
$ wget 'http://sourceforge.jp/frs/redir.php?m=jaist&f=%2Ffswiki%2F48737%2Fwiki3_6_4.zip'
$ wget 'http://sourceforge.jp/frs/redir.php?m=osdn&f=%2Ffswiki%2F48737%2Ffswiki-patch-20110813.zip'
$ wget 'http://sourceforge.jp/frs/redir.php?m=iij&f=%2Ffswiki%2F48737%2Ffswiki-pache-20110823.zip'
$ unzip wiki3_6_4.zip
$ unzip fswiki-patch-20110813.zip
$ unzip fswiki-pache-20110823.zip
$ cd fswiki-patch-20110813
$ cp -p lib/Util.pm ../wiki3_6_4/lib/
$ cd ../fswiki-pache-20110823
$ cp -p lib/Wiki/InterWiki.pm ../wiki3_6_4/lib/Wiki/
$ cd ../ wiki3_6_4
$ ./setup.sh
$ vi /var/www/cgi-bin/fswiki/setup.dat
# テーマを格納するディレクトリ
theme_dir = ../../fswiki/theme

# テーマを参照するためのURI
theme_uri = ../../fswiki/theme
$ su -
# cd /usr/local/src/fswiki364
# chown -R apache:apache wiki3_6_4
# cp -pr wiki3_6_4 /var/www/cgi-bin/fswiki
# mkdir /var/www/html/fswiki
# chown apache:apache /var/www/html/fswiki
# mv /var/www/cgi-bin/fswiki/theme /var/www/html/fswiki/