Archive

やっとownCloudを導入

No Comments

今月の頭にownCloudでも導入するか~、と思っていたが、どうにもこうにもうまくインストールできなかった。
いや、インストールできなかった訳ではなく、うまく階層化での連携ができなかったという感じ。

おそらく、GeekWindがNginxで動作していることも関係しているのかもしれない。
一応、ownCloudを動作させるために、Nginxの環境設定の例もあるのだが、それはあくまでサイト全体がownCloudで使用するためのもののようなのである。

私が今回やろうとしていたのは、SSL証明書の設定を楽するために、もう一階層下の階層で運用したかったのだが、どうにもこうにも設定がうまくいかなかった。

結局は、サブドメインを1つ作って、DNS設定し、そのドメインをownCloudに割り振ることでやったのである。

owncloud

Continue reading this entry »

lighttpdのSSIをON

No Comments

ちょっとしたプログラムからページ生成を行うため、WordPressとは別に静的なページを生成することに。

とはいえ、ページデザインはやっぱり統一感を出したいので、極力同じ状態にしたい。
このため、共通化できるところはできるだけ共通化しておきたい、ということでSSIがベストと判断。

はて?lighttpdって、どうやってSSIを有効にするんだっけ?
ということで、調べてみたら、すごく簡単だった。

# cd /etc/lighttpd
# sudo vi lighttpd.conf
以下の部分のコメントをはずす
server.modules              = (
・・・・
"mod_ssi",
・・・・
)
・・・・
 #### ssi
ssi.extension              = ( ".shtml" )

SSIのExtensionをどうしようか迷ったけれど、パフォーマンスを考えて、SSIを有効にするHTMLはshtmlにした。

あとは、shtml内に<!–#include virtual=”差し込みファイル” –>を記述すればOKとなった。

ということで、あっさり対応終了。

bitlyからのメール

No Comments

メールを受信して、ふとメールボックスをみると、英語のメール。

一瞬、スパムかと思ったら、bitlyからのメールだった。

Hello!

We moved our infrastructure to an incredibly stable, secure, and speedy environment.

For you to benefit from all this, you’ll need to change your short domain’s DNS:

**Update the A-record for your short domain to point to bitly’s new IP address: 69.58.xxx.xx**

**Please make this change by Tuesday, February 14th.**

In your DNS, please make sure that you have a “www” entry for your domain name, and that it points to ‘cname.bitly.com’. For example, if your short domain was ‘fred.me’ you’d point your CNAME record for “www.fred.me” to ‘cname.bitly.com.’

Thank you,
The team at bitly

ということで、そそくさとDNSの設定を変更して、反映を待つだけ。

CloudCore VPSの最初の一歩

No Comments

KDDIのVPSサービスであるCloudCore VPSに申し込んだので、とりあえず設定を行う。
基本的には、さくらのVPS 512と同じように、まずはセキュリティの強化からである。
もちろん、ssh用のポート番号も同様に変更する。

rootのパスワード変更後、通常のユーザアカウントおよびグループを作成。
その後、iptablesの設定である。

ところが、CloudCore VPSにはiptablesがない。
このため、yumによりiptalesをインストール。

# which iptables
iptables: コマンドが見つかりません
# yum install iptables
# vi /etc/sysconfig/iptables

iptablesの設定はさくらのVPS 512で設定したものと同じで設定。
iptablesを適用後、自動起動するようにchkconfigでセット。

# /etc/rc.d/init.d/iptables start
ファイアウォールルールを適用中:                            [  OK  ]
チェインポリシーを ACCEPT に設定中filter                   [  OK  ]
iptables モジュールを取り外し中                            [  OK  ]
iptables ファイアウォールルールを適用中:                   [  OK  ]

# chkconfig iptables on
# chkconfig --list iptables
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off

最終的な設定状況はこんな感じ。

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain RH-Firewall-1-INPUT (2 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere            icmp any
ACCEPT     esp  --  anywhere             anywhere
ACCEPT     ah   --  anywhere             anywhere
ACCEPT     udp  --  anywhere             224.0.0.251         udp dpt:mdns
ACCEPT     udp  --  anywhere             anywhere            udp dpt:ipp
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ipp
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:XXXXX
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ftp-data
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ftp
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:https
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:mysql
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited

とりあえずのセキュリティが行えたところで、必要なパッケージをインストール。
インストールしたのは、マニュアル、sudo、gcc-4.6.2、Ruby-1.8.7、RubyGems-1.8.12.

# yum update
# yum install man man-page
# yum install sudo
# yum -y install man man-pages-ja

gcc-4.6.2は以下の手順でインストール。
作業は全てrootで実施。
まずは準備と必要なパッケージをインストール。

# sudo yum install gcc gcc-c++ m4 glibc-devel zip bzip2
# mkdir /tmp/work

続いてgmpのインストール。
gmpってGNU Multiple Precision libraryの略で、任意精度計算ライブラリの一つ。

# cd /tmp/work
# wget ftp://ftp.gmplib.org/pub/gmp-5.0.2/gmp-5.0.2.tar.bz2
# tar jxf gmp-5.0.2.tar.bz2
# cd gmp-5.0.2
# ./configure --prefix=/usr --enable-cxx
# make
# make check
# maek install
# /sbin/ldconfig

続いてmpfrのインストール。
mpfrはMultiple. Precision Floating-Point Reliable Libraryの略で、高品質多倍長浮動小数点ライブラリってやつです。

# cd /tmp/work
# wget http://www.mpfr.org/mpfr-current/mpfr-3.1.0.tar.bz2
# tar jxf mpfr-3.1.0.tar.bz2
# cd mpfr-3.1.0
# ./configure --prefix=/usr --with-gmp=/usr
# make
# make check
# maek install
# /sbin/ldconfig

さらにmpcのインストール。
mpcはMultiple Precision Complex Libraryの略で、複素数ライブラリです。

# cd /tmp/work
# wget http://www.multiprecision.org/mpc/download/mpc-0.9.tar.gz
# tar zxf mpc-0.9.tar.gz
# cd mpc-0.9
# ./configure --prefix=/usr --with-gmp=/usr --with-mpfr=/usr
# make
# make check
# maek install
# /sbin/ldconfig

そしてgcc-4.6.2のインストール。

# cd /tmp/work
# wget http://ftp.gnu.org/gnu/gcc/gcc-4.6.2/gcc-4.6.2.tar.bz2
# tar jxf gcc-4.6.2.tar.bz2
# cd gcc-4.6.2
# ./configure --prefix=/usr --with-gmp=/usr --with-mpfr=/usr --with-mpc=/usr --program-suffix=-4.6
# make bootstrap
# make install

make bootstrapはえらく時間がかかる。
実はmakeをやっている最中、作業しているマシンがハングしてしまい、作業がkillされてしまうという事態に陥った。
このため、再度makeする際にはバックグラウンドでmakeすることにした。(笑)

# cd /bin
# mv gcc gcc-...
# ln -s gcc-4.6 gcc

ということで、gccのインストールが終了。
続いて、RubyとRubyGemsのインストール。

# yum install zlib-devel
# cd /tmp/work
# wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz
# tar zxf ruby-1.8.7-p72.tar.gz
# cd ruby-1.8.7-p72
# ./configure --prefix=/usr/local/ruby187
# make
# make install
# cd /tmp/work
# wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.12.tgz
# tar zxf rubygems-1.8.12.tgz
# cd rubygems-1.8.12
# /usr/local/ruby187/bin/ruby setup.rb
# gem update --system

さくらのVPS 512で、はまったのが嘘のように、あっさりインストールできた。



Blue Taste Theme created by Jabox