CIFSのsvnリポジトリラッパ(追記)
2011-03-28-1 / カテゴリ: [svn][Apache][cygwin] / [permlink]

[2011-03-08-1]の設定だと、updateはできるけど以下のエラーでcommitができない。(場合がある、のかも。少なくとも自分のとこでは。ファイルサーバの具合の可能性?)

コンソール
svn: Can't chmod '/cygdrive/x/svn/db/tempfile.2.tmp': Permission denied
svn: MKACTIVITY of '/repos/testrep/!svn/act/0000012ef9fa5ad6': 500 Internal Server Error (http://127.0.0.1:8080)
Eclipseのダイアログだと「Error while creating module: org.tigris.subversion.javahl.ClientException」がエラーを拾ってるみたい。

んで、色々やった結果、ネットワークドライブのパスを
 - SVNPath "/cygdrive/x/svn"
 + SVNPath "x:/svn"
にすればOK。
Referrer (Inside): [2011-03-08-1]

CIFSのsvnリポジトリラッパ
2011-03-08-1 / カテゴリ: [svn][Apache][cygwin] / [permlink]

某所のsvnリポジトリがCIFS(Windowsファイルサーバ)にしかなく、どうしても手元のeclipse(subclipse)からチェックアウトできなかったので、ローカルのApacheでsvnサーバを立ててラッパとして動作させた。

windows用のApacheバイナリだと、UNC/ネットワークドライブともに(ファイルが見えなかったりログオン不可と出力されたりで)どうしてもうまくいかなかったので、cygwinのApache+svnで構築。
入れるパッケージは
apache2
subversion
subversion-apache2
あたり。

とりあえずdav設定は[2008-02-22-1]の流れで特に問題なし。
デフォルトでDigest認証設定になってるので、Basicに変えるなりなんなりと。
設定ファイルは /etc/apache2/extra/httpd-dav.conf
--- original/extra/httpd-dav.conf	2007-09-17 06:10:55.001000000 +0900
+++ extra/httpd-dav.conf	2011-03-08 13:27:22.246250000 +0900
@@ -16,5 +16,5 @@
 
-Alias /uploads "/usr/uploads"
+Alias /repos "/var/repos"
 
-<Directory "/usr/uploads">
+<Directory "/var/repos">
     Dav On
@@ -24,3 +24,3 @@
 
-    AuthType Digest
+    AuthType Basic
     AuthName DAV-upload
@@ -28,3 +28,3 @@
     #   htdigest -c "/usr/user.passwd" DAV-upload admin
-    AuthUserFile "/usr/user.passwd"
+    AuthUserFile "/etc/apache2/user/htpasswd"
 
@@ -32,5 +32,6 @@
     # to the admin user.
-    <LimitExcept GET OPTIONS>
-        require user admin
-    </LimitExcept>
+    #<LimitExcept GET OPTIONS>
+    #    require user admin
+    #</LimitExcept>
+    require valid-user
 </Directory>
あと、標準だとこのファイルがincludeされないのでhttpd.confにinclude追加する。(下記ラスト部分)
--- httpd.conf.default	2011-03-08 11:44:39.731750000 +0900
+++ httpd.conf	2011-03-08 12:47:10.558750000 +0900
@@ -39,3 +39,3 @@
 #Listen 12.34.56.78:80
-Listen 80
+Listen 8080
 
@@ -110,2 +110,6 @@
 
+# svn
+LoadModule dav_svn_module lib/apache2/mod_dav_svn.so
+Include /etc/apache2/extra/httpd-svn.conf
+
 <IfModule !mpm_netware_module>
@@ -149,3 +153,3 @@
 #
-#ServerName www.example.com:80
+ServerName localhost
 
@@ -446,3 +450,3 @@
 # Distributed authoring and versioning (WebDAV)
-#Include /etc/apache2/extra/httpd-dav.conf
+Include /etc/apache2/extra/httpd-dav.conf

Subversion用の設定はテンプレが見当たらなかったので他の環境から持ってきた。
extra/httpd-svn.confを作って
<IfModule mod_dav_svn.c>
<Location /repos/foo>
	DAV	svn
	SVNPath "/cygdrive/c/work/repos"
</Location>

<Location /repos/testrep>
	DAV	svn
	SVNPath "/cygdrive/x/svn"
</Location>
</IfModule>
こんな感じ。(xはネットワークドライブ)
多バイト文字が入ったパスだと(UTF-8にしてても"Can't converet string from 'UTF-8' to native encoding"とか出力されて)うまくいかないけど…

まぁ、CIFSでSubversion使うなってことよ。

そういや、subclipseだとhostsを見ないようだ。http://localhost(:8080)だとアクセスできなかったけど、http://127.0.0.1(:8080)ならOK。
ググると file:/// も使えるような記述はあるんだけどなぁ…

[2011-03-28-1]追記。↑だとcommitできない。
Referrer (Inside): [2011-03-28-1]

mod_rewriteを有効にするためのAllowOverrideの設定は本当にAllで良いの?
2011-01-22-1 / カテゴリ: [Apache] / [permlink]

[2011-01-20-1]でmod_rewriteを(.htaccessで)有効にするためにゴニョゴニョしたけど、その際にググってでてきた野良サイトでは全部
AllowOverrideを(Noneから)Allにする
とあったけど、本当にAllにしなければならないのかな?

AllowOverrideディレクティブ / core - Apache HTTP サーバ
というわけで、最小限の設定は
AllowOverride FileInfo
が正解のはず。

とはいえ、RootDocumentみたいな、サーバワイドの設定と.htaccessの設定のメンテナがどちらも自分なら、そう問題ないかな。
UserDirみたいに、自分以外のユーザへの設定の開放の場合は気をつけるべき。

1エントリ1ページにしてみたけど誘導用mod_rewrietは不可だった
2011-01-20-1 / カテゴリ: [ubuntu][Apache][chalow] / [permlink]

[2011-01-18-1]chalowを設定変更して、今までは1日複数エントリ日記を書いても1ページに詰め込んでて居たのを、1エントリ1ページにして
古いURLの YYYYmmdd.html#YYYYmmdd-x をmod_rewriteあたりで新URL(YYYYmmdd-x.html)へ誘導
なんて書いてたわけだけど、mod_rewrite だと、うん、それ無理。

続きを読む
Referrer (Inside): [2011-01-22-1]

Apache2.2 SSL WebDAV おまけでPHP
2008-02-22-1 / カテゴリ: [Apache][PHP][linux][ubuntu] / [permlink]

某サイトでゲットした大量の某曲を友人と共有するために整備してみた。
元々 apache-ssl(1.3系) 使ってたが、WebDAV するなら 2.x系がいーだろーと入れ替えてみた。
続きを読む
Referrer (Inside): [2011-03-08-1] [2005-09-05-2]

フォワードプロキシ中継
2007-07-17-1 / カテゴリ: [Apache] / [permlink]

古い日記[2004-07-29-1]

会社PCで飼ってるcoLinuxのためのNAT動作がすこぶる不調(win<->coLinuxは問題なし)なので、諦めてた(またか)

しかし、PCで動いてるApacheをプロキシ動作させれば、aptだけはなんとかなるかなと思い付いたのでお試し。
(coLinux -> 外はaptできればとりあえず十分なんで。)

構成
  • 会社のPCはHTTP/HTTPSのみ社内プロキシを通せば通信可能
  • coLinux <-> win は制限なし
  • [coLinux] <= 192.168.0.0/24 => [win] <= 172.x.x.x => [会社proxy] <= ? => 外
<IfModule mod_proxy.c>
	Proxyrequests On
	ProxyRemote * http://proxy.example.org:8080
</IfModule>

<Proxy *>
	Order deny,allow
	Deny from all
	Allow from 192.168.0.2
</Proxy>
でGo

mod_proxy - Apache HTTP サーバ / イントラネットプロキシ

apache-ssl はデフォルトで suEXEC が効かない
2006-07-23-2 / カテゴリ: [ubuntu][Apache] / [permlink]

debian と同様に
# dpkg-reconfigure apache-ssl
で、suEXEC を有効にするかどうか聞いてくるので yes を。
他には、サーバ名やドキュメントルートのパスなんかを聞いてくる。

WebDAV 設定 (割と中途)
2005-09-05-2 / カテゴリ: [linux][debian][Apache] / [permlink]

ubuntu(apache2.2)での設定はこっち([2008-02-22-1])


Apache 1.3(deb) を WebDAV 対応にしてみる。Apache そのものは設定済みとする

参考: nemuiDoc: DebianでWebDAVサーバ
ということで、sarge になってるので、
# aptitude install libapache-mod-encoding
The following NEW packages will be installed:
libapache-mod-dav libapache-mod-encoding libiconv-hook1 libxmltok1
なんか、必要なのが全部入りそうだし^^;

modules.conf に追記
LoadModule encoding_module /usr/lib/apache/1.3/mod_encoding.so
LoadModule dav_module /usr/lib/apache/1.3/libdav.so

httpd.conf に追記
DAVLockDB  /var/lock/DAV/apache
EncodingEngine    on
NormalizeUsername on
SetServerEncoding UTF-8
DefaultClientEncoding JA-AUTO-SJIS-MS MSSJIS

AddClientEncoding "cadaver/" EUC-JP
AddClientEncoding "Microsoft .* DAV" MSSJIS
AddClientEncoding "xdwin9x" SJIS

Alias /dav /var/www/dav
<Location /dav>
        DAV On
        <LimitExcept GET HEAD OPTIONS>
                AuthType Basic
                AuthName "WebDAV"
                AuthUserFile /etc/apache/DAVuser
                Require valid-user
        </LimitExcept>
</Location>

/etc/apache/DAVuser には、htpasswd を使って登録したユーザ情報がはいる。
/var/lock/DAV 以下は、www-data:www-data
/var/www/dav 以下も、www-data:www-data

で、winXP なら、My network の[ネットワーク プレースを追加する] から [別のネットワークの場所を選択]し、アドレスの入力で [http://server/dav] を入力し、htpasswd で指定したユーザ名/パスワードを入れれば登録できた。

とりあえず、オフィシャルパッケージの mod_encoding では UTF-8 にしか対応していない(EUC-JPとかを指定しても化ける)ので、日本語ファイル名のファイルをやり取りする場合、システムの言語設定が EUC-JP だとつらい。

apache-ssl で自己CAとサーバ証明書の作成・apache-sslへの組み込み
2005-08-28-1 / カテゴリ: [linux][debian][Apache][SSL] / [permlink]

apache-ssl パッケージを apt でインストールすると、インストール時のみに、期限1ヶ月のオレオレ証明書を同時に作成しインストールされる。
ので、自己CAで署名したサーバ証明書を別途作成する。
コマンドは、@ITのApacheでSSLを使うにはの通りで問題なし

作業ディレクトリの作成
# mkdir /etc/ssl/servkey
# cd /etc/ssl/servkey
ま、管理しやすい位置でどこでもいいけど。

CAの秘密鍵の作成
# openssl genrsa -rand /var/log/syslog -out ca.key 1024

CAのCSRの作成
# openssl req -new -key ca.key -out ca.csr
国名や名前などを入力

CA証明書の発行
# openssl x509 -req -in ca.csr -signkey ca.key -days 730 -out ca.crt
-days がないと1ヶ月だったので、2年間と指定してみた。

で、
サーバ証明書の秘密鍵
# openssl genrsa -rand /var/log/syslog -out server.key 1024

サーバ証明書のCSRの作成
# openssl req -new -key server.key -out server.csr
CAと同様に国名などの入力。Common Name に「ブラウザからアクセスするときに使用するドメイン名」を入力すること。

シリアルナンバーのファイルを作成し
# echo 01 > ca.srl

証明書の発行
# openssl x509 -req -days 730 -CA ca.crt -CAkey ca.key -in server.csr -out server.crt

作成した証明書の内容は、以下のコマンドで確認可能
# openssl x509 -in server.crt -text

で、ブラウザ側(クライアントPC)には、(何らかの安全な方法で)ca.crt をコピーし、証明書をインポートorインストールし、「この証明書を信頼する」とかそんな設定を行う。

サーバ(apache-ssl)側は、/etc/apache-ssl/httpd.conf の以下の設定を行う。(パスは作業ディレクトリ)
SSLCACertificateFile /etc/ssl/servkey/ca.crt
SSLCertificateFile /etc/ssl/servkey/server.crt
SSLCertificateKeyFile /etc/ssl/servkey/server.key

関連: mod_ssl(src)[2005-08-09-1], mod-ssl(deb)[2005-03-25-1]
Referrer (Inside): [2008-02-22-1] [2005-08-28-2]

Apache(1.x), mod_ssl で https
2005-08-09-1 / カテゴリ: [unix][SSL][Apache] / [permlink]

オレオレ CA 付で、新規に CA とサーバ鍵を生成する。
参考 Apache+mod SSLのインストールと設定
非 root で作業(ぉぃ

$ mkdir -p ~/local/src/apache
$ cd ~/local/src/apache
$ wget http://www.modssl.org/source/mod_ssl-2.8.23-1.3.33.tar.gz
$ wget http://www.meisei-u.ac.jp/mirror/apache/dist/httpd/apache_1.3.33.tar.gz
$ gzip -dc mod_ssl-2.8.23-1.3.33.tar.gz | tar xvf -
$ gzip -dc apache_1.3.33.tar.gz | tar xvf -

つか、mod_ssl の INSTALL にインストール手順が載ってるので、そのまんま作業すれば良い。

(↓ prefix の指定方法を間違ってます。後述)
$ cd mod_ssl-2.8.23-1.3.33
$ ./configure --with-apache=../apache_1.3.33 --with-ssl=/usr/local/ssl --prefix=~/local/apache-ssl
Configuring mod_ssl/2.8.23 for Apache/1.3.33
 + Apache location: ../apache_1.3.33 (Version 1.3.33)
 + OpenSSL location: /usr/local/ssl
 + Auxiliary patch tool: ./etc/patch/patch (local)
 + Applying packages to Apache source tree:
   o Extended API (EAPI)
   o Distribution Documents
   o SSL Module Source
   o SSL Support
   o SSL Configuration Additions
   o SSL Module Documentation
   o Addons
Done: source extension and patches successfully applied.

Configuring for Apache, Version 1.3.33
 + using installation path layout: Apache (config.layout)
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
 + configured for Solaris 280 platform
 + setting C compiler to gcc
 + setting C pre-processor to gcc -E
 + using "tr [a-z] [A-Z]" to uppercase
 + checking for system header files
 + adding selected modules
    o ssl_module uses ConfigStart/End
      + SSL interface: mod_ssl/2.8.23
      + SSL interface build type: OBJ
      + SSL interface compatibility: enabled
      + SSL interface experimental code: disabled
      + SSL interface conservative code: disabled
      + SSL interface vendor extensions: disabled
      + SSL interface plugin: Vendor DBM (libc)
      + SSL library path: /opt/usr/local/ssl
      + SSL library version: OpenSSL 0.9.7b 10 Apr 2003
      + SSL library type: installed package (stand-alone)
 + enabling Extended API (EAPI)
 + using system Expat
 + checking sizeof various data types
 + doing sanity check on compiler and options
Creating Makefile in src/support
Creating Makefile in src/os/unix
Creating Makefile in src/ap
Creating Makefile in src/main
Creating Makefile in src/modules/standard
Creating Makefile in src/modules/ssl

Now proceed with the following commands:
 $ cd ../apache_1.3.33
 $ make
 $ make certificate
 $ make install


$ cd ../apache_1.3.33
$ make
:
(コンパイル)
:

TYPE=custom で、CA とサーバ鍵をセットで作る(作ったサーバ証明書をCAに署名させる)
$ make certificate TYPE=custom
make[1]: Entering directory `/export/home/miyazaki/local/src/apache/apache_1.3.3
3/src'
SSL Certificate Generation Utility (mkcert.sh)
Copyright (c) 1998-2000 Ralf S. Engelschall, All Rights Reserved.

Generating custom certificate signed by own CA [CUSTOM]
______________________________________________________________________

STEP 0: Decide the signature algorithm used for certificates
The generated X.509 certificates can contain either
RSA or DSA based ingredients. Select the one you want to use.
Signature Algorithm ((R)SA or (D)SA) [R]:
______________________________________________________________________

STEP 1: Generating RSA private key for CA (1024 bit) [ca.key]
1578372 semi-random bytes loaded
Generating RSA private key, 1024 bit long modulus
.....................++++++
...++++++
e is 65537 (0x10001)
______________________________________________________________________

STEP 2: Generating X.509 certificate signing request for CA [ca.csr]
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
1. Country Name             (2 letter code) [XY]:JP
2. State or Province Name   (full name)     [Snake Desert]:Kanagawa
3. Locality Name            (eg, city)      [Snake Town]:Yokohama
4. Organization Name        (eg, company)   [Snake Oil, Ltd]:home
5. Organizational Unit Name (eg, section)   [Certificate Authority]:admin
6. Common Name              (eg, CA name)   [Snake Oil CA]:foo
7. Email Address            (eg, name@FQDN) [ca@snakeoil.dom]:www@www.example.org
8. Certificate Validity     (days)          [365]:
______________________________________________________________________

STEP 3: Generating X.509 certificate for CA signed by itself [ca.crt]
Certificate Version (1 or 3) [3]:
Signature ok
subject=/C=JP/ST=Kanagawa/L=Yokohama/O=home/OU=admin/CN=foo/emailAddress=www@www.example
.org
Getting Private key
Verify: matching certificate & key modulus
Verify: matching certificate signature
../conf/ssl.crt/ca.crt: /C=JP/ST=Kanagawa/L=Yokohama/O=home/OU=admin/CN=foo/emailAddress
=www@www.example.org
error 18 at 0 depth lookup:self signed certificate
OK
______________________________________________________________________

STEP 4: Generating RSA private key for SERVER (1024 bit) [server.key]
1578471 semi-random bytes loaded
Generating RSA private key, 1024 bit long modulus
..............++++++
...............................++++++
e is 65537 (0x10001)
______________________________________________________________________

STEP 5: Generating X.509 certificate signing request for SERVER [server.csr]
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
1. Country Name             (2 letter code) [XY]:JP
2. State or Province Name   (full name)     [Snake Desert]:Kanagawa
3. Locality Name            (eg, city)      [Snake Town]:Yokohama
4. Organization Name        (eg, company)   [Snake Oil, Ltd]:home
5. Organizational Unit Name (eg, section)   [Webserver Team]:foo
6. Common Name              (eg, FQDN)      [www.snakeoil.dom]:www.example.org
7. Email Address            (eg, name@fqdn) [www@snakeoil.dom]:www@www.example.org
8. Certificate Validity     (days)          [365]:
______________________________________________________________________

STEP 6: Generating X.509 certificate signed by own CA [server.crt]
Certificate Version (1 or 3) [3]:
Signature ok
subject=/C=JP/ST=Kanagawa/L=Yokohama/O=home/OU=foo/CN=www.example.org/emailAddress
=www@www.example.org
Getting CA Private Key
Verify: matching certificate & key modulus
Verify: matching certificate signature
../conf/ssl.crt/server.crt: OK
______________________________________________________________________

STEP 7: Enrypting RSA private key of CA with a pass phrase for security [ca.key]
The contents of the ca.key file (the generated private key) has to be
kept secret. So we strongly recommend you to encrypt the server.key file
with a Triple-DES cipher and a Pass Phrase.
Encrypt the private key now? [Y/n]: n
Warning, you're using an unencrypted private key.
Please notice this fact and do this on your own risk.
______________________________________________________________________

STEP 8: Enrypting RSA private key of SERVER with a pass phrase for security [ser
ver.key]
The contents of the server.key file (the generated private key) has to be
kept secret. So we strongly recommend you to encrypt the server.key file
with a Triple-DES cipher and a Pass Phrase.
Encrypt the private key now? [Y/n]: n
Warning, you're using an unencrypted RSA private key.
Please notice this fact and do this on your own risk.
______________________________________________________________________

RESULT: CA and Server Certification Files

o  conf/ssl.key/ca.key
   The PEM-encoded RSA private key file of the CA which you can
   use to sign other servers or clients. KEEP THIS FILE PRIVATE!

o  conf/ssl.crt/ca.crt
   The PEM-encoded X.509 certificate file of the CA which you use to
   sign other servers or clients. When you sign clients with it (for
   SSL client authentication) you can configure this file with the
   'SSLCACertificateFile' directive.

o  conf/ssl.key/server.key
   The PEM-encoded RSA private key file of the server which you configure
   with the 'SSLCertificateKeyFile' directive (automatically done
   when you install via APACI). KEEP THIS FILE PRIVATE!

o  conf/ssl.crt/server.crt
   The PEM-encoded X.509 certificate file of the server which you configure
   with the 'SSLCertificateFile' directive (automatically done
   when you install via APACI).

o  conf/ssl.csr/server.csr
   The PEM-encoded X.509 certificate signing request of the server file which
   you can send to an official Certificate Authority (CA) in order
   to request a real server certificate (signed by this CA instead
   of our own CA) which later can replace the conf/ssl.crt/server.crt
   file.

Congratulations that you establish your server with real certificates.

make[1]: Leaving directory `/export/home/miyazaki/local/src/apache/apache_1.3.33
/src'

インストール
$ make install

…うまくいってるように見えたけど、~/local/apache-ssl がない。
探してみると、作業ディレクトリ直下に '~' ディレクトリができてる… orz

つーわけで、--prefix は絶対ディレクトリ指定にすれば OK
でもって、インストールディレクトリ(~/local/apache-ssl)以下にある conf/ssl.crt/ca.crt をクライアント(ブラウザ) にインポートしてやれば、OK

debian での apache + mod-ssl インストール[2005-03-25-1]と似たようなものか。
Referrer (Inside): [2005-08-28-1]

digest認証 補足
2005-07-08-3 / カテゴリ: [linux][debian][Apache] / [permlink]

[2005-05-29-2]の補足

debian の Apache だと、標準ではモジュールが生きてないので Digest 認証できない。
以下追加
LoadModule digest_module /usr/lib/apache/1.3/mod_digest.so

でもって、htdigest コマンドの引数に指定する realm の文字列は、.htaccess に記述する AuthName と一致させること。
Referrer (Inside): [2005-08-09-2]

Webサイトらくちん引っ越し
2005-06-03-3 / カテゴリ: [linux][Apache] / [permlink]

.htaccess を使って、指定ディレクトリ以下を全て Redirect する。さらに、Permanently を付加すれば OK
Redirect permanent /~zaki/ http://www.jp-z.jp/
サーチエンジンなんかの機械的なヤツは識別してくれるだろうが、人がブラウザを使ってアクセスした際は、移動したことにすら気づかないかも…(Bookmarkの手動変更とかしてくんないかも)

htaccess で digest 認証
2005-05-29-2 / カテゴリ: [linux][Apache] / [permlink]

% htdigest [-c] .htdigest username
-c は、.htdigest の新規作成を行う。
で、
AuthType	Digest
AuthName	"strings"
AuthDigestFile	/hoge/foo/bar/.htdigest
require user foo
(require valid-user)
Basic認証と異なるのは、AutyType のタイプと、ファイルを指定するための AuthDigestFile ディレクティブ名

…って、さくらのサーバ、htdigest 使えないし!! いけてない (/_-)
http://sakura.ne.jp/support/manual/rs/tech_htaccess.shtml

メールのセキュリティはそこそこなのに、Web系はダメだなぁ…

0603 追記
コマンドの引数が足りない
% htdigest [-c] .htdigest realm username
でした。
Referrer (Inside): [2005-08-09-2] [2005-07-08-3]

apache-php インストール
2005-03-25-2 / カテゴリ: [linux][debian][PHP][Apache] / [permlink]

# apt-get install php4
:
Do you want me to run the apacheconfig script now [y/N] ? n
Ok, not running apacheconfig. Please read the docs in /usr/share/doc/php4
httpd.conf の設定
追加
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
コメント解除
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

以上。
確認は適当なディレクトリで .php に
<?php
	phpinfo();
?>
って書いてブラウザでアクセスすればよい

apache + mod-ssl インストール
2005-03-25-1 / カテゴリ: [linux][debian][Apache][SSL] / [permlink]

http://lists.debian.or.jp/debian-users/200112/msg00163.html
# apt-get install apache
(略)
# apt-get install libapache-mod-ssl
(debconfはなし)
・テスト用証明書の作成
# mod-ssl-makecert
/etc/apache/ssl.crt/server.crt: already present
/etc/apache/ssl.csr/server.csr: already present
/etc/apache/ssl.key/server.key: already present

Do you really want to overwrite the existing certificate ? [y/N]:  <- y

What type of certificate do you want to create ?

1. dummy    (dummy self-signed Snake Oil cert)
2. test     (test cert signed by Snake Oil CA)
3. custom   (custom cert signed by own CA)
4. existing (existing cert)
:
> 2 (外用なら3ぽい)

STEP 2 Generating X.509 certificate signing request [server.csr]
1. Country Name             (2 letter code) [XY]:JP
2. State or Province Name   (full name)     [Snake Desert]:Kanagawa
3. Locality Name            (eg, city)      [Snake Town]:Yokohama
4. Organization Name        (eg, company)   [Snake Oil, Ltd]:home
5. Organizational Unit Name (eg, section)   [Webserver Team]:Administrator
6. Common Name              (eg, FQDN)      [www.snakeoil.dom]:localhost
7. Email Address            (eg, name@FQDN) [www@snakeoil.dom]:webmaster@localhost
8. Certificate Validity     (days)          [365]:

STEP 3 Generating X.509 certificate signed by Snake Oil CA [server.crt]
Certificate Version (1 or 3) [3]:

STEP 4: Enrypting RSA private key with a pass phrase for security [server.key]
The contents of the server.key file (the generated private key) has to be
kept secret. So we strongly recommend you to encrypt the server.key file
with a Triple-DES cipher and a Pass Phrase.
Encrypt the private key now? [Y/n]:      <- n

RESULT: Server Certification Files

o  conf/ssl.key/server.key
   The PEM-encoded RSA private key file which you configure
   with the 'SSLCertificateKeyFile' directive (automatically done
   when you install via APACI). KEEP THIS FILE PRIVATE!

o  conf/ssl.crt/server.crt
   The PEM-encoded X.509 certificate file which you configure
   with the 'SSLCertificateFile' directive (automatically done
   when you install via APACI).

o  conf/ssl.csr/server.csr
   The PEM-encoded X.509 certificate signing request file which
   you can send to an official Certificate Authority (CA) in order
   to request a real server certificate (signed by this CA instead
   of our demonstration-only Snake Oil CA) which later can replace
   the conf/ssl.crt/server.crt file.

httpd.conf の設定
sarge なら、/usr/share/doc/libapache-mod-ssl/ に mod-ssl.conf,
vhost.conf.gz として設定ファイル例があるが、woody はない…
<IfModule mod_ssl.c>
  〜

<VirtualHost>
〜
を追加
Referrer (Inside): [2005-08-28-1] [2005-08-09-1]

Apache .htaccess の IP アドレス指定書式
2004-11-02-1 / カテゴリ: [Apache] / [permlink]

"172.24.17" と書いた場合、172.24.177 は対象とはならない

Apache basic認証 htpasswd パスワードの中身
2004-10-15-2 / カテゴリ: [linux][Apache] / [permlink]

print crypt(shift,
            join("", ('.', '/', 'a'..'z', 'A'..'Z', 0..9)[rand 64, rand 64])
						), "\n";
まぁ、こんな感じで。

Apache htaccess basic認証
2004-10-15-1 / カテゴリ: [linux][Apache] / [permlink]

AuthUserFile /path/to/.htpasswd
AuthGroupFile /dev/null
AuthName "-.-"
AuthType Basic
#require valid-user     # 全ユーザ
require user zaki       # 特定ユーザのみ

Apache2 で mod-ssl 込みでコンパイル
2004-09-14-1 / カテゴリ: [Apache][SSL] / [permlink]

http://mm.apache.or.jp/pipermail/apache-users/2004-September/004683.html
これのとおりで全てうまく良く
$ ./configure --prefix=/export/home/miyazaki/local/apache2-ssl --disable-ipv6
--enable-ssl --with-ssl=/usr/local/ssl --enable-so

Apache で proxy 動作
2004-07-29-1 / カテゴリ: [Apache] / [permlink]

compile

./configure --enable-module=proxy --enable-shared=proxy
make; make install

config

LoadModule proxy_module       libexec/libproxy.so
<IfModule mod_proxy.c>
  Proxyrequests On
</IfModule>
Referrer (Inside): [2007-07-17-1]
カテゴリ: Apache / 1 2 次ページ

最終更新時間: 2013-05-02 16:12