~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/ja/user-guide/http_smart_server.txt

  • Committer: John Arbash Meinel
  • Date: 2009-12-02 23:09:40 UTC
  • mfrom: (4853.1.1 whitespace)
  • mto: This revision was merged to the branch mainline in revision 4856.
  • Revision ID: john@arbash-meinel.com-20091202230940-7n2aydoxngdqxzld
Strip trailing whitespace from doc files by Patrick Regan.

Resolve one small conflict with another doc edit.
Also, revert the changes to all the .pdf and .png files. We shouldn't
be touching them as they are pure-binary files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
    LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so
28
28
    FastCgiIpcDir /var/lib/apache2/fastcgi
29
 
    
 
29
 
30
30
我々の例では、`http://example.com/code` で `/srv/example.com/www/code` をすでに提供しているので
31
31
既存のApacheの設定は次のようになります::
32
32
 
46
46
        RewriteBase /code
47
47
        RewriteRule ^(.*/|)\.bzr/smart$ /srv/example.com/scripts/bzr-smart.fcgi
48
48
    </Directory>
49
 
    
 
49
 
50
50
    # bzr-smart.fcgiはDocumentRootの元に存在しないので、実行されるように
51
51
    # AliasはこれをURLの名前空間のエイリアスにする。
52
52
    Alias /srv/example.com/scripts/bzr-smart.fcgi /srv/example.com/scripts/bzr-smart.fcgi
56
56
            SetHandler fastcgi-script
57
57
        </Files>
58
58
    </Directory>
59
 
    
 
59
 
60
60
この設定はFastCGIを通して `/code` 内部の `/.bzr/smart` で終わるURLに対する
61
61
Bazaarのスマートサーバーへのリクエストを扱うようにApacheに指示します。
62
62
 
126
126
        prefix='/code/',
127
127
        path_var='REQUEST_URI',
128
128
        readonly=True,
129
 
        load_plugins=True, 
 
129
        load_plugins=True,
130
130
        enable_logging=True)
131
131
 
132
132
    fcgi.WSGIServer(smart_server_app).run()
133
 
        
 
133
 
134
134
 `fcgi`のモジュールはhttp://svn.saddi.com/py-lib/trunk/fcgi.pyで見つかります。
135
135
これは flup_ の一部です。
136
136
 
151
151
        prefix='/code/',
152
152
        path_var='REQUEST_URI',
153
153
        readonly=True,
154
 
        load_plugins=True, 
 
154
        load_plugins=True,
155
155
        enable_logging=True)
156
156
 
157
157
    def handler(request):
158
158
        """Handle a single request."""
159
159
        wsgi_server = modpywsgi.WSGIServer(smart_server_app)
160
160
        return wsgi_server.run(request)
161
 
        
 
161
 
162
162
`modpywsgi` モジュールは
163
163
`http://dev.pocoo.org/projects/pocoo/browser/pocoo/wrappers/modpy.py` で見つかります。
164
164
これは pocoo_ の一部です。modpywsgi.pyをbzr-smart.pyと同じディレクトリ
191
191
この例で使われている `make_app` ヘルパーは それに渡される `root` パスに基づいたトランスポートを伴う
192
192
`SmartWSGIApp` をコンストラクトし、引数 `prefix` と`path_var` に基づくそれぞれのリクエストに対する
193
193
 `bzrlib.relpath` を算出します。
194
 
上記の例において、これは (Apacheによって設定される)'REQUEST_URI' を取り、接頭辞の '/code/' と接尾辞の '/.bzr/smart' 
 
194
上記の例において、これは (Apacheによって設定される)'REQUEST_URI' を取り、接頭辞の '/code/' と接尾辞の '/.bzr/smart'
195
195
をはぎ取り、それを 'bzrlib.relpath' として設定するので、 '/code/foo/bar/.bzr/smart' に対するリクエストは
196
196
'foo/bzr' の 'bzrlib.relpath' になります。
197
197
 
217
217
プレーンなHTTPは読み込み限定のアクセスを許可することは確実にできます。
218
218
 
219
219
 
220
 
.. 
 
220
..
221
221
   vim: ft=rst tw=74 et