Apache多站点配置及启动失败解决办法
一、 Apache多站点配置方法
1、打开Apache安装目录下conf/httpd.conf文件,找到下面两行文字,把最前面的 # 号去掉,然后保存。
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#Include conf/extra/httpd-vhosts.conf
2、接着找到同一文件中的DocumentRoot和Directory,改为站点目录的上一级目录
例如站点放在 C:/XAMPP/Appserv/Web/htdocs/,则改为以下形式
A、DocumentRoot "C:/XAMPP/Appserv/Web";
B、<Directory "C:/XAMPP/Appserv/Web">;
后续各个应用可部署在此目录下。
3、上述配置完成后即可打开Apache安装目录下/conf/extra/httpd-vhosts.conf文件,在最后添加如下:
<VirtualHost *:3333>
DocumentRoot "C:/xampp/Appserv/Webhtdocs"
ServerName localhost:3333
ErrorLog "logs/localhost3333-error.log"
</VirtualHost>
<VirtualHost *:3334>
DocumentRoot "C:/xampp/Appserv/Webmall"
ServerName localhost:3334
ErrorLog "logs/Slocalhost3334-error.log"
</VirtualHost>
至此,多站点配置工作完毕。
我在配置完后,由于上述第3步的配置有问题,导致Apache服务无法启动,在Apache的Log及Windows的日志内都无法找到具体的具体的错误信息提示。
以下是我用Xampp启动Apache时的错误:
8:42:47 [main] Initializing Control Panel
8:42:47 [main] Windows Version: Windows 7 Professional 32-bit
8:42:47 [main] XAMPP Version: 1.8.3
8:42:47 [main] Control Panel Version: 3.2.1 [ Compiled: May 7th 2013 ]
8:42:47 [main] You are not running with administrator rights! This will work for
8:42:47 [main] most application stuff but whenever you do something with services
8:42:47 [main] there will be a security dialogue or things will break! So think
8:42:47 [main] about running this application with administrator rights!
8:42:47 [main] XAMPP Installation Directory: "c:\xampp\"
8:42:47 [main] Checking for prerequisites
8:42:47 [main] All prerequisites found
8:42:47 [main] Initializing Modules
8:42:47 [main] Starting Check-Timer
8:42:47 [main] Control Panel Ready
8:43:06 [Apache] Attempting to start Apache app...
8:43:06 [Apache] Status change detected: running
8:43:07 [Apache] Status change detected: stopped
8:43:07 [Apache] Error: Apache shutdown unexpectedly.
8:43:07 [Apache] This may be due to a blocked port, missing dependencies,
8:43:07 [Apache] improper privileges, a crash, or a shutdown by another method.
8:43:07 [Apache] Press the Logs button to view error logs and check
8:43:07 [Apache] the Windows Event Viewer for more clues
8:43:07 [Apache] If you need more help, copy and post this
8:43:07 [Apache] entire log window on the forums
上述错误,在度娘提供的帮助中,大都是说端口被占用,其实并不准确,最简单的办法,就是直接在CMD命令框内执行httpd.exe,此时命令框会提示具体的出错原因:

按上述提示直接解决。
Apache多站点配置及启动失败解决办法的更多相关文章
- APMServ5.2.6win10系统Apache、MySQL5.1启动失败解决办法
今天想在本地测试网站源码能否正常运行,如果可以就转空间了,然而下载了APMServ之后发现系统Apache.MySQL5.1启动均失败,小白的人表示只能借助百度,用了一个小时的时间终于解决了,虽然坎坷 ...
- xampp搭建开源项目iwebshop后,服务器重启后再启动xampp显示组件都启动ok,但是实际启动失败解决办法
最近用xampp搭建了开源商城项目iwebshop,刚搭建完没问题,可是周一来因为服务器重启了,我再启动xampp,显示组件都启动ok了,但是用linux命令查看相关组件的进程时,发现实际没启动起来, ...
- MySQL启动失败解决办法
本人大二,进了一家培训机构学了两年,然后跟着他们做项目,其实也是练习,然后过程中遇到好多错误,当时解决了,然后下次遇到又忘了,-_-! -_-||| 我就想通过写博客来记载一下我遇到的错误和解决的办 ...
- Cassandra3在Centos7下启动失败解决办法
Centos7 安装Cassandra启动过程提示失败,查看结果如下所示: [root@xx ~]# systemctl status cassandra ● cassandra.service - ...
- [即时通讯]openfire启动失败解决办法
当你发现你的电脑上的openfire无论你是重新安装还是重启都无法启动的情况下你可以按照我下面写的那些终端指令来启动你的openfire不用再去重新做你的系统了. 一般你发现你的openfire打开出 ...
- maven配置环境变量失败解决办法
配置maven路径什么的统统正确,最后测hi不成功.在网上搜索了好多资料方法都解不了 具体问题具体对待吧,如果有和我类似的小伙伴,可以尝试一下我的这个办法,在maven路径后面加/bin path变量 ...
- ipv6禁用导致rpcbind服务启动失败解决办法
参考文档:http://blog.51cto.com/hld1992/2055028
- Docker安装、命令详情、层级架构、docker服务启动失败解决方法
容器背景: 层级架构: 容器对比传统化虚拟机: 可以把docker理解成是一款自带软件(比如:nignx.tomcat.....)的镜像操作系统(首先是要下载镜像) 以下是Windows环境安装Do ...
- apache多站点配置
apache多站点配置 临时需要个测试站,然后就到apache中配置vhosts,结果这货总是显示"拒绝了你的请求",找半天发现居然还要添加端口监听 vhosts.conf 添加v ...
随机推荐
- 使用ROW_NUMBER()+临时表+While 实现表遍历
declare @table table(dlid int,RowNum int)insert into @table select dlid,ROW_NUMBER() over(order by d ...
- MySql: 常见sql语句
1. show create table mysql> show create table t \G*************************** 1. row ************ ...
- VO对象和PO对象的区别
VO,值对象(Value Object),PO,持久对象(Persisent Object),它们是由一组属性和属性的get和set方法组成.从结构上看,它们并没有什么不同的地方.但从其意义和本质上来 ...
- Windows HTTP Services
原文:https://msdn.microsoft.com/zh-cn/library/windows/desktop/aa384273(v=vs.85).aspx Purpose (目的) Micr ...
- 如何下架app
因赶数日工期成,偷得浮生半日闲.遂登录iTunes Connect,发现之前做过的小程序,想将其下架,故而有此篇随想.(温馨提示:项目被下架后再次上架该版本,不需要再次经过审核)下面是详情步骤: 1. ...
- express框架
一.express的使用 安装express 在根目录下输入 npm install express 引入express的包 const express = require("express ...
- ios获取设备信息总结
1.获取设备的信息 UIDevice *device = [[UIDevice alloc] int]; NSString *name = device.name; //获取设备所有者的名 ...
- json_decode返回NULL
最近在调用某公司的API时,将对方返回的数据,使用PHP的json_decode函数解析,但是返回NULL,最终排查为对方传送来的json格式有误 打印$_REQUEST,数据结构大致如下: arra ...
- JS中获得当前时间的年月
//获取完整的日期 var date=new Date; var year=date.getFullYear(); var month=date.getMonth()+1; month =(month ...
- Dapper入门学习
今天了解并学习了下Dapper的用法,这里简单介绍下 1.安装Nuget Dapper Package包 2.代码 using (IDbConnection connection = new SqlC ...