티스토리 뷰

Optional


>> index.html 설정


webdav하위폴더가 아닌 root에 접속했을시 나오는 index.html을 수정한다.

기존 index.html을 백업하고 새로운 index.html을 생성한다.

$sudo cp /var/www/html/index.html /var/www/html/index.html.bak
$sudo nano /var/www/html/index.html

이번 가이드에서는 아래와 같이 입력했다.

<h1>Default WebDAV Page</h1>
<p>This is the default page with directory listings turned off</p>



Configure SSL


>> SSL 모듈 활성화


아파치를 설치할때 SSL모듈 역시 같이 설치되었을 것이다. SSl 모듈은 아래와 같이 활성화한다.

$sudo a2enmod ssl


>> 자가 SSL 인증서 생성


이번 가이드에서는 인증서를 아래와 같이 폴더에 만들것이다.

$sudo mkdir /etc/apache2/ssl
$sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt

각각의 의미는 출처를 참고

https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-14-04


위와 같이 입력 후 아래와 같이 순서대로 입력한다.

Country Name (2 letter code) [AU]:KR(국가코드)
State or Province Name (full name) [Some-State]:Seoul(도시명)
Locality Name (eg, city) []:GangNam(지방명)
Organization Name (eg, company) [Internet Widgits Pty Ltd]:home(회사명)
Organizational Unit Name (eg, section) []:none(부서명)
Common Name (e.g. server FQDN or YOUR name) []:www.example.co.kr(사이트주소)
Email Address []:example@email.com(이메일주소)


>> SSL 설정

$sudo nano /etc/apache2/sites-available/default-ssl.conf


아래와 같이 수정한다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<IfModule mod_ssl.c>
    <VirtualHost _default_:443>
        ServerAdmin webmaster@localhost
        ServerName  localhost
 
        DocumentRoot    /var/www/html
        ErrorLog    ${APACHE_LOG_DIR}/error.log
        CustomLog   ${APACHE_LOG_DIR}/access.log combined
 
        <Directory /home/exhdd/webdav>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
        </Directory>
 
        #username1
        Alias /webdav /home/exhdd/webdav/username1
 
        <Location /username1>
            DAV     On
            AuthType    Basic
            AuthName    "webdav"
            AuthUserFile    /etc/apache2/webdav.passwd
            Require user    username1
        </Location>
 
        #username2
        Alias /username2 /home/exhdd/webdav/username2
 
        <Location /username2>
            DAV     On
            AuthType    Basic
            AuthName    "username2"
            AuthUserFile    /etc/apache2/webdav.passwd
            Require user    username2
        </Location>
 
        SSLEngine on
        SSLCertificateFile  /etc/apache2/ssl/apache.crt
        SSLCertificateKeyFile   /etc/apache2/ssl/apache.key
 
        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>
 
        <Directory /usr/lib/cgi-bin>
                SSLOptions +StdEnvVars
        </Directory>
 
        BrowserMatch "MSIE [2-6]" \
                nokeepalive ssl-unclean-shutdown \
                downgrade-1.0 force-response-1.0
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
    </VirtualHost>
</IfModule>


>> SSL 가상 호스트 활성화


활성화 후 재부팅한다.

$sudo a2ensite default-ssl.conf
$sudo service apache2 restart


'IT > Work' 카테고리의 다른 글

라즈비안 OS Apache2 WebDAV 설정(SSL) - 1  (0) 2016.04.20
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함