时间:2023-02-07 21:40:01 | 来源:建站知识
时间:2023-02-07 21:40:01 来源:建站知识
添加解析记录: video.fuyeor.com | A 记录 | 记录值:服务器 IP
单服务器开设多个二级域名Include conf/extra/httpd-vhosts.confLoadModule proxy_module modules/mod_proxy.soLoadModule proxy_ajp_module modules/mod_proxy_ajp.soLoadModule proxy_balancer_module modules/mod_proxy_balancer.soLoadModule proxy_connect_module modules/mod_proxy_connect.soLoadModule proxy_http_module modules/mod_proxy_http.soLoadModule slotmem_shm_module modules/mod_slotmem_shm.so
接下来配置网站。video.fuyeor.com 做示例[2]#配置一个virtualHost<VirtualHost *:80> ServerName video.fuyeor.com ProxyRequests OffProxyPreserveHost On <Proxy /> Order deny,allow Allow from all </Proxy> ProxyPass / #此处填写你的域名+端口,同下# ProxyPassReverse / #此处填写你的域名+端口, 如fuyeor:81#</VirtualHost>
示例:<VirtualHost *:80> ServerName video.fuyeor.com ProxyRequests OffProxyPreserveHost On <Proxy /> Order deny,allow Allow from all </Proxy> ProxyPass / http://fuyeor.com:90 ProxyPassReverse / http://fuyeor.com:90</VirtualHost>
开启 https 设置。[3]SSLEngine on #开启SSLSSLProxyEngine OnSSLProxyVerify noneSSLCertificateFile "C:/SSL证书路径/ video.fuyeor.com _public.crt" #公匙证书SSLCertificateKeyFile "C:/SSL证书路径/ video.fuyeor.com .key" #私匙证书SSLCertificateChainFile "C:/SSL证书路径/ video.fuyeor.com _chain.crt" #域名证书
并将HTTP重定向到相应的HTTPS站点:<VirtualHost *:80>ServerName video.fuyeor.comRewriteEngine onRewriteRule ^(.*)?$ https://video.fuyeor.com $1 [R=301,L]</VirtualHost>
#1、将 80端口的 video.fuyeor.com 重定向到 443端口#即将 http://video.fuyeor.com 重定向到 https://video.fuyeor.com<VirtualHost *:80>ServerName video.fuyeor.comRewriteEngine onRewriteRule ^(.*)?$ https://video.fuyeor.com $1 [R=301,L]</VirtualHost>#将端口转发到域名 video.fuyeor.com<VirtualHost *:443> ServerName video.fuyeor.com ProxyRequests OffProxyPreserveHost OnSSLEngine onSSLProxyEngine OnSSLProxyVerify noneSSLCertificateFile "C:/SSL证书路径/ video.fuyeor.com _public.crt" #公匙证书SSLCertificateKeyFile "C:/SSL证书路径/ video.fuyeor.com .key" #私匙证书SSLCertificateChainFile "C:/SSL证书路径/ video.fuyeor.com _chain.crt" #域名证书 <Proxy /> Order deny,allow Allow from all </Proxy> ProxyPass / http://fuyeor.com:90 ProxyPassReverse / http://fuyeor.com:90</VirtualHost>
本文综合自复玥网网站及 @fer docs。
内容遵循 CC BY-ND 署名-禁止演绎协议~
关键词:设置,服务,个子