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. 自定义Web框架与jinja2模板

    web应用与web框架 web应用 对于所有的Web应用,本质上其实就是一个socket服务端,用户的浏览器其实就是一个socket客户端 import socket def handle_reque ...

  2. SpringBoot中使用mybatis-generator自动生产

    步骤: 1.在pom.xml中添加插件配置 <plugin> <groupId>org.mybatis.generator</groupId> <artifa ...

  3. C#中配置文件保存的路径

    http://www.codeproject.com/Tips/350010/Saving-User-Settings-in-Winform-Application 外网上找的资料 winform提供 ...

  4. mini Linux制作过程(25/01)

    Mini Linux: 启动流程: 参考:https://blog.csdn.net/gatieme/article/details/50914250 https://linux.cn/article ...

  5. BZOJ 1009: [HNOI2008]GT考试(kmp+dp+矩阵优化)

    http://www.lydsy.com/JudgeOnline/problem.php?id=1009 题意: 思路:真的是好题啊! 对于这种题目,很有可能就是dp,$f[i][j]$表示分析到第 ...

  6. 【转载】非Lumia 950/XL机型 强行开启continuum教程

    听说Windows 10 Mobile 的 Continuum 特性很长时间了,但是由于我自己的 Lumia 930 不在支持之列,一直没能体验到这个功能.今天在酷七看到了这篇文章,按文章所述的步骤进 ...

  7. C#修饰符说明

    方法不加访问修饰符默认的是 private 类不加访问修饰答默认的是 internal //////////////////////////////////////////////////////// ...

  8. 基于MySQl的分页显示

    <%@page import="java.sql.DriverManager"%> <%@page import="java.sql.ResultSet ...

  9. go 通道

    1. package main import "fmt" func sum(s []int, c chan int) { sum := for _, v := range s { ...

  10. JPA、SpringData JPA 、Hibernate和Mybatis 的区别和联系

    一.JPA 概述 1. Java Persistence API(Java 持久层 API):用于对象持久化的 API 2. 作用:使得应用程序以统一的方式访问持久层 3. 前言中提到了 Hibern ...