달력

42024  이전 다음

  • 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

SSL 인증서를 먼저 발급을 받아야 합니다. 밑 글을 참조하여 받으시면 됩니다.


win-acme.v1.9.10.1.zip


2018/05/14 - [라즈베리파이3] - 서버클라우드에 무료 SSL인증서를 발급하기 [ Windows ][펌]


[무료 SSL 발급 사이트]

https://www.sslforfree.com/

https://zerossl.com/

https://letsencrypt.org  -> https://github.com/Lone-Coder/letsencrypt-win-simple/releases



아래 설명에 사용한 도메인은 예를 들어서 한것이니 참고 바랍니다.


간단한 발급 과정 [windows 로컬 서버경우]


letsencrypt.exe 실행


▶ M: Create new certificate with advanced options


▶ 1: Manually input host names


▶ Enter comma-separated list of host names, starting with the primary one:  


인증받을 도메인을 한개 이상 적으면 됨 

하나이면 : blog.cjbox.kr

두개이면 : blog.cjbox.kr,cjbox.tistory.com

( , )구분자로 구분


▶ 3: [http-01] Save file on local (network) path    <- 로컬일 경우

▶ 5: [http-01] Upload verification file to FTP(S) server <- 원격일 경우


저는 3번 입니다.


▶ Enter a site path (the web root of the host for http authentication):  <- 루트 경로를 적어 주시면 됩니다.


보통 xampp 경우  C:\xampp\htdocs 되겠죠


▶ 1: Do not run any installation steps


----------------------------------------------------------------------------------------------------

 [INFO] Authorize identifier: blog.cjbox.kr

 [INFO] Cached authorization result: valid

 [INFO] Requesting certificate blog.cjbox.kr 2018-5-14 11:56:52 오전

 [INFO] Saving certificate to C:\ProgramData\win-acme\httpsacme-v01.api.letsencrypt.org

 [INFO] Installing certificate in the certificate store

 [INFO] Adding certificate blog.cjbox.kr 2018-5-14 11:56:52 오전 to store My

 [INFO] Uninstalling certificate from the certificate store

 [INFO] Removing certificate blog.cjbox.kr 2018-5-11 13:23:05 오후 from store My


 Do you want to replace the existing task? (y/n):

----------------------------------------------------------------------------------------------------

위처럼 나오면 정상적으로 생성 된겁니다.


N 를 누르고 이제 종료 하시면됩니다.


C:\ProgramData\win-acme\httpsacme-v01.api.letsencrypt.org  경로로 가보시면


파일이 여러개가 생성 되어있는데 여기서 사용할 인증서 파일들은


blog.cjbox.kr-crt.pem

blog.cjbox.kr-key.pem

ca-blog.cjbox.kr-crt.pem

이렇게 3개가 됩니다.



인증서 생성 파일이 있습니다.

적당한곳에 옴겨서 하셔도 되고

그대로 두고 사용하셔도 됩니다.


httpd-ssl.conf 파일을 열어서 수정할 부분은


<VirtualHost *:443>

DocumentRoot "C:/xampp/htdocs"

ServerName localhost


SSLEngine on

SSLCertificateFile "C:/webservice/cert/blog.cjbox.kr-crt.pem"

SSLCertificateKeyFile "C:/webservice/cert/blog.cjbox.kr-key.pem"

SSLCertificateChainFile "C:/webservice/cert/ca-blog.cjbox.kr-crt.pem"


</VirtualHost> 


위 내용에 SSL 시작한 구문 4줄이 가장 중요 합니다.

추가 시키고 저장하신후에

conf/httpd.conf 파일에

밑에 내용 두개 주석 해제 시킵니다.

LoadModule ssl_module modules/mod_ssl.so

Include conf/extra/httpd-ssl.conf


저장하고 서버 재기동 하면 됩니다.





----------ps-----------


http - > https 리다이렉트


<VirtualHost *:80>

    ServerName 도메인

    RewriteEngine on

    RewriteCond %{HTTPS} off

    RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]

</VirtualHost>






httpd.conf, httpd-vhosts.conf,  httpd-ssl 셋팅 파일 올려 드립니다.  참조하시면 될것 같습니다.


APM 환경 설정.zip


아파치 사용시 서비스 등록방법(위 환경설정을 토대로 작성한 내용입니다


cd C:\APM\Apache24\bin


(서비스 등록)

httpd.exe -k install -n "Apache2.4-Main" -f "C:\APM\Apache24\conf\httpd.conf"

httpd.exe -k install -n "Apache2.4-server_php5" -f "C:\APM\Apache24\conf\httpd_server_php5.conf"

httpd.exe -k install -n "Apache2.4-server_php7" -f "C:\APM\Apache24\conf\httpd_server_php7.conf"



(서비스 제거)

httpd.exe -k uninstall -n "Apache2.4-Main"

httpd.exe -k uninstall -n "Apache2.4-server_php5"

httpd.exe -k uninstall -n "Apache2.4-server_php7"



(서비스 설정파일 검사)

httpd.exe -n "Apache2.4-Main" -t

httpd.exe -n "Apache2.4-server_php5" -t

httpd.exe -n "Apache2.4-server_php7" -t



서비스 등록할때 에러가 나면은 아래 파일 설치하세요.

vcredist_x64.exe

vcredist_x86.exe





-------------------------------------------------------------------

APM 서비스 구축시 어려운 부분이 있어 정리하면서 샘플로 만들어논 자료입니다.


아파치,PHP5,PHP7 포함되어있습니다.


APM.zip

APM.z01

APM.z02

APM.z03

APM.z04



Posted by 타카스 류지
|