一个阿里云apache服务器配置两个或多个域名forLinux
一个阿里云apache服务器配置两个或多个域名for Linux:
默认已经配置好了阿里云提供的一键web安装,可以参考:http://www.42iot.com/?id=8
修改/alidata/server/httpd/conf/vhosts下的文件phpwind.conf
打开phpwind.conf命令:vi phpwind.conf
在后面添加红色标记部分(以jiajiao2.kechengliu.com为例,目录为/alidata/www/jiajiao)
<DirectoryMatch "/alidata/www/phpwind/(attachment|html|data)">
<Files ~ ".php">
Order allow,deny
Deny from all
</Files>
</DirectoryMatch> <VirtualHost *:80>
DocumentRoot /alidata/www/phpwind
ServerName localhost
ServerAlias localhost
<Directory "/alidata/www/phpwind">
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)-htm-(.*)$ .php?
RewriteRule ^(.*)/simple/([a-z0-9\_]+\.html)$ /simple/index.php?
</IfModule>
ErrorLog "/alidata/log/httpd/phpwind-error.log"
CustomLog "/alidata/log/httpd/phpwind.log" common
</VirtualHost> <font color="#ff0000"><VirtualHost *:80>
DocumentRoot /alidata/www/jiajiao
ServerName jiajiao2.kechengliu.com
ServerAlias jiajiao2.kechengliu.com
<Directory "/alidata/www/jiajiao">
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)-htm-(.*)$ .php?
RewriteRule ^(.*)/simple/([a-z0-9\_]+\.html)$ /simple/index.php?
</IfModule>
ErrorLog "/alidata/log/httpd/jiajiao-error.log"
CustomLog "/alidata/log/httpd/jiajiao.log" common
</VirtualHost></font>
3.输入命令:/alidata/server/httpd/bin/apachectl restart 重启apache测试。
4.测试网站。请在浏览器中输入域名,测试设置。
域名1:www.kechengliu.com默认是localhost,访问的是/alidata/www/phpwind下的文件
域名2:jiajiao2.kechengliu.com访问的是/alidata/www/jiajiao下的文件
注:转载请注明出处https://bbs.aliyun.com/read/237396.html
一个阿里云apache服务器配置两个或多个域名forLinux的更多相关文章
- 阿里云ECS服务器配置ubuntu安装openfire服务器
最近搞了一台阿里云的ECS服务器,因为搞活动半年免费,所以就申请了一台,过两天就批准下来,顺便多花了1百多RMB买了固定IP.总体说来还是挺值的,觉得一个人用挺浪费,分享出来跟大家一起玩玩. 搞台服务 ...
- 五:用JAVA写一个阿里云VPC Open API调用程序
用JAVA写一个阿里云VPC Open API调用程序 摘要:用JAVA拼出来Open API的URL 引言 VPC提供了丰富的API接口,让网络工程是可以通过API调用的方式管理网络资源.用程序和软 ...
- 从拥有一个阿里云账号开始使用Maxcompute
本教程并不会创建子账户来管理maxcompute,是直接使用主账号来对maxcompute进行管理(强烈不推荐在生产环境中这样做!!) Step1:创建阿里云账号并实名认证 创建一个阿里云账号(使 ...
- 阿里云LINUX服务器配置HTTPS(NGINX)
本文首发于:http://www.fengzheng.pub/archives/238.html 背景说明 服务器为阿里云 ECS,操作系统为 CentOS 6.5. 部署配置说明 第一步,安装ngi ...
- (mac)阿里云ECS服务器配置过程
-----首先本人是半只脚入门的iOS开发者,弄这个只是单纯想多学点东西. -----阿里云服务器的配置选择:既然是学习用的,最最基础的配置就行了.1M带宽,1核1G...这就不详述了.没啥可选的,( ...
- 从0开始搭建一个阿里云java部署环境
一.购买服务器 https://www.aliyun.com/daily-act/ecs/activity_selection?spm=5176.8112568.738194.8.674c9ed53Y ...
- 【NodeJs】记录一个阿里云redis的坑
背景 一个风和日丽的下午,一个上线的大好日子,以为一切准备好,上个线也就三五分钟的事.但是... 图样图森破. 背景是这样的,项目需要,在阿里云开通redis,在项目中配好redis的连接字符串后,以 ...
- Navicate 连接阿里云MySQL(两种方式及原理讲解)
Navicate 连接阿里云(两种方式及原理讲解) 一.直连方式(通过3306端口) 1.概述 2. 环境准备 3.操作及讲解 二.使用SSH通道 1.概述 2.环境准备 3.操作及讲解 如果对你有帮 ...
- 阿里云ECS服务器配置(Ubuntu+JAVA+Tomcat+Mysql)
最近购买了阿里云的ECS服务器,就服务器的安装配置做简要的说明,也方便日后查看. 1.远程操作服务器 远程操作服务器可以使用putty工具,下载地址:http://pan.baidu.com/s/1q ...
随机推荐
- DOM-document 对象
Document 对象Document 对象代表整个HTML 文档,可用来访问页面中的所有元素.Document 对象是 Window 对象的一个部分,可通过 window.document 属性来访 ...
- 【leetcode】1160. Find Words That Can Be Formed by Characters
题目如下: You are given an array of strings words and a string chars. A string is good if it can be form ...
- 3D世界变换
一直弄不清3D场景中scaleOrientation的作用,还有scale.orientation(roation).translation的顺序问题,以往都是试图查一下,关于前者网上几乎找不到什么清 ...
- spring中试用junit4测试
一:加入jar包 <!-- 单元测试 --> <dependency> <groupId>junit</groupId> <artifactId& ...
- JDK5的新特性
本篇博客内容 一.自动装箱和自动拆箱 二.泛型 三.增强for循环 四.静态导入 五.可变参数 六.枚举 一.自动装箱和自动拆箱 <=返回目录 java有8种基本数据类型 byte.shor ...
- MongoDB可视化工具的安装
MongoDBCompass MongoDB Compass是一款优秀可靠的mongodb可视化数据库管理软件.可以更加方便地与mongodb数据库进行交互,支持对数据库进行查询.分析或者查看数据库的 ...
- HDU 2602 Bone Collector (01背包问题)
原题代号:HDU 2602 原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602 原题描述: Problem Description Many yea ...
- Linux一些最基础操作
最后更新时间: 2015-05-06 这是一篇很早之前写的,整理笔记的时候看到了,Linux 非常基础操作. bin/sbin: 一般是存放可以执行文件 绝对路径 相对路径 mkdir dir ls: ...
- SQL 多表查询的几种连接方式
--创建数据库 create database GoodsSystem go --使用数据库 use GoodsSystem go --创建商品类型表 create table GoodsType ( ...
- Beyond Compare4 激活
当你使用过一段时间后会提示有问题,需要激活或者什么. 解决办法: 找到这个路径并删除其下Beyond Compare 4文件夹即可正常使用. C:\Users\******\AppData\Roami ...