Hatena::ブログ(Diary)

satoru.netの自由帳 このページをアンテナに追加 RSSフィード

160525Wedday

mecab install

mecab install centos

yum -y install gcc-c++

cd /usr/local/src/
wget http://mecab.googlecode.com/files/mecab-0.996.tar.gz
tar xzvfp mecab-0.996.tar.gz 
cd mecab-0.996/
./configure
make ; make install

cd /usr/local/src/
wget http://mecab.googlecode.com/files/mecab-ipadic-2.7.0-20070801.tar.gz 
tar xvf mecab-ipadic-2.7.0-20070801.tar.gz 
cd mecab-ipadic-2.7.0-20070801/
./configure --with-charset=utf8
make ; make install

echo 'export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"' >> ~/.bashrc
source ~/.bashrc
cpan Text::MeCab

>pathはそのまま
>[utf-8]を指定する

140406Sunday

amazon EC2 ゾーンリスト@DDoS対策

wget -qO - https://forums.aws.amazon.com/ann.jspa?annID=1701 | grep -Eoh "[0-9.]+{4}/[0-9]+" 

http://maxbeatty.com/blog/2012/06/finding-amazon-s3-region-ip-ranges/

140206Thuday

epel install && mod_extract_forwarded

Apacheの便利モジュール

reverse proxy時に$ENV{HTTP_X_FORWARDED_FOR}を$ENV{REMOTE_ADDR}に自動変換する方法

mod_extract_forwarded をインストール (epelも追加)

epelがない場合(64bit/centos6)
cd /usr/local/src/
wget http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
インストール
yum --enablerepo=epel install mod_extract_forwarded

/etc/httpd/conf.d/mod_extract_forwarded.conf

XXX.XXX.XXX.XXXに変換元のIPを設定する(例:127.0.0.1)

LoadModule extract_forwarded_module modules/mod_extract_forwarded.so
#MEForder refuse,accept
#MEFrefuse all
MEFaccept all
#MEFaccept XXX.XXX.XXX.XX
MEFaddenv on
MEFdebug off

もしくは

/etc/httpd/conf.d/mod_extract_forwarded.conf

XXX.XXX.XXX.XXXに変換元のIPを設定する(例:127.0.0.1)

LoadModule extract_forwarded_module modules/mod_extract_forwarded.so
#MEForder refuse,accept
#MEFrefuse all
MEFaccept all
#MEFaccept all
MEFaddenv on
MEFdebug off

参考資料

http://blog.cles.jp/item/3499

131103Sunday

memcachedがyum installできない環境の場合メモ

cd /usr/local/src; wget http://www.monkey.org/~provos/libevent-1.4.10-stable.tar.gz ; tar zxvfp libevent-1.4.10-stable.tar.gz ; cd libevent-1.4.10-stable ; ./configure ; make ; make install ;

cd /usr/local/src; wget http://memcached.googlecode.com/files/memcached-1.4.8.tar.gz ; tar zxvfp memcached-1.4.8.tar.gz ; cd memcached-1.4.8 ; ./configure ; make ; make install ; 

echo " /usr/local/lib" > /etc/ld.so.conf.d/libevent.conf
ldconfig

memcached -d -p 11211 -u nobody -m 8 -c 1024 -P /var/run/memcached/memcached.pid

131102Satday

server構築メモ

install

yum install -y mysql-server

yum install -y httpd

yum install -y memcached

yum install -y php

yum install -y php-mbstring php-mysql php-pecl-apc php-pecl-memcache

yum install -y php-gd

yum install mod_perl

yum install postfix

yum install perl-CPAN

yum install perl-YAML

cpan HTML::TreeBuilder

cpan CGI-Lite

cpan CGI

cpan Cache::Memcached::Fast

memcached同期関連

yum install -y libevent-devel c++

cd /usr/local/src ; wget http://downloads.sourceforge.net/repcached/memcached-1.2.8-repcached-2.2.tar.gz

tar zxvfp memcached-1.2.8-repcached-2.2.tar.gz ; cd memcached-1.2.8-repcached-2.2;

cp /usr/bin/memcached /usr/bin/memcached.org

./configure --enable-replication

make ; make install

©satoru.net
Mail Twitter