리눅스 vhosts 추가

유영·2023년 6월 2일
0

Linux

목록 보기
7/11

1.httpd-ssl.conf 파일에 내용추가

<VirtualHost _default_:443>
~~
 </VirtualHost>

2. find 명렁어로 apache 폴더를 찾습니다.

/# find / -name apache -print

3. 검색된 아파치 폴더의 bin 폴더로 apache 재실행

  • 방법1.
    /# apachectl restart
  • 방법2. - 경로 설정이 되어 있지 않을때
    /# /usr/local/apache/bin/apachectl restart
  • 방법3.
    [root@linux]# ps -aux | grep httpd
    root 583 0.0 6.2 6076 3968 ? S 15:29 0:01 httpd
    nobody 609 0.0 6.8 6196 4300 ? S 15:29 0:08 httpd
    nobody 610 0.0 6.8 6200 4304 ? S 15:29 0:06 httpd
    root 4483 0.0 0.8 2236 516 pts/0 S 23:29 0:00 grep httpd
    [root@linux]# kill -HUP 583

HTTP / HTTPS
HTTPS 의 S(Secure)d를 나타낸다.
이는 보안이 향상된 웹통신을 하기위함이 목적.
우선 HTTPS와 SSL은 다르다.

SSL / TLS 는 '보안계층'이라는 독립적인 프로토콜 계층을 만들어, 위 그림과 같이 응용계층과
전송계층 사이에 속하게 된다.
HTTP뿐만아니라 FTP, SMTP와 같이 다른 프로토콜에도 적용가능하다.
SSL과 TLS는 같은 의미이다. TLS가 SSL의 후속버전이지만, SSL이 일반적으로 더 많이 사용된다.

HTTPS는 SSL또는 TLS위에 HTTP프로토콜을 얹어 보안된 HTTP통신 프로토콜이다.

<SSL암호화 통신 과정>
1.핸드셰이크
데이터를 주고받기위해 어떤 방법을 사용할 지 서로의 상태파악
2.전송
HHTP는 80번 포트를 사용 / SSL은 443포트 사용하는 TCP기반의 프로토콜
3.종료
세션종료


<VirtualHost *:80>
    DocumentRoot "/home/estudy/html"
    ServerName randomo.kr
    ServerAlias www.randomo.kr
    ErrorLog "logs/error_log"
    CustomLog "logs/access_log" vcommon
</VirtualHost>

<Directory "/usr/local/apache/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

/usr/local/apache/conf/extra/httpd-ssl.conf
수정후 아파치 재시작
https (ssl)

<VirtualHost _default_:443>
#   General setup for the virtual host
DocumentRoot "/home/estudy/html/renewal_2023"
ServerName 2023.nowlms.com:443
ServerAdmin you@nowlms.com
ErrorLog /usr/local/apache/logs/error_log
TransferLog /usr/local/apache/logs/access_log

#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

#   ciphers, etc.)
SSLCertificateFile /usr/local/apache/conf/ssl/ast.nowlms.com.2023.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl/ast.nowlms.com.2023.key
SSLCACertificateFile /usr/local/apache/conf/ssl/ca.ast.nowlms.com.2023.crt

<FilesMatch "\.(cgi|shtml|phtml|php)$">
  SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/usr/local/apache/cgi-bin">
  SSLOptions +StdEnvVars
</Directory>

BrowserMatch ".*MSIE.*" \
       nokeepalive ssl-unclean-shutdown \
       downgrade-1.0 force-response-1.0

CustomLog /usr/local/apache/logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
 </VirtualHost>

0개의 댓글