apache service目录设置

设置Apache HTTP Server的文件根目录(DocumentRoot)
安装Apache 时,系统会给定一个缺省的文件根目录
如果你觉得这个网页存在这个缺省目录不方便,需要另外设个Apache 文件根目录
你可以修改Apache的配置文件httpd.conf里有关根目录的设置。 Apache HTTP Server的缺省文件根目录(DocumentRoot)是:
DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs" 修改Apache 文件根目录(DocumentRoot)的操作如下:
1> 为了避免修改失误,请先备份你的Apach配置文件httpd.conf,该配置文件的路径是
2> 打开http.conf文件找到DocumentRoot为开头的那一行,将
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
改成新的 DocumentRoot 路径,比如你新的路径为 C:\htdocs,就改成
DocumentRoot "C:/htdocs"
3> 然后找到httpd.conf 文件中的如下内容:
# This should be changed to whatever you set DocumentRoot to.
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
将 Diectory 中的路径改成你新设的文件根目录,比如:
<Directory "C:/htdocs">
4>保存配置文件httpd.conf ,重启Apache Service

apache server 修改端口

 找到Listener 80 (--->修改为自己的端口即可)

常见的错误

 当修改Apache的配置后,重启启动往往会出现the requested operation has failed报错问题,初学Apache搭建,遇到了这种问题很是困扰。
原因一:Apache服务器端口冲突
解决方法一:打开cmd命令行,用”netstat -aon | findstr “80”“命令查看端口占用程序的PID,然后再用”tasklist | findstr “PID”“查看被哪个进程占用了。然后kill掉此进程。
解决方法二:更改Apache的端口号。在httpd.conf文件中,找到”Listen 80”属性,将80改为其他未被占用的端口。
原因二:更改Apache服务器默认存储的文件路径
Apache服务器的核心配置文件是httpd.conf,默认路径为“Apache安装路径\conf\”,打开该文件,定为到DocumentRoot。
该路径用于指定网络路径,存放主页配置的目录,如:DocumentRoot “D:/Webpage”,句末不能加“/”。
同时定位到Directory行,此处为服务器的虚拟路径,要与DocumentRoot配置相同,如:<”Directory “D:/Webpage”>
原因三:httpd.conf配置错误
如果apache的配置文件httpd.conf错误,可以使用命令行启动apache,并带上参数,apache会提示哪句有误,然后可以针对性的解决问题。
解决方法:打开cmd,到apache安装路径\bin下,执行“httpd.exe -w -n “Apache2.2” -k start”,其中Apache2.2位安装Apache服务器的目录名。

apache-service的使用的更多相关文章

  1. Apache service named reported the following error(OS 10055)由于系统缓冲区空间不足或队列已满解决办法?

    apache启动失败报错: The Apache service named reported the following error:>>> AH00451: no listeni ...

  2. 安装新版xampp后apache无法启动提示:Apache Service detected with wrong path解决方案

    我以前安装过xampp,因为学习thingPHP需要升级PHP5.0以上,所以我就卸掉了xampp,从新安装新版本的xampp其中PHP是最新版的,但是安装后启动xampp提示如下:Apache Se ...

  3. windows apache 配置多个服务 站点 Apache Service Monitor

    把Apache安装为多个Window NT服务 ~~~ 可以在 services.msc中查看到1. 在DOS下跳到Apache安装目录里的bin目录(~~~或者用path命令 把apache的安装目 ...

  4. Apache, service httpd stop, Address already in use:

    service httpd stopStopping httpd:                                            [FAILED][root@testtest ...

  5. PHP环境配置-从Apache官网下载windows版apache服务器

    由于个人有强迫倾向,下载软件都喜欢从官网下载,摸索了好久终于摸清楚怎么从Apache官网下载windows安装版的Apache服务器了,现在分享给大家. 进入apache服务器官网http://htt ...

  6. 将Apache手动安装成Windows的服务

    将Apache手动安装成Windows的服务 可以选择在安装Apache时自动将其安装为一个服务.如果选择"for all users",那么Apache将会被安装为服务. 如果选 ...

  7. Apache不重新编译,利用apxs工具给Apache添加模块,如cgi模块

    想实践下Apache是如何运行cgi程序的,却发现先前编译安装Apache的时候,没有安装Apache的cgi模块. 附:CentOS6.x编译安装LAMP(2):编译安装 Apache2.2.25 ...

  8. Loadrunner监控Apache

    一.安装Apache yum -y install httpd 二.配置Apache 1.设置开机启动 chkconfig httpd on 2.开启Apache service httpd star ...

  9. debian 安装svn apache 小记. AuthzSVNAccessFile 不生效问题.

    docker 使用docker镜像搭建svn+Apache环境 https://my.oschina.net/u/2006667/blog/637882 1,安装 apache ,svnapt-get ...

  10. linux centos service 参数详解

    Service文件 开门见山,直接来看两个实际的服务配置文件吧. 第一个配置是 CoreOS 系统中 Docker 服务的 Unit 文件,路径是 /usr/lib/systemd/system/do ...

随机推荐

  1. 20145225唐振远《网络对抗》Exp4 恶意代码分析

    20145225唐振远<网络对抗>Exp4 恶意代码分析 基础问题回答 如果在工作中怀疑一台主机上有恶意代码,但只是猜想,所有想监控下系统一天天的到底在干些什么.请设计下你想监控的操作有哪 ...

  2. CodeForces 471D MUH and Cube Walls -KMP

    Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of ...

  3. Duilib 实现开关按钮

    转载:http://blog.csdn.net/wuan584974722/article/details/25045737 我们在做MFC程序时候经常会一个切换式的按钮,之前我的做法是利用butti ...

  4. Python3基础 __doc__ 单行与多行函数文档

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  5. UVA 11806 Cheerleaders (容斥原理

    1.题意描述 本题大致意思是讲:给定一个广场,把它分为M行N列的正方形小框.现在给定有K个拉拉队员,每一个拉拉队员需要站在小框内进行表演.但是表演过程中有如下要求: (1)每一个小框只能站立一个拉拉队 ...

  6. linq——group by

    多列排序&&聚合函数 var result = from i in                (from uh in db.UserHistories                ...

  7. NRF24L01 射频收发 使用方法

    在干啥 这两天在调nrf24l01,最终还是参考正点原子的例程才调通,看芯片手册太难了 还要说啥废话 废话说到这,接下来上代码 SPI协议 spi.c #include "spi.h&quo ...

  8. Java中的正则表达式Pattern与Matcher

    一般来说比起功能有限的String类,我们更愿意构造功能强大的正则表达式.我们可以通过Pattern 与 Matcher 来构建功能强大的正则表达式 import java.io.File; impo ...

  9. Cocos2d-x学习笔记(六)Label字体控制

    BMFont使用链接--->>  http://blog.csdn.net/qiurisuixiang/article/details/8984288 这里要注意.fnt文件可通过BMFo ...

  10. python 元组列表合并

    #create a tuple l = [(,), (,), (,)] print(list(zip(*l)))