Score:0

Apache นำผู้เข้าชม https:b-site ไปที่ https:a-site (b-site ไม่มี ssl)

ธง jp

ฉันมีปัญหากับระบบ apache ของฉัน มันใหม่เอี่ยม และฉันก็เช่นกัน

ปัญหาของฉันตอนนี้คือถ้าใครมาเยี่ยม https://123.446.689.0 หรือ https://b-site.com, (ซึ่งไม่มี ssl เลย) แล้ว a-site จะตัดหน้า https...

การเชื่อมต่อกระโดดแบบนั้นได้อย่างไร? (แน่นอนว่ามีคำเตือนเกิดขึ้น เนื่องจาก ssl เป็นของโดเมนอื่น)

ฉันจะได้รับ ssl บน b-site ถึง แต่ไม่สามารถรับ ssl ไปยัง ip และการเข้าถึง IP โดยตรงทั้งหมดควรเปลี่ยนเส้นทางไปยังไซต์อื่น (ซึ่งปัจจุบันเป็นค่าเริ่มต้น 000)

นี่คือไฟล์กำหนดค่าของฉัน

a-site.com.conf

<VirtualHost a-site.com:80>
ServerName a-site.com
DocumentRoot /var/www/a-site.com
    <Directory /var/www/a-site.com>
        Options FollowSymLinks
        AllowOverride Limit Options FileInfo
        DirectoryIndex index.html index.php
        Require all granted

    </Directory>
<Directory /var/www/a-site.com/wp-content>
        Options FollowSymLinks
        Require all granted

    </Directory>

ErrorLog ${APACHE_LOG_DIR}/a-site.error.log
CustomLog ${APACHE_LOG_DIR}/a-site.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =a-site.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

a-conf.com-le-ssl.conf

<IfModule mod_ssl.c>
<VirtualHost a-site.com:443>
    ServerName a-site.com
    ServerAdmin arga@localhost
    DocumentRoot /var/www/a-site.com
    ErrorLog ${APACHE_LOG_DIR}/a-site.error.log
    CustomLog ${APACHE_LOG_DIR}/a-site.access.log combined


SSLCertificateFile /etc/letsencrypt/live/a-site.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/a-site.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
Header always set Strict-Transport-Security "max-age=31536000"
</VirtualHost>
</IfModule>

000-default.conf

<VirtualHost 123.456.789.0:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/00
        ErrorLog ${APACHE_LOG_DIR}/catchall.error.log
        CustomLog ${APACHE_LOG_DIR}/catchall.access.log combined

</VirtualHost>

b-site.com.conf

<VirtualHost b-site.com:80>
ServerName b-site.com
DocumentRoot /var/www/b-site.com
    <Directory /var/www/b-site.com>
        Options FollowSymLinks
        AllowOverride Limit Options FileInfo
        DirectoryIndex index.html index.php
        Require all granted

    </Directory>
<Directory /var/www/b-site.com/wp-content>
        Options FollowSymLinks
        Require all granted

    </Directory>

ErrorLog ${APACHE_LOG_DIR}/b-site.error.log
CustomLog ${APACHE_LOG_DIR}/b-site.log combined

</VirtualHost>

000-default-ssl.conf

<IfModule mod_ssl.c>
  
 <VirtualHost _default_:443>
            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/00
            
            ErrorLog ${APACHE_LOG_DIR}/napto.def.error.log
            CustomLog ${APACHE_LOG_DIR}/napto.def.access.log combined
            SSLEngine on

            SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
            SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
            <FilesMatch "\.(cgi|shtml|phtml|php)$">
                            SSLOptions +StdEnvVars
            </FilesMatch>
            <Directory /usr/lib/cgi-bin>
                            SSLOptions +StdEnvVars
            </Directory>             
        </VirtualHost>
</IfModule>
Jerry avatar
jp flag
ฉันได้เพิ่มไซต์ใหม่ชื่อ 00al... แต่ตอนนี้ไซต์ 00al สกัดกั้นไซต์ a-https... เกิดอะไรขึ้น เป็นไปได้อย่างไร?
Score:1
ธง jp

คุณมีเพียง a-site.com:443 โฮสต์เสมือน กำหนดไว้สำหรับพอร์ต 443 (https) ดังนั้น Apache จึงแสดงเฉพาะไซต์ที่สามารถหาแสดงได้

คุณต้องกำหนดค่าเริ่มต้น โฮสต์เสมือน บนพอร์ต 443 <VirtualHost _default_:443> แบบเดียวกับที่คุณมี 000-default.conf (หรือตรวจสอบว่าคุณมี เริ่มต้น-ssl.conf และเปิดใช้งาน) คุณยังต้องมีใบรับรอง TLS/SSL สำหรับโฮสต์เริ่มต้น แต่คุณสามารถสร้างใบรับรองที่ลงนามด้วยตนเองได้ ระบบที่ใช้เดเบียนได้สร้างขึ้นสำหรับคุณแล้ว /etc/ssl/certs/ssl-cert-snakeoil.pem.

Jerry avatar
jp flag
อันที่จริง ฉันมีอันหนึ่ง และเมื่อไหร่ก็ไม่ต่างกันหากเปิดใช้งานหรือไม่ ฉันได้ลองเปลี่ยนชื่อเป็น 000-def... ดังนั้นมันจะเป็นก่อนหน้านั้น a-site แต่ไซต์ยังคงสกัดกั้น https: //123.456.789.0 โทร..
Jerry avatar
jp flag
จริง ๆ แล้ว ฉันรู้สึกเหนื่อยหน่ายจริง ๆ ฉันได้เขียน .conf แทน .com ในบรรทัด virtualhost... และเมื่อฉันตรวจสอบที่อยู่ในคำถาม ข้อผิดพลาดก็หายไป แต่ฉันมีคำตอบที่ถูกต้องตามนั้น อยู่ในคำถามนี้..

โพสต์คำตอบ

คนส่วนใหญ่ไม่เข้าใจว่าการถามคำถามมากมายจะปลดล็อกการเรียนรู้และปรับปรุงความสัมพันธ์ระหว่างบุคคล ตัวอย่างเช่น ในการศึกษาของ Alison แม้ว่าผู้คนจะจำได้อย่างแม่นยำว่ามีคำถามกี่ข้อที่ถูกถามในการสนทนา แต่พวกเขาไม่เข้าใจความเชื่อมโยงระหว่างคำถามและความชอบ จากการศึกษาทั้ง 4 เรื่องที่ผู้เข้าร่วมมีส่วนร่วมในการสนทนาด้วยตนเองหรืออ่านบันทึกการสนทนาของผู้อื่น ผู้คนมักไม่ตระหนักว่าการถามคำถามจะมีอิทธิพลหรือมีอิทธิพลต่อระดับมิตรภาพระหว่างผู้สนทนา