ノードプロジェクトはどのようにドメイン名をバインドしますか?使用するapacheサーバ.

2251 ワード

ネット上のほとんどの答えはnginxを使用した逆エージェントで、apacheサーバがどのように設定されているかを記録します.
コンフィギュレーション
  • Apacheのプロファイルでmod_を開くproxyとmod_proxy_httpなど、httpdを削除します.confの#
  • LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_connect_module modules/mod_proxy_connect.so
    LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    

    私たちのサーバーがウェブサイトを配置することはできません.so私たちは次のコードをhttpdに直接追加することはできません.confファイルには、サイトごとに個別のプロファイルが追加されます.たとえば、/usr/local/apache/conf/vhostディレクトリの下には、Webサイトごとに個別のプロファイルがあります.httpプロファイルは次のとおりです
    
        ServerAdmin [email protected]
       #DocumentRoot "/data/wwwroot/webrtc.xxxxxxx.com"//      ,                 。
        ServerName webrtc.xxxxxxx.com
        ErrorLog "/data/wwwlogs/webrtc.xxxxxxx.com_error_apache.log"
        CustomLog "/data/wwwlogs/webrtc.xxxxxxx.com_apache.log" common
    
        ProxyRequests off
          
            Order deny,allow
            Deny from all
            Allow from all
          
    
          
            ProxyPass http://localhost:3000/
            ProxyPassReverse http://localhost:3000/
          
    
    

    次はhttpsプロファイルです
    
        ServerAdmin [email protected]
       #DocumentRoot "/data/wwwroot/webrtc.xxxxxxx.com"//      ,                 。
        ServerName webrtc.xxxxxxx.com
    
        SSLEngine on
        SSLProtocol all -SSLv2 -SSLv3
        SSLCipherSuite AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
        SSLCertificateFile /usr/local/apache/conf/ssl/webrtc.xxxxxxxx.com/public.pem
        SSLCertificateKeyFile /usr/local/apache/conf/ssl/webrtc.xxxxxx.com/webrtc.key
        SSLCertificateChainFile /usr/local/apache/conf/ssl/webrtc.xxxxxxx.com/chain.pem
    
        ErrorLog "/data/wwwlogs/webrtc.xxxxxxx.com_error_apache.log"
        CustomLog "/data/wwwlogs/webrtc.xxxxxxx.com_apache.log" common
    
        ProxyRequests off
          
            Order deny,allow
            Deny from all
            Allow from all
          
    
          
            ProxyPass http://localhost:3000/
            ProxyPassReverse http://localhost:3000/
          
    
    
    $ node server.jsを実行します
    問題があれば伝言を残してください.