다른 서버의 Hello World를 재정의하는 가상 호스트

다른 서버의 Hello World를 재정의하는 가상 호스트

0rcan0mic.com무슨 이유에서 인지 내 주 서버 의 콘텐츠가 constantcounselling.com다른 서버의 콘텐츠보다 우선 적용됩니다. 에 로드하는 constantcounselling.com내용 대신 hello world를 가져오고 싶습니다 . 아파치가 실행 중입니다.0rcan0mic.com'constantcounselling.com

또한 (내 주 서버)와 동일한 서버에 있는 도메인의 경우 및 0rcan0mic.com와 같은 hello world가 표시됩니다 .mybestfriendsarecats.comorcaaccounting.com

결과httpd -S

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using requin.themartialartsofmoney.com. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:443                  requin.themartialartsofmoney.com (/etc/httpd/conf.d/ssl.conf:56)
*:80                   constantcounselling.com (/etc/httpd/conf.d/constantcounselling.com:1)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default 
Mutex mpm-accept: using_defaults
Mutex authdigest-opaque: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: _RH_HAS_HTTPPROTOCOLOPTIONS
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48

가상 호스트

<VirtualHost *:80>
   
    ServerName constantcounselling.com
    ServerAlias www.constantcounselling.com
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/constantcounselling.com/public_html
    ErrorLog /var/log/httpd/constantcounselling.com-error.log
    CustomLog /var/log/httpd/constantcounselling.com-access.log combined


    <Directory "/var/www/constantcounselling.com/public_html">
      AllowOverride All
    </Directory>
    
  RewriteEngine on
  RewriteCond %{SERVER_NAME} =constantcounselling.com [OR]
  RewriteCond %{SERVER_NAME} =www.constantcounselling.com
  RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<VirtualHost *:80>
   
    ServerName 0rcan0mic.com
    ServerAlias www.0rcan0mic.com
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/0rcan0mic.com/public_html
    ErrorLog /var/log/httpd/0rcan0mic.com-error.log
    CustomLog /var/log/httpd/0rcan0mic.com-access.log combined


    <Directory "/var/www/0rcan0mic.com/public_html">
      AllowOverride All
    </Directory>
    
 RewriteEngine on
 RewriteCond %{SERVER_NAME} =www.0rcan0mic.com [OR]
 RewriteCond %{SERVER_NAME} =0rcan0mic.com
 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
 </VirtualHost>

도움을 주셔서 대단히 감사합니다. 몇 주 동안 이 문제를 해결하지 못했습니다.

관련 정보