LoginSignup
6
6

More than 5 years have passed since last update.

WebDAV環境の構築手順

Last updated at Posted at 2015-03-23

WebDAV環境の構築手順

各種lamp環境は整っている前提です。

mod_sslのインストール

yum -y install mod_ssl

オレオレ証明書の作成

cd /etc/pki/tls/certs

証明書の発行

openssl genrsa -des3 -out server.key 2048
パスワードを2回聞かれるので入力する

openssl rsa -in server.key -out server.key
パスワードを聞かれるので上で入力したパスワード入力する

openssl req -new -x509 -days 3650 -key server.key -out server.crt
少なくとも Country Name と Common Name は正しい値を入れる
- Country Name : Ja
- Common Name : DomainName

アクセス権の変更

chmod 400 server.key
chmod 400 server.crt

ssl.confの編集

vi /etc/httpd/conf.d/ssl.conf

SSLCertificateFileとSSLCertificateKeyFileを下記のように変更

SSLCertificateFile /etc/pki/tls/certs/server.crt
SSLCertificateKeyFile /etc/pki/tls/certs/server.key

/etc/httpd/conf.d/webdav.confの作成

vim /etc/httpd/conf.d/webdav.conf

Alias /dav/ "/var/www/html/dav/"
<IfModule mod_dav.c>
DAVMinTimeout 600
<Location /dav>
DAV On
EnableSendfile off
SSLRequireSSL
AuthType Basic
AuthName "Login WebDAV"
AuthUserFile "/etc/httpd/conf/.htpasswd"
Require valid-user
Order deny,allow
Deny from all
Allow from all
</Location>
</IfModule>

WebDAVのディレクトリが変わる場合はAliasを変更する

Basicの設定

htpasswd -c /etc/httpd/conf/.htpasswd username
入力後パスワードを2回聞かれる

Apacheの再起動

service httpd restart

WebDAVにつなぐ

https://domainname/dav/
htpasswdのユーザー名とパスワードでログインできる

コマンドラインから接続(Windows)

接続

net use I: https://domainname/dav/ /user:username password

接続解除

net use /delete I:

参考URL

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6