2012年9月10日月曜日

SSHポートフォワーディングの維持

ありがちですが、portforwardをバックグラウンドで維持したい時のメモ。

autosshってコマンドでsshを監視し、自動起動してくれる。
yum install autossh


autossh    -M 50000 -C -N -L 18440:localhost:80 shimazu@hostname

-Mで監視ポートを指定。重複しなければ複数起動できる。

2012年5月30日水曜日

Mac Fan 2012.06見て気になったフリーソフト

画像リサイズ & 形式変換
ResizeIt
http://homepage.mac.com/nsekine/SYW/software/japanese/resizeit/index.html


ありがちなんですが、よくできているのでメモします。
ImageMagickとか使うのめんどくさいからなるべく避けたい。

Mac FanでEmacsとかTeXとかをMacならでは的な紹介するのはどうなんだろう。。

2012年3月9日金曜日

Gitoriousインストールメモ

CentOSで。

基本ここを参照
https://gitorious.org/gitorious/pages/Rhel_Installation

mod_xsendfileはリンク切れしているので
https://tn123.org/mod_xsendfile/
ここからダウンロード

普通にrubyをyumで入れるとgemが新しすぎるので(rakeがおかしいのか)
1.4系にする。
http://cjohansen.no/en/ruby/setting_up_gitorious_on_your_own_server

ruby-enterpriseでgem入れててもruby setup.rbで正しく置き換えてくれた。


cd ~/
mkdir src
cd src
wget http://rubyforge.org/frs/download.php/73882/rubygems-1.4.2.tgz
tar xvzf rubygems-1.4.2.tgz
cd rubygems-1.4.2
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem


Cookie Secretの設定が相当長くないといけないらしい。
https://www.verisign.co.jp/ssl/help/csr/capache_new.html
rsa key作って入れた。

yamlに複数行入れるときは
property : |
    hogehoge
    fugafuga

hogehogeの前のスペースインデント忘れちゃダメです。


rake ultrasphinx周りでエラーが出た。
設定ファイルがconflictしてるっぽい。


 $ rake ultrasphinx:index RAILS_ENV=production  
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
mkdir -p /var/www/gitorious/db/sphinx/
$ indexer --config '/var/www/gitorious/config/ultrasphinx/production.conf' --all
Sphinx 0.9.9-release (r2117)
Copyright (c) 2001-2009, Andrew Aksyonoff


using config file '/var/www/gitorious/config/ultrasphinx/production.conf'...
WARNING: key 'address' is deprecated in /var/www/gitorious/config/ultrasphinx/production.conf line 10; use 'listen' instead.
indexing index 'main'...
ERROR: index 'main': sql_range_query: Unknown column 'base_tags.name' in 'field list' (DSN=mysql://gitorious_prd:***@localhost:3306/gitorious_prd).
total 0 docs, 0 bytes
total 0.135 sec, 0 bytes/sec, 0.00 docs/sec
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg

↓に従ってbase_tags->tagsに置換
vi config/ultrasphinx/production.conf 


あと、XSendFileAllowAboveってプロパティはもう無いっぽい
http://stackoverflow.com/questions/3998111/xsendfile-wont-serve-the-files-in-apache-2-2

以上でいちおう起動した

2011年8月6日土曜日

東京タワーとうなぎ



赤羽橋で鰻いただいてきました。

夜の東京タワー、なかなかキレイなものですね。

明日はeaseのバーベキューってことでくいだおれ週末です。
尿酸値ピンチー

2011年7月4日月曜日

USVNインストールメモ PHP5.3

http://www.usvn.info/

SVNのアカウント管理・リポジトリ管理用のWEB UI
便利です
どうやらphp5.3で動かすとエラーを吐くので
http://forum.usvn.info/viewtopic.php?f=13&t=61125
こちらの手順でfix

あとは
https://trac.usvn.info/wiki/Documentation/Install
こちらに従うだけだが、
DirectoryIndex index.php
を入れないとforbiddenなので、↑に記述されているDirectory内に追記

ここまで設定するとインストールされたディレクトリ or VirtualHostへアクセスして、
Stepに従って設定していくのみとなります。
環境変更時の引越しが簡単なので私はPDO_sqliteを使っています。
また、svnディレクトリの指定時、パーミッション空けてもfilesが作れないとエラーを吐くので、これは手動で作ってあげる。

といったところで、利用可能です。
Version 1からそれなりに綺麗なUIになっていて気持ちいいですね。

LAMP環境構築メモ2011

開発環境用
CentOS 5.5にて

Apache 2.2系最新
PHP 5.3系最新
Subversion 1.6掲載芯
MySQL rpmで5.0系

共通ライブラリ系

  • yum install cpp expat-devel gcc sysstat
  • yum install libpng-devel libjpeg-devel giflib-devel
  • yum install openssl-devel libevent-devel gcc-c++ 
  • yum install autoconf gmp-devel libmcrypt-devel mysql-devel libxml2-devel 
  • yum install curl-devel libXpm-devel freetype-devel libtool-ltdl-devel
  • yum install postfix
  • yum install mysql-server
Apache compile option
 ./configure --enable-so --enable-rewrite --enable-cgi --enable-ssl --enable-dav

PHP compile option
./configure  \
--with-libdir=lib64 \
--with-pcre-regex \
--with-pear \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-openssl \
--with-layout \
--with-mcrypt \
--with-gd \
--with-mysql \
--enable-zend-multibyte \
--enable-calendar \
--enable-mbstring \
--enable-mbregex \
--enable-bcmath \
--enable-sockets \
--enable-ftp \
--enable-exif \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-xpm-dir \
--with-freetype-dir \
--enable-magic-quotes \
--with-iconv \
--with-gmp \
--with-curl \
--enable-soap

pecl install Memcached
pecl install apc

Apr

cd /usr/local/src/httpd-2.2.4/srclib/apr
./configure --prefix=/usr/local/apr --enable-threads

make;make test; make install
cd /usr/local/src/httpd-2.2.4/srclib/apr-util
./configure --prefix=/usr/local/apr  --with-apr=/usr/local/apr


make;make test; make install

SQLite
http://www.sqlite.org/download.html
sqlite-autoconf-*をダウンロード
./configure ; make; make install

Subversion


download subversion-deps-1.6.17.tar.gz
download subversion1.6.17.tar.gz
./configure --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr
make; make check; make install


Apache config

    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps


で、とりあえずphpinfo起動