묻고답하기
SSL 서버 구축질문
2015.10.16 14:15
이번에 SSL 구축을 시도해보고 있는 대학생입니다.
Startssl 에서 4개의 필수파일은 받아왔으나 어떻게 적용을 해야될지 모르겠습니다.
현재 서버 컴퓨터로는 ( 호스팅 아닙니다 )
맥미니를 사용중이고, OS X 사용중입니다. MAMP 사용중이라 아파치가 기본으로 들어가구요...
누가 도와주실분 없을까요 ㅠㅠ
아니면 방법이라도....
댓글 19
-
기진곰
2015.10.16 14:49
-
Katzecf147
2015.10.16 15:35
정말 좋은글 추천주셔서 감사한데,, 2가지정도 이해 안가는 부분이 있습니다 ㅠㅠ
그리고 적당한 <VirtualHost IP주소:443> 블록 안에 아래와 같이 설정합니다.
SSLEngine on
SSLCertificateFile /폴더/경로/1번.인증서.파일명
SSLCertificateChainFile /폴더/경로/2~3번.인증서.붙인거.파일명
SSLCertificateKeyFile /폴더/경로/개인키.파일명라고 적혀있는데, 어느 파일을 수정해야 되는건가요?
MAMP 안에 Conf 폴더가 있고 그 안에 Apache 폴더가 있거든요.
거기에 httpd 파일이랑, extra, original 폴더가 있습니다.
어느것을 수정해야 하나요?
그리고, 2, 3번 파일을 합칠때
2번파일
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----3번파일
부분이 있는데 이렇게 붙여놓으면 되는건가요?
-
기진곰
2015.10.16 15:38
httpd 폴더 내에 <VirtualHost>라는 내용이 이미 존재하는 파일을 찾아보세요.
아마 MAMP 사용자 커뮤니티를 찾아보면 더 정확한 답이 나올 겁니다.
네, 그렇게 붙이시면 됩니다. 한 인증서의 END 바로 다음 줄에 다음 인증서의 BEGIN이 오도록...
-
Katzecf147
2015.10.16 15:48
# Secure (SSL/TLS) connections
Include /Applications/MAMP/conf/apache/extra/httpd-ssl.confhttpd 에서 이런 부분을 찾았는데
Include /Applications/MAMP/conf/apache/extra/httpd-ssl.conf 이쪽 줄만 주석을 해체해놨습니다.
윗줄에 시큐어도 주석을 해체해야하나요?
그리고 extra 폴더안에 ssl 파일 수정하면 되는거겠죠?
-
기진곰
2015.10.16 16:08
윗줄은 그냥 주석이니 그대로 두시고요...
네, extra/httpd-ssl.conf 파일을 수정하시면 될 것 같습니다.
이미 있는 내용과 겹치는 건 적당히 고치시고요.
-
Katzecf147
2015.10.16 16:09
제가,, 이쪽 언어는 거의 처음 건드려보는거라..
정말 죄송하지만 살짝만 도와주실수 있을까요 ㅠㅠㅠㅠ.....
제 Apache Conf 파일을 보내드릴테니,, 잘못된게 있는지 살짝만 검토해주실수 없으련지요 ㅠㅠ
초보 프로그래머라 죄송한 마음이지만 부탁드려봅니다..
-
기진곰
2015.10.16 16:50
잘 된다면 딱히 검토할 필요도 없고... 안 되는 것이 있나요? 어떻게 안 되나요? (예: 보안오류가 뜬다, 아예 접속이 안 된다, 화면에서 처녀귀신이 기어나온다 등등)
-
Katzecf147
2015.10.16 16:52
일단,, 아파치 Conf 파일을 잘못건드려서 서버 킬때마다 실행이 안되다보니까
백업해 놨던 Conf 파일을 붙여넣어서 서버 작동은 됩니다만,,
SSL 서버 쪽을 수정해도 제대로 작동이 안되거나, 아파치 서버가 안켜집니다.
게다가 파일이 pfx, crt, key, pem 확장자 4개가 있는데 어디에 넣어야 될지도 모르겠고.....
시간이 되신다면,, 팀뷰어로 봐주실수는 없을까요 ㅠ
-
기진곰
2015.10.16 17:02
여기서는 공개적인 질문/답변만 하고 있습니다.
pfx는 무시하셔도 됩니다.
아파치 에러 로그 파일이 있을 테니, 거기에 나오는 에러메시지를 보고 문제의 원인을 찾아보세요.
-
Katzecf147
2015.10.16 17:04
알겠습니다.. 최대한 노력해서 해결해보겠습니다.
-
Katzecf147
2015.10.16 17:08
<VirtualHost _default_:443>
# General setup for the virtual host
DocumentRoot "/Applications/MAMP/Library/htdocs"
ServerName tigrisfleet.co.kr:443
ServerAdmin hwhwh1224@naver.com
ErrorLog "/Applications/MAMP/Library/logs/error_log"
TransferLog "/Applications/MAMP/Library/logs/access_log"# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on# SSL Cipher Suite:
# List the ciphers that the client is permitted to negotiate.
# See the mod_ssl documentation for a complete list.# Uncomment the next line if Apache should not accept SSLv3 connections, to learn more google for "POODLE SSLv3".
# SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:-SSLv3:+EXP:+eNULL# Comment the next line (and uncomment the line above) if Apache should not accept SSLv3 connections, to learn more google for "POODLE SSLv3".
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL# Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate. If
# the certificate is encrypted, then you will be prompted for a
# pass phrase. Note that a kill -HUP will prompt again. Keep
# in mind that if you have both an RSA and a DSA certificate you
# can configure both in parallel (to also allow the use of DSA
# ciphers, etc.)
SSLCertificateFile "/Applications/MAMP/htdocs/ssl/tigris.crt”
#SSLCertificateFile "/Applications/MAMP/conf/apache/server-dsa.crt"# Server Private Key:
# If the key is not combined with the certificate, use this
# directive to point at the key file. Keep in mind that if
# you've both a RSA and a DSA private key you can configure
# both in parallel (to also allow the use of DSA ciphers, etc.)
SSLCertificateKeyFile "/Applications/MAMP/htdocs/ssl/tigris.key“
#SSLCertificateKeyFile "/Applications/MAMP/conf/apache/server-dsa.key"# Server Certificate Chain:
# Point SSLCertificateChainFile at a file containing the
# concatenation of PEM encoded CA certificates which form the
# certificate chain for the server certificate. Alternatively
# the referenced file can be the same as SSLCertificateFile
# when the CA certificates are directly appended to the server
# certificate for convinience.
SSLCertificateChainFile "/Applications/MAMP/htdocs/ssl/tigris.pem”# Certificate Authority (CA):
# Set the CA certificate verification path where to find CA
# certificates for client authentication or alternatively one
# huge file containing all of them (file must be PEM encoded)
# Note: Inside SSLCACertificatePath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCACertificatePath "/Applications/MAMP/conf/apache/ssl.crt"
#SSLCACertificateFile "/Applications/MAMP/conf/apache/ssl.crt/ca-bundle.crt"# Certificate Revocation Lists (CRL):
# Set the CA revocation path where to find CA CRLs for client
# authentication or alternatively one huge file containing all
# of them (file must be PEM encoded)
# Note: Inside SSLCARevocationPath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCARevocationPath "/Applications/MAMP/conf/apache/ssl.crl"
#SSLCARevocationFile "/Applications/MAMP/conf/apache/ssl.crl/ca-bundle.crl"# Client Authentication (Type):
# Client certificate verification type and depth. Types are
# none, optional, require and optional_no_ca. Depth is a
# number which specifies how deeply to verify the certificate
# issuer chain before deciding the certificate is not valid.
#SSLVerifyClient require
#SSLVerifyDepth 10# Access Control:
# With SSLRequire you can do per-directory access control based
# on arbitrary complex boolean expressions containing server
# variable checks and other lookup directives. The syntax is a
# mixture between C and Perl. See the mod_ssl documentation
# for more details. -
Katzecf147
2015.10.16 17:08
SSL 설정 파일인데,, 뭘 안넣었는지 SSL 서버가 작동을 안하네요 ㅠㅠ
-
기진곰
2015.10.16 17:10
뒤가 잘린 것 같은데요.
<VirtualHost> 태그를 열었으면 다시 닫아야 하는데...
-
Katzecf147
2015.10.16 17:11
이건 제가 입력한게 아니라, 자체적으로 들어있던거긴 한데,,,
너무 길어서 제가 중간에 잘랐습니다..
<VirtualHost _default_:443>
# General setup for the virtual host
DocumentRoot "/Applications/MAMP/Library/htdocs"
ServerName tigrisfleet.co.kr:443
ServerAdmin hwhwh1224@naver.com
ErrorLog "/Applications/MAMP/Library/logs/error_log"
TransferLog "/Applications/MAMP/Library/logs/access_log"# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on# SSL Cipher Suite:
# List the ciphers that the client is permitted to negotiate.
# See the mod_ssl documentation for a complete list.# Uncomment the next line if Apache should not accept SSLv3 connections, to learn more google for "POODLE SSLv3".
# SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:-SSLv3:+EXP:+eNULL# Comment the next line (and uncomment the line above) if Apache should not accept SSLv3 connections, to learn more google for "POODLE SSLv3".
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL# Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate. If
# the certificate is encrypted, then you will be prompted for a
# pass phrase. Note that a kill -HUP will prompt again. Keep
# in mind that if you have both an RSA and a DSA certificate you
# can configure both in parallel (to also allow the use of DSA
# ciphers, etc.)
SSLCertificateFile "/Applications/MAMP/htdocs/ssl/tigris.crt”
#SSLCertificateFile "/Applications/MAMP/conf/apache/server-dsa.crt"# Server Private Key:
# If the key is not combined with the certificate, use this
# directive to point at the key file. Keep in mind that if
# you've both a RSA and a DSA private key you can configure
# both in parallel (to also allow the use of DSA ciphers, etc.)
SSLCertificateKeyFile "/Applications/MAMP/htdocs/ssl/tigris.key“
#SSLCertificateKeyFile "/Applications/MAMP/conf/apache/server-dsa.key"# Server Certificate Chain:
# Point SSLCertificateChainFile at a file containing the
# concatenation of PEM encoded CA certificates which form the
# certificate chain for the server certificate. Alternatively
# the referenced file can be the same as SSLCertificateFile
# when the CA certificates are directly appended to the server
# certificate for convinience.
SSLCertificateChainFile "/Applications/MAMP/htdocs/ssl/tigris.pem”# Certificate Authority (CA):
# Set the CA certificate verification path where to find CA
# certificates for client authentication or alternatively one
# huge file containing all of them (file must be PEM encoded)
# Note: Inside SSLCACertificatePath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCACertificatePath "/Applications/MAMP/conf/apache/ssl.crt"
#SSLCACertificateFile "/Applications/MAMP/conf/apache/ssl.crt/ca-bundle.crt"# Certificate Revocation Lists (CRL):
# Set the CA revocation path where to find CA CRLs for client
# authentication or alternatively one huge file containing all
# of them (file must be PEM encoded)
# Note: Inside SSLCARevocationPath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCARevocationPath "/Applications/MAMP/conf/apache/ssl.crl"
#SSLCARevocationFile "/Applications/MAMP/conf/apache/ssl.crl/ca-bundle.crl"# Client Authentication (Type):
# Client certificate verification type and depth. Types are
# none, optional, require and optional_no_ca. Depth is a
# number which specifies how deeply to verify the certificate
# issuer chain before deciding the certificate is not valid.
#SSLVerifyClient require
#SSLVerifyDepth 10# Access Control:
# With SSLRequire you can do per-directory access control based
# on arbitrary complex boolean expressions containing server
# variable checks and other lookup directives. The syntax is a
# mixture between C and Perl. See the mod_ssl documentation
# for more details.
#<Location />
#SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
# and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
# and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
# and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
# and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
# or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
#</Location># SSL Engine Options:
# Set various options for the SSL engine.
# o FakeBasicAuth:
# Translate the client X.509 into a Basic Authorisation. This means that
# the standard Auth/DBMAuth methods can be used for access control. The
# user name is the `one line' version of the client's X.509 certificate.
# Note that no password is obtained from the user. Every entry in the user
# file needs this password: `xxj31ZMTZzkVA'.
# o ExportCertData:
# This exports two additional environment variables: SSL_CLIENT_CERT and
# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
# server (always existing) and the client (only existing when client
# authentication is used). This can be used to import the certificates
# into CGI scripts.
# o StdEnvVars:
# This exports the standard SSL/TLS related `SSL_*' environment variables.
# Per default this exportation is switched off for performance reasons,
# because the extraction step is an expensive operation and is usually
# useless for serving static content. So one usually enables the
# exportation for CGI and SSI requests only.
# o StrictRequire:
# This denies access when "SSLRequireSSL" or "SSLRequire" applied even
# under a "Satisfy any" situation, i.e. when it applies access is denied
# and no other module can change it.
# o OptRenegotiate:
# This enables optimized SSL connection renegotiation handling when SSL
# directives are used in per-directory context.
#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/Applications/MAMP/Library/cgi-bin">
SSLOptions +StdEnvVars
</Directory># SSL Protocol Adjustments:
# The safe and default but still SSL/TLS standard compliant shutdown
# approach is that mod_ssl sends the close notify alert but doesn't wait for
# the close notify alert from client. When you need a different shutdown
# approach you can use one of the following variables:
# o ssl-unclean-shutdown:
# This forces an unclean shutdown when the connection is closed, i.e. no
# SSL close notify alert is send or allowed to received. This violates
# the SSL/TLS standard but is needed for some brain-dead browsers. Use
# this when you receive I/O errors because of the standard approach where
# mod_ssl sends the close notify alert.
# o ssl-accurate-shutdown:
# This forces an accurate shutdown when the connection is closed, i.e. a
# SSL close notify alert is send and mod_ssl waits for the close notify
# alert of the client. This is 100% SSL/TLS standard compliant, but in
# practice often causes hanging connections with brain-dead browsers. Use
# this only for browsers where you know that their SSL implementation
# works correctly.
# Notice: Most problems of broken clients are also related to the HTTP
# keep-alive facility, so you usually additionally want to disable
# keep-alive for those clients, too. Use variable "nokeepalive" for this.
# Similarly, one has to force some clients to use HTTP/1.0 to workaround
# their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
# "force-response-1.0" for this.
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0# Per-Server Logging:
# The home of a custom SSL log file. Use this when you want a
# compact non-error SSL logfile on a virtual host basis.
CustomLog "/Applications/MAMP/Library/logs/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"</VirtualHost>
-
Katzecf147
2015.10.16 17:11
원본입니다..
-
기진곰
2015.10.16 17:22
딱히 문제될 만한 것은 보이지 않는데요. 아파치 에러로그에는 뭐라고 나오나요? (마지막으로 재시작했을 때 발생한 에러만 알려주시면 됩니다.)
-
Katzecf147
2015.10.16 17:26
[Fri Oct 16 17:06:12 2015] [notice] Apache/2.2.29 (Unix) mod_wsgi/3.5 Python/2.7.10 PHP/5.6.10 mod_ssl/2.2.29 OpenSSL/0.9.8zf DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.22.0 configured -- resuming normal operations
[Fri Oct 16 17:07:21 2015] [notice] caught SIGTERM, shutting down
[Fri Oct 16 17:25:58 2015] [notice] Digest: generating secret for digest authentication ...
[Fri Oct 16 17:25:58 2015] [notice] Digest: done
[Fri Oct 16 17:25:58 2015] [notice] FastCGI: process manager initialized (pid 27504)
[Fri Oct 16 17:25:58 2015] [notice] Apache/2.2.29 (Unix) mod_wsgi/3.5 Python/2.7.10 PHP/5.6.10 mod_ssl/2.2.29 OpenSSL/0.9.8zf DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.22.0 configured -- resuming normal operations
[Fri Oct 16 17:26:10 2015] [notice] caught SIGTERM, shutting down라고 뜨는데,, 어디가 문제인지 잘 모르겠네요 ㅠㅠ
-
기진곰
2015.10.16 17:30
여기도 문제는 보이지 않는데요.
-
Katzecf147
2015.10.16 17:33
하,,,,, 지금 서버 열려있는데 443 포트 적용해봐도 아무것도 안되고,,,
지금 3일째 삽질중인데 뭐가 문제인지 모르겠네요..
웹마스터 팁 게시판 맨 꼭대기에
https://www.xpressengine.com/tip/23021383