Table of Contents
修改和添加Apache的默认站点目录,apache默认站点目录
Home php教程 php手册 修改和添加Apache的默认站点目录,apache默认站点目录

修改和添加Apache的默认站点目录,apache默认站点目录

Jun 13, 2016 am 08:39 AM
apache

修改和添加Apache的默认站点目录,apache默认站点目录

一、修改Apache的默认站点目录

Apache HTTP Server安装好后,默认的站点目录位于其安装目录下的htdocs文件夹内,默认首页是该文件夹的index.html文件。比如,我的Apache是安装在C:/wamp/bin/apache/Apache2.2.21内,那么我的Apache的完整的默认站点目录地址就是C:/wamp/bin/apache/Apache2.2.21/htdocs/,默认首页就是C:/wamp/bin/apache/Apache2.2.21/htdocs/index.html。

很多时候,不管是学习、测试,还是想真正的搭建自己的站点,我们可能并不想把自己的网站放在Apache默认的站点目录下,这时,本节的知识将会帮助你解决这个问题。

修改方法:

1、到Apache的安装目录下找到conf文件夹,该文件夹内会httpd.conf这样一个文本文档,它是Apache的配置文件,负责指挥Apache的运行。

2、双击打开httpd.conf这个文本文档,按下键盘上的Ctrl+F组合键查找“DocumentRoot "”(带英文双引号",见图),查找出来之后(仅有一处),将字符串“DocumentRoot”后面双引号内的字符串修改为自己想要设定的网站目录。

如:默认为DocumentRoot "C:/wamp/bin/apache/Apache2.2.21/htdocs",现修改成DocumentRoot "D:/Apache" 

3、完成上述第2步之后,暂不要关闭httpd.conf文件,继续查找,查找“

如:默认为,现修改成

4、同时按下键盘上的Ctrl+S组合键保存上述修改,一定记得要停止(STOP)一次Apache服务然后再启动(START),使刚刚的修改生效。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to run the h5 project How to run the h5 project Apr 06, 2025 pm 12:21 PM

Running the H5 project requires the following steps: installing necessary tools such as web server, Node.js, development tools, etc. Build a development environment, create project folders, initialize projects, and write code. Start the development server and run the command using the command line. Preview the project in your browser and enter the development server URL. Publish projects, optimize code, deploy projects, and set up web server configuration.

How to export pdf with xml How to export pdf with xml Apr 03, 2025 am 06:45 AM

There are two ways to export XML to PDF: using XSLT and using XML data binding libraries. XSLT: Create an XSLT stylesheet, specify the PDF format to convert XML data using the XSLT processor. XML Data binding library: Import XML Data binding library Create PDF Document object loading XML data export PDF files. Which method is better for PDF files depends on the requirements. XSLT provides flexibility, while the data binding library is simple to implement; for simple conversions, the data binding library is better, and for complex conversions, XSLT is more suitable.

Apache Troubleshooting: Diagnosing & Resolving Common Errors Apache Troubleshooting: Diagnosing & Resolving Common Errors Apr 03, 2025 am 12:07 AM

Apache errors can be diagnosed and resolved by viewing log files. 1) View the error.log file, 2) Use the grep command to filter errors in specific domain names, 3) Clean the log files regularly and optimize the configuration, 4) Use monitoring tools to monitor and alert in real time. Through these steps, Apache errors can be effectively diagnosed and resolved.

How to generate pom.xml How to generate pom.xml Apr 03, 2025 am 06:00 AM

There are the following ways to generate a pom.xml file: Use Maven Archetype to provide predefined project templates to automatically generate pom.xml files for specific types of projects. Use the Maven Helper plugin to provide commands to generate pom.xml files. Create manually to customize the pom.xml file for the project.

How to set character encoding on the server side to solve Bootstrap Table garbled How to set character encoding on the server side to solve Bootstrap Table garbled Apr 07, 2025 pm 12:00 PM

To set character encoding on the server side to solve the garbled Bootstrap Table, you need to follow the following steps: check the server character encoding; edit the server configuration file; set the character encoding to UTF-8; save and restart the server; verify the encoding.

Cannot start mysql in xampp Cannot start mysql in xampp Apr 08, 2025 pm 03:15 PM

There are many reasons why XAMPP fails to start MySQL, including port conflicts, configuration file errors, insufficient system permissions, service dependency issues, and installation issues. The troubleshooting steps are as follows: 1) Check port conflicts; 2) Check configuration files; 3) Check system permissions; 4) Check service dependencies; 5) Reinstall MySQL. Follow these steps and you can find and resolve issues that cause MySQL startup to fail.

How to preview the Bootstrap page How to preview the Bootstrap page Apr 07, 2025 am 10:06 AM

The preview methods of Bootstrap pages are: open the HTML file directly in the browser; automatically refresh the browser using the Live Server plug-in; and build a local server to simulate an online environment.

How to use the go-stomp library to build a WebSocket server that supports STOMP in Go language? How to use the go-stomp library to build a WebSocket server that supports STOMP in Go language? Apr 02, 2025 am 09:33 AM

How to build a WebSocket server that supports STOMP in Go language? Supporting the STOMP protocol is a common requirement when developing WebSocket applications. STOMP (Simp...

See all articles