


Detailed introduction to WAMP common environment configuration example code 9 (picture)
WAMP common environment configuration
Foreword: WAMP often requires customized configuration when using it. Here are some common configurations.
Customize the website directory
Modify the directory location
As shown below, open the httpd.conf file.
Find DocumentRoot (two places) and make the following modifications:
#demo为自定义网站目录,下面不再说明DocumentRoot "f:/demo"<Directory "F:/demo">
Restart the configuration service.
Test: Open the browser and enter localhost/test.php (test.php is a newly created test file in the demo directory)
Modify the interface display
Modify the wamp installation directory The wampmanager.ini file under:
[Menu.Left]...... Type: item; Caption: "www 目录"; Action: shellexecute; FileName: "F:/wamp/www"; Glyph: 2替换为: Type: item; Caption: "demo 目录"; Action: shellexecute; FileName: "F:/demo"; Glyph: 2......
Then modify the wampmanager.tpl file under the wamp installation directory:
[Menu.Left]...... Type: item; Caption: "${w_wwwDirectory}"; Action: shellexecute; FileName: "${wwwDir}"; Glyph: 2替换为: Type: item; Caption: "${demo 目录}"; Action: shellexecute; FileName: "${F:/demo}"; Glyph: 2......
Restart the configuration service.
Multi-site configuration
Open the bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf file in the wamp installation directory. (Virtual DirectoryConfiguration File)
Add the following code:
//添加站点,test01和test02目录下放置网站文件<VirtualHost *:80> ServerAdmin webmaster@dummy-host2.example.com //邮箱地址,可不写 DocumentRoot "f:/demo/test01" //网站文件目录 ServerName test01.com //主机名 ErrorLog "logs/dummy-host2.example.com-error.log" //错误日志,可不写 CustomLog "logs/dummy-host2.example.com-access.log" common //日常日志,可不写</VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@dummy-host2.example.com //邮箱地址,可不写 DocumentRoot "f:/demo/test02" //网站文件目录 ServerName test02.com //主机名 ErrorLog "logs/dummy-host2.example.com-error.log" //错误日志,可不写 CustomLog "logs/dummy-host2.example.com-access.log" common //日常日志,可不写</VirtualHost>
As above, open the httpd.conf file again and make the following modifications:
# Virtual hosts#Include conf/extra/httpd-vhosts.conf替换为# Virtual hostsInclude conf/extra/httpd-vhosts.conf
//有些版本没有,则不用修改Deny from all Allow from 127.0.0.1替换为: Allow from all#Allow from 127.0.0.1
Restart the service
Open C:\Windows\System32\drivers\etc\hosts and add:
//添加站点127.0.0.1 test01.com127.0.0.1 test02.com
Test: Open the browser and enter test01.com and test02.com. (Test files need to be written in these two directories in advance)
Custom port number
apache defaults to port 80. If it is occupied, the port number needs to be modified.
As above, open the httpd.conf file and make the following modifications:
Listen 80替换为:Listen 8080(或改成其它未被占用端口号)
ServerName localhost:80替换为:ServerName localhost:8080(与上面修改的端口号要一致)
Restart the service.
Test: localhost:8080/test.php (the test file created earlier is in the demo directory).
The above is the detailed content of Detailed introduction to WAMP common environment configuration example code 9 (picture). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Win11 system is the latest Windows operating system, and users may encounter some configuration problems when using it. Among them, configuring Python environment variables is a common requirement because it allows users to easily use Python commands from any location. This article will introduce how to configure Python environment variables in Win11 system so that users can use the Python programming language more conveniently. 1. [Right-click] this computer on the desktop, and select [Properties] in the menu item that opens; 2. Then, under related links, find and click [Advanced System Settings]; 3. In the system properties window, click [Environment] at the bottom Variables]; 4. In the environment variables window, under system variables, select [Path], and then click

Go language is a statically typed, compiled programming language developed by Google. It has a unique position among modern programming languages and is widely used in cloud computing, network programming, big data and other fields. As the Go language becomes more and more popular, more and more programmers are beginning to learn the Go language, hoping to master the features and application skills of this language. However, for learners with zero foundation, the environment configuration of Go language often becomes the first obstacle to their learning. Before learning the Go language, we first need to build a suitable

This article involves two PHP integrated environments, both of which contain mysql + apache + php. The function of phpstudy is more powerful than wamp, and it is very simple and easy to use.

As an open source programming language, Go language is favored by more and more developers. Its simplicity, efficiency and cross-platform nature have been widely praised. Before learning and using the Go language, you first need to configure the environment in order to carry out development work smoothly. This article will provide you with a comprehensive Go language environment configuration guide and teach you step by step how to set up a development environment so that you can easily get started with Go language development. 1. Install Go language First, we need to download and install the latest version of Go language. You can find it on the Go official website

PyCharm is an integrated development environment (IDE) commonly used by many Python developers. It provides a wealth of functions and tools to facilitate developers to write, debug and test Python code efficiently. Before using PyCharm for development, an important step is to configure the PyCharm environment. This article will provide Python developers with a PyCharm environment configuration guide, including installing PyCharm, configuring the Python interpreter, setting up a virtual environment, etc. It will also come with tools.

With the rapid development of the Internet, developers' tasks have also become diverse and complex. Especially for PHP language developers, one of the most common problems faced during the development process is the error of data inconsistency between the development environment and the production environment. Therefore, how to handle these errors is an important issue that developers must face when developing PHP applications. The difference between development environment and production environment The first thing to make clear is that development environment and production environment are different, and they have different settings and configurations. in development environment

Maven environment configuration tutorial: Quick start configuration steps Maven is a powerful project management tool that can help developers automatically build projects, manage dependencies, execute tests, etc. When learning and using Java development, configuring the Maven environment is an essential skill. This article will introduce you to how to quickly configure the Maven environment, including a series of steps such as installing Maven, configuring environment variables, creating projects, etc., and provide specific code examples to help you better understand. Step 1: Download and install Mave

Mac computers are the favorite working platform of many developers, and Golang, as an efficient programming language, is also loved by more and more people. This article will introduce in detail how to configure and install the Golang development environment on a Mac computer, and provide specific code examples to help readers quickly get started and develop using Golang. Step 1: Download the Golang installation package. First, we need to download the Golang installation package from the official Golang website (https://golang.org/dl/).
