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>
APACHE 配置虚拟主机和HTTPS的更多相关文章
- 【转】Apache 配置虚拟主机三种方式
Apache 配置虚拟主机三种方式 原文博客http://www.cnblogs.com/hi-bazinga/archive/2012/04/23/2466605.html 一.基于IP 1. 假 ...
- apache配置虚拟主机后,启动速度慢
apache配置虚拟主机后,启动速度慢且提示“the requested operation has failed” 可以通过在cmd下启动,来查找问题(命令中的“apache2.2”,是服务名,根据 ...
- apache配置虚拟主机的三种方式
Apache 配置虚拟主机三种方式 一.基于IP 1. 假设服务器有个IP地址为192.168.1.10,使用ifconfig在同一个网络接口eth0上绑定3个IP: [root@localhos ...
- lamp apache配置虚拟主机
You don't have permission to access /index.php on this server
- Apache配置虚拟主机后让其他电脑访问
关于Apache配置虚拟主机后在局域网中让其他电脑访问 #test1# NameVirtualHost *:80 ServerName www.t1.com Document ...
- [Linux]Apache配置虚拟主机
Apache 配置虚拟主机的方式很多,种类也很多,主要分为两类: 基于名称的虚拟主机 (每个 IP 多个站点) 基于 IP 的虚拟主机 (每个 IP 一个站点) 基于名称的虚拟主机: www.2 ...
- windows环境利用apache 配置虚拟主机
windows环境利用apache 配置虚拟主机 1.改动http.host #LoadModule vhost_alias_module modules/mod_vhost_alias.so #In ...
- apache配置虚拟主机
步骤如下: 1.在配置文件httpd.conf中启用httpd-vhosts.conf 找到# Virtual hosts将Include conf/extra/httpd-vhosts.conf前的 ...
- Apache配置虚拟主机后,不能访问localhost的问题
今天想试用一下php7,但是发现php7只支持Apache2.4版本,而我电脑上的Apache是2.2版本,为了想尝鲜,就必须去下载新的Apache2.4 php7和apache2.4安装整合以后,l ...
随机推荐
- poj 3104 晾衣服问题 最大化最小值
题意:n件衣服各含有ai水分,自然干一分钟一个单位,放烘干机一分钟k个单位,问:最短时间? 思路: mid为最短时间 如果 a[i]-mid>0说明需要放入烘干机去烘干 烘干的时间为x 那么满 ...
- hdu 1257最少拦截系统
最少拦截系统 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的 ...
- springMVC中接收数组参数
方式一. 后台:public ResultBean queryItemRulesByItemIds(int userId, int[] itemIds) 方式二.
- mysql插入、修改、删除
联合查询: union:合并.联合,将多次查询结果合并成一个结果 语法: 查询语句1: union[all] 查询语句2: union [all] ... 意义 1.将一条比较复杂的查询语句可拆分成多 ...
- OpenResty入门
写一个小例子--输出随机字符串 编写nginx配置文件 location /random { content_by_lua_file /usr/local/openresty/nginx/conf/l ...
- importlib模块和split的结合使用
1.给定一个文件结构,在main.py中于运用importlib 导入a.py运行其中的show()方法 ├── clazz │ ├── __init__.py │ ├── a.py │ └── b. ...
- linux自动执行指令crontab和at
目录 1 at和crontab指令 2 batch 一.at与crontab的区别 运行方式不同 at只运行一次,crontab循环运行 依赖的服务不同 at 对应的服务是 atd crontab 对 ...
- 使用jsp读取TXT格式文件
<%@page import="java.io.BufferedReader"%> <%@page import="java.io.FileReader ...
- BZOJ 4070 [Apio2015]雅加达的摩天楼 ——分块 SPFA
挺有趣的分块的题目. 直接暴力建边SPFA貌似是$O(nm)$的. 然后考虑分块,$\sqrt n$一下用虚拟节点辅助连边, 以上的直接暴力连边即可. 然后卡卡时间,卡卡空间. 终于在UOJ上T掉辣. ...
- 简单解决 ATL:CString WTL:CString 冲突
//stdafx.h #include <atlbase.h> #include <atlstr.h> #include <atlapp.h> extern CAp ...