zoukankan      html  css  js  c++  java
  • APACHE 配置虚拟主机和HTTPS

    prepare the running env of os

    make sure you are using redhat or centen os 7.5
    cat /etc/redhat-release
    yum install git
    yum install openssl

    prepare the running env apache

    yum install httpd
    yum install mod_wsgi
    yum install mod_ssl
    config cert for apache refer to https://help.aliyun.com/knowledge_detail/95493.html?spm=5176.2020520154.cas.40.6af0yuzByuzByE

    how to run it at appche httpd2.4.6 of Redhat7.5

    git the code at /app/ and it will at

    /app/yourproject/

    add the config of follow to /etc/httpd/conf/httpd.conf

    support python web wsgi

    <VirtualHost *:80>
            DocumentRoot "/appvol/SigninWork"
            ServerName checkin.robin.org.cn
            #ServerAlias checkin.robin.org.cn
            WSGIScriptAlias / /appvol/SigninWork/code.py/
            Alias /static  /appvol/SigninWork/static/
            AddType text/html .py
    
           #对于80端口开启RUL重定向
           RewriteEngine on
           RewriteCond %{HTTPS} !=on
           RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R]
    
           <Directory "/appvol/SigninWork">
                     Options FollowSymLinks
                     AllowOverride All
                     Require all granted
            </Directory>
    </VirtualHost>
    <VirtualHost *:443>
            DocumentRoot "/appvol/SigninWork"
            ServerName checkin.robin.org.cn
            #ServerAlias www.robin.org.cn
            WSGIScriptAlias / /appvol/SigninWork/code.py/
            Alias /static  /appvol/SigninWork/static/
            AddType text/html .py
            <Directory "/appvol/SigninWork">
                     Options FollowSymLinks
                     AllowOverride All
                     Require all granted
            </Directory>
    </VirtualHost>
    

    support php

    <VirtualHost *:80>
            DocumentRoot "/appvol/wordpress_blog"
            ServerName robin.org.cn
            ServerAlias www.robin.org.cn blog.robin.org.cn
            AddType text/html .php
           
            #对于80端口开启RUL重定向
            RewriteEngine on
            RewriteCond   %{HTTPS} !=on
            RewriteRule   ^(.*)  https://%{SERVER_NAME}$1 [L,R]
    
            <Directory "/appvol/wordpress_blog">
                     Options FollowSymLinks
                     AllowOverride All
                     Require all granted
            </Directory>
    </VirtualHost>
    
    <VirtualHost *:443>
            DocumentRoot "/appvol/wordpress_blog"
            ServerName robin.org.cn
            ServerAlias www.robin.org.cn blog.robin.org.cn
            AddType text/html .php
            <Directory "/appvol/wordpress_blog">
                     Options FollowSymLinks
                     AllowOverride All
                     Require all granted
            </Directory>
    </VirtualHost>
    
    如果您喜欢我,可以通过微信请我喝果汁。

    如果有疑问,可以留言或者发邮件给我 lhh_nj@163.com
  • 相关阅读:
    python ascii codec can't decode
    python文件编码说明 coding=utf-8
    windbg的使用
    在后台运行Python脚本服务
    ubuntu下更改分辨率
    【转】VC调试的时候 “没有调试信息,未加载符号”
    常用正则表达式——中文匹配、拉丁匹配
    SQL的经典操作——批量复制同行的其它列数据到其它列数据
    关于C++对汉字拼音的处理(3)
    关于环境变量设置是否需要重启的问题
  • 原文地址:https://www.cnblogs.com/lihuanhuan/p/10612107.html
Copyright © 2011-2022 走看看