현재 80포트는 가짜 폴더를 지정하여 ip로 접속시 404가 뜨게 해 놓았습니다.
도메인으로 접속할때는 루트로 가게 하고 도메인이 아닌경우는 그 보다 위에 지정한 가상호스트로 가짜폴더로 이동시키는건데요.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/없는경로
</VirtualHost>
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName 도메인지정
ServerAdmin webmaster@localhost
DocumentRoot /home/사이트실제 루트경로
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
그런데 default-ssl.conf 를 위와 같은 방식으로 해주면 사이트가 접속이 안되네요.
현재 위 파일의 내용은 이렇게 되어 있습니다.
<VirtualHost 서버아이피:443> // 서버아이피를 * 로 변경해봐도 안되네요.
DocumentRoot /home/사이트 실제 루트경로
ServerName 도메인
Protocols h2 http/1.1
SSLEngine on
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
SSLCertificateFile /etc/apache2/ssl/.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/.com.key
SSLCertificateChainFile /etc/apache2/ssl/_ChainBundle.crt
SSLCACertificateFile /etc/apache2/ssl/ADDTRUST_EXTERNAL_CA_ROOT.crt
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-R SA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE -DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SH A256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-E CDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SH A256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES2 56-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128 -GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA: AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH- DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
SSLHonorCipherOrder on
Header always set Strict-Transport-Security "max-age=15768000"
SSLUseStapling on
SSLStaplingResponderTimeout 5
SSLStaplingReturnResponderErrors off
</VirtualHost>
SSLStaplingCache shmcb:/var/run/ocsp(128000)
</IfModule>
https도 아이피로 접속하면 404를 띄우던지 하고 싶은데요. http랑 많이 다른거 같네요..