対象のバージョン
今回対象にするバージョンは以下の通りです。
- Ruby 1.9.3
- Rails 3.2.13
対象の環境
対象の環境は Windows 7 です。
Rubyのインストール
バイナリはRubyInstaller.orgが配布しているものを使います。
config.i18n.default_locale = 'ja'
locales
|-- defaults <-- デフォルトリソースファイルを配置
| |-- en.yml
| |-- ja.yml
|-- models <-- モデルとその属性リソースを定義したファイルを配置
| |-- defaults
| | |-- en.yml
| | |-- ja.yml
| |-- bookshelf
| | |-- en.yml
| | |-- ja.yml
| |-- book
| | |-- en.yml
| | |-- ja.yml
|-- views <-- 画面系リソースを定義したファイルを配置
|-- defaults
| |-- en.yml
| |-- ja.yml
|-- bookshelf
| |-- en.yml
| |-- ja.yml
|-- book
|-- en.yml
|-- ja.yml
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
設定 | 評価順序 | デフォルトの挙動 |
---|---|---|
Order allow,deny | Allow->Deny | 拒否 |
Order deny,allow | Deny->Allow | 許可 |
[Allow|Deny] from all|host|env=[!]env-variable [host|env=[!]env-variable] ...
Allow from test.com
Allow from .test.com
Allow from 10.1.2.3
Allow from 192.168.1.5 192.168.120.2
Allow from 10.1
Allow from 192.168.1 192.168.120
Allow from 10.1.0.0/255.255.0.0
Allow from 10.1.0.0/16
<Directory "/var/www/html/secure">
AuthType Digest
AuthName "Secret"
AuthUserFile /etc/httpd/conf/.htdigestfile
Require valid-user
</Directory>
# htdigest -c /etc/httpd/conf/.htdigest 認証領域 ユーザID
Adding password for ユーザID in realm 認証領域.
New password:
Re-type new password:
# /etc/init.d/httpd restart
<Directory "/var/www/html/secure">
AuthType Basic
AuthName "Please Enter Your ID and Password."
AuthUserFile /etc/httpd/conf/.htpasswd
Require valid-user
</Directory>
グループ名:ユーザ1 ユーザ2
# htpasswd -c /etc/httpd/conf/.htpasswd ユーザID
New password:
Re-type new password:
Adding password for user ユーザID
# /etc/init.d/httpd restart
<Directory "/var/www/html/secure">
AllowOverride [ALL|AuthConfig]
</Directory>
#!/bin/env ruby
# -*- coding: utf-8 -*-
>heroku apps
=== My Apps
アプリケーションID1
アプリケーションID2
>heroku info --app アプリケーションID
=== アプリケーションID
Addons: heroku-postgresql:dev
Git URL: git@アプリケーションID.git
Owner Email: xxx@xxx.xxx
Repo Size: 12M
Slug Size: 17M
Stack: cedar
Web URL: http://アプリケーションID.herokuapp.com/
> git clone git@アプリケーションID.git
> heroku ps
type | 表示 | 内容 |
0 | Echo Reply | エコー応答Echo Reply(エコー応答)(pingなど) |
3 | Destination Unreachable | 宛先到達不可(宛先の相手が存在しなかった、もしくは障害中) |
4 | Source Quench | 発信制御(受信元のパソコンが送信元に、処理が追いつかないので転送を止めてほしいとリクエスト、など) |
5 | Redirect | ルート変更(ルーター増設時などに最適経路を発見したときに利用)。表示されると一瞬びっくりします |
8 | Echo Request | エコー要求(pingなど) |
11 | Time Exceeded for a Datagram | 時間超過 |
12 | Parameter Problem on a Datagram | パラメーター問題(IPヘッダに問題があったとき、受信側が送信側に送る) |
13 | Timestamp Request | タイムスタンプ要求 |
14 | Timestamp Reply | タイムスタンプ応答 |
15 | Information Request | 情報要求 |
16 | Information Reply | 情報応答 |
17 | Address Mask Request | アドレスマスク要求(自分が所属しているサブネットのサブネットマスクを知ろうとしたパソコンが送信する) |
18 | Address Mask Reply | アドレスマスク応答 |
yum install profptd
ServerName "ProFTPD server" ServerIdent on "FTP Server ready." ServerAdmin root@localhost DefaultServer on
# [inetd|standalone]inetd経由で起動する場合はinetdを指定する。
ServerType inetd
# Passive mode に関する設定
MasqueradeAddress 192.168.215.15 PassivePorts 50000 51000
# 認証設定
AuthPAMConfig proftpd
User nobody Group nobody
AuthOrder mod_auth_pam.c* mod_auth_unix.c
# アクセスディレクトリに関する設定
# ~ ユーザのホームディレクトリより上位の階層を非表示にする
# !adm以外のグループのユーザに対して適応される
DefaultRoot ~ !adm
# 認証成功前にServerNameで設定したサーバ名を表示するかどうかを指定
# 認証前に見せる場合はoff
DeferWelcome off
# ファイルのタイムスタンプをGMTにするかどうかを指定
# しない場合はoff
TimesGMT off
# 認証成功後に表示するメッセージを指定
AccessGrantMsg "User %u logged in\n"
# >USER xxx
# 331 Password required for xxx
# >PASS [xxxxxx]
# 230 User xxx logged in
# rootユーザによるログインを許可する
# 許可する場合on
# ただし、/etc/ftpusers からrootユーザのエントリを削除しないとログインできない。
RootLogin off
# Globalディレクティブは仮想サーバで共通な設定を行う際に利用する。
<Global> Umask 022 AllowOverwrite yes <Limit ALL SITE_CHMOD> AllowAll </Limit> </Global>
<Limit LOGIN> Order allow,deny Allow from 127.0.0.1,192.168.215.0/24 Deny from all </Limit>
# Anonymous FTP の設定
# Anonymous ディレクティブには公開するディレクトリを指定する
# この場合ftpユーザのホームディレクトリ配下のftpというディレクトリが公開される
<Anonymous ~ftp> User ftp Group ftp UserAlias anonymous ftp </Anonymous>
TCPWrapperを有効にしている場合は、/etc/hosts.allowに接続許可指定を行う。
in.proftpd: 192.168.215.
# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPTとりあえずルールを保存します。
# iptables-save > /etc/sysconfig/iptablesここが重要なのですが、FTPを通すにはip_conntrack_ftpとip_nat_ftpの2つのモジュールをロードする必要があります。これらのモジュールのロードに関する設定は、/etc/iptables/iptables-configファイルに記述します。
IPTABLES_MODULES="ip_conntrack_ftp ip_nat_ftp"
# lsmod Module Size Used by nf_nat_ftp 2602 0 nf_conntrack_ftp 10475 1 nf_nat_ftp
<?php wp_footer(); ?>
get_template_part( 'loop', 'index' );