tetuo41の日記

日々の生活で起こる心の揺れを書きます!!

Passenger Memo

# 必要なモノをインストール

yum install httpd httpd-devel apr-devel apr-util-devel curl-devel

# Passengerをインストール

gem install passenger

# apache moduleインストール

passenger-install-apache2-module

# 設定ファイル追加

LoadModule passenger_module ~/mod_passenger.so

PassengerRoot ~/passenger-x.y.z

PassengerDefaultRuby ~/ruby

# httpd.conf 変更追加

vi /etc/httpd/conf.d/passenger.conf

Thanks for the link.

http://babiy3104.hateblo.jp/entry/2013/08/30/193034

http://morizyun.github.io/blog/passenger-install-apache-ruby-rails/

http://petitviolet.hatenablog.com/entry/20130804/1375604128

vagrant memo

http://k-holy.hatenablog.com/entry/2013/08/30/192243

# 64bitだったver

vagrant box add centos64_64 http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130427.box

vagrant init centos64_64

# 32bitver

vagrant box add centos64_32 http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-i386-v20130427.box

# Vargrant認識 Vargrantファイル作成

vagrant init centos64_32

# 起動

vagrant up

# 仮想サーバー接続

vagrant ssh

# 停止

vagrant halt

# 削除

vagrant destroy

tmail

[ruby]

def mail_data(mFile)

file = File.open(mFile).read

mail = TMail::Mail.parse(file)

#p mail.to # 送信先

#p mail.from # 送信元

idx = 1 # ファイル名

mail.parts.each do |m|

if nil != m['content-disposition']

m.base64_decode

attach_fileNm = m['content-disposition']['filename']

#File.open("#{CLIENTDATAPATH}/#{attach_fileNm}.#{ext(m)}", 'w') do |f|

File.open("#{CLIENTDATAPATH}/#{attach_fileNm}", 'w') do |f|

f.write m.body

end

end

idx += 1

end

end

CTYPE_TO_EXT = {

'image/jpeg' => 'jpg',

'image/gif' => 'gif',

'image/png' => 'png',

'image/tiff' => 'tiff',

'text/plain' => 'txt',

'application/vnd.ms-excel' => 'csv'

}

def ext( mail )

CTYPE_TO_EXT[mail.content_type] || 'txt'

end

[/ruby]

http://ecpplus.net/weblog/ruby%E3%81%A7%E5%8F%97%E4%BF%A1%E3%83%A1%E3%83%BC%E3%83%AB%E8%A7%A3%E6%9E%90/

Linuxでログイン出来ないユーザをログイン出来るように変更する

[bash]

$ su testuser

This account is currently not available.

[/bash]

↑こんなヤツが出る場合

testuserには「/sbin/nologin」が設定されている

なので「/bin/bash」に変更して上げる

[bash]

$ usermod -s /bin/bash testuser

[/bash]


参考URL:

http://server-setting.info/centos/login_user.html