Apache的ServerAlias的作用
今天在php的集成环境laragon上添加了一个虚拟主机,域名为:whathell.com
突然想在前面加个www.
一种做法是在auto.whathell.com文件中添加如下内容:
<VirtualHost *:8090>
DocumentRoot "C:/mysoft/laragon/www/whathell/"
ServerName www.whathell.com
ServerAlias *.whathell.com
<Directory "C:/mysoft/laragon/www/whathell/">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
虽然可以实现,但又对ServerAlias不解,百度一下发现这个指令是当前虚拟主机的别名,遂
<VirtualHost *:8090>
DocumentRoot "C:/mysoft/laragon/www/whathell/"
ServerName whathell.com
ServerAlias *.whathell.com www.whathell.com
<Directory "C:/mysoft/laragon/www/whathell/">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
重启apache,发现还是启动不了,遂在网上找到一段话:
Many servers want to be accessible by more than one name. This is possible with the ServerAlias directive, placed inside the <VirtualHost> section. For example in the first <VirtualHost>block above, the ServerAlias directive indicates that the listed names are other names which people can use to see that same web site:
ServerAlias domain.tld *.domain.tld
then requests for all hosts in the domain.tld domain will be served by the www.domain.tld virtual host. The wildcard characters * and ? can be used to match names. Of course, you can't just make up names and place them in ServerName or ServerAlias. You must first have your DNS server properly configured to map those names to an IP address associated with your server.
说domain.tld不能直接访问到网站,需要DNS配置该别名的映射到当前IP,由于是在本地,遂在host文件加上www.whathell.com,然后进浏览器访问,成功了。
Apache的ServerAlias的作用的更多相关文章
- php和apache的关系和作用()
出处:http://blog.csdn.net/hongweideng/article/details/41723465 php和apache的关系和作用是很多学习php的朋友非常关注的问题 首先在一 ...
- apache的.htaccess文件作用和相关配置
首先.htaccess什么? .htaccess是一个纯文本文件,它里面存放着Apache服务器配置相关的指令. 当我们使用apache部署一个网站代码准备部署到网上的时候,我们手中的apache的h ...
- apache 中 ServerAlias让多个域名绑定到同一空间
在apache的虚拟主机中,如果书写了.ServerAlias www.a2.com www.a3.com这样的语句,就可以给虚拟主机增加多个域名,而且这些域名都访问同一个站点. #Listen 81 ...
- Apache服务器安装配置
Apache服务器安装 1.Apache服务器安装 在Linux系统下,apache服务器的安装方式比较灵活,可以使用二进制包安装,比如:rpm包.deb包.已编译好的包.也可以简单的使用y ...
- 对象池化技术 org.apache.commons.pool
恰当地使用对象池化技术,可以有效地减少对象生成和初始化时的消耗,提高系统的运行效率.Jakarta Commons Pool组件提供了一整套用于实现对象池化的框架,以及若干种各具特色的对象池实现,可以 ...
- Apache HTTP Server 与 Apache Tomcat 的区别
要明白他们之间的区别,我们首先需要明白HTTP协议.HTML页面.JSP.Servlet之间的区别和联系. HTTP协议是在TCP/IP协议之上的应用层协议,用以在客户端和服务器之间传递信息.一般传递 ...
- Linux(centOS)手动安装删除Apache+MySQL+PHP+Memcached原创无错版
=================== 第一步:Apache安装 =================== 下载 去 http://www.apache.org 自己找最新的 国内有很多镜像点例如人人和 ...
- 在windows上用apache+mod_wsgi服务部署django项目
之前一直在本地跑django项目,最近尝试在服务器上部署项目,目前已经成功部署,也花了好多时间,这里跟大家交流一下,希望对像我一样的新手有帮助. 一.配置环境: 1.Python版本3.7 2.服务器 ...
- Apache ZooKeeper在Kafka中的角色 - 监控和配置
1.目标 今天,我们将看到Zookeeper在Kafka中的角色.本文包含Kafka中需要ZooKeeper的原因.我们可以说,ZooKeeper是Apache Kafka不可分割的一部分.在了解Zo ...
随机推荐
- 【证明】【一题多解】布尔不等式(union bound)的证明
布尔不等式(Boole's inequality)也叫(union bound),即并集的上界,描述的是至少一个事件发生的概率(P(⋃iAi)" role="presentatio ...
- JVM学习一:JVM运行时数据区
注:此图适合JDK 7之前的版本,JDK 8开始增加了元数据空间,内存区结构有所变化(JDK 7将字符串常量池移除了永久代,JDK 8去永久代,迎元数据空间metaspace) 1.程序计数器:程序计 ...
- ros 使用笔记
1. publishers/subscribers 常用指令 说明rosnode list 查看所有激活的节点rostopic list 查看所有激活的topicrostopic i ...
- 【EMV L2】Processing Restrictions
目的: 处理限制(Processing Restrictions)的目的是确定终端中的应用程序与ICC中的应用程序的兼容程度,并进行任何必要的调整,包括可能拒绝交易. 执行条件: 终端应该都要执行Pr ...
- JavaScript中为什么使用立即执行函数来封装模块?
最近在学习JavaScript基础,在学习到面向对象编程时,学习到在JavaScript中实现模块化的方法,其中一个重要的点是如何封装私有变量. 实现封装私有变量的方法主要是: 使用构造函数 func ...
- git 恢复本地误删文件
git status git reset HEAD 路径(git status 会显示的路径) git checkout 路径
- Spring事务<tx:annotation-driven/>的理解(Controller使用@Transactional)
在使用Spring的时候,配置文件中我们经常看到 annotation-driven 这样的注解,其含义就是支持注解,一般根据前缀 tx.mvc 等也能很直白的理解出来分别的作用. <tx:an ...
- Linux下tomcat运行时jvm内存分配
tomcat运行时jvm内存分配 ⑴开发环境下在myeclipse中配置-Xms256m -Xmx512m -XX:NewSize=64m -XX:MaxNewSize=128m -XX:PermSi ...
- 1130-Host '192.168.0.105' is not allowed to connect to this MySQL server的解决方案
在CentOS 7服务器(192.168.0.118)上安装mysql5.7.17后,在本地(192.168.0.105)通过Navicat连接服务器上的MySQL报错,报错如图所示: Paste_I ...
- 算法题:给出一组数字,拼接一个最大的值 PHP
举例如下:'9235','42','9','5','8','32','136','343','45' 则拼接的最大的数为 : 9-9235-8-5-45-42-343-32-136 网上坑多,想了很久 ...