My Drive

[CentOS] CentOS7 웹서버 (http, https) 본문

linux

[CentOS] CentOS7 웹서버 (http, https)

sunnyeo.park 2016. 2. 18. 15:31

web server 설치

>> yum install httpd

>> service httpd start

>> yum install php

>> yum install php-mysql



web server http 포트변경 (80 -> 8080)

>> vi /etc/httpd/conf/httpd.conf 수정

- Listen 8080

>> vi /etc/httpd/conf/httpd.conf 마지막에 추가

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

# Virtual hosts

Include conf/extra/httpd-vhosts.conf

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

>> mkdir /etc/httpd/conf/extra

>> vi /etc/httpd/conf/extra/httpd-vhosts.conf 생성 후 수정

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

<VirtualHost *:8080>

  DocumentRoot "/var/www/html"

  <Directory /var/www/html>

    Options FollowSymLinks MultiViews

    AllowOverride All

    Order allow,deny

    allow from all

    require all granted

  </Directory>

</VirtualHost>

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



web server https 설정 및 포트변경 (443 -> 8443)

>> yum install mod_ssl openssl

>> mkdir /etc/httpd/ssl; cd /etc/httpd/ssl

>> openssl genrsa -out server.key 2048

>> openssl req -new -key server.key -out server.csr

>> openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

>> vi /etc/httpd/conf/httpd.conf 추가

- Listen 8443

>> vi /etc/httpd/conf/extra/httpd-vhosts.conf 추가

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

<VirtualHost *:8443>

  DocumentRoot "/var/www/html"

  SSLEngine on

  SSLCertificateFile /etc/httpd/ssl/server.crt

  SSLCertificateKeyFile /etc/httpd/ssl/server.key

  <Directory /var/www/html>

    Options FollowSymLinks MultiViews

    AllowOverride All

    Order allow,deny

    allow from all

    require all granted

  </Directory>

</VirtualHost>

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



'linux' 카테고리의 다른 글

[CentOS] NFQUEUE 설치 및 설정  (0) 2016.02.18
[CentOS] CentOS7 MariaDB 5.5 설치  (0) 2016.02.18
[CentOS] CentOS7 Minimal 기본 설정  (0) 2016.02.18
시스템 문제 만들때  (0) 2014.09.29
[Ubuntu] 리눅스 설치 후  (0) 2014.09.29
Comments