Table of Contents
WAMP common environment configuration
Customize the website directory
Modify the directory location
Modify the interface display
Multi-site configuration
Custom port number
Home Backend Development PHP Tutorial Detailed introduction to WAMP common environment configuration example code 9 (picture)

Detailed introduction to WAMP common environment configuration example code 9 (picture)

Mar 14, 2017 pm 04:29 PM


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.
Detailed introduction to WAMP common environment configuration example code 9 (picture)

Find DocumentRoot (two places) and make the following modifications:

#demo为自定义网站目录,下面不再说明DocumentRoot "f:/demo"<Directory "F:/demo">
Copy after login

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......
Copy after login

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......
Copy after login

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>
Copy after login

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
Copy after login
//有些版本没有,则不用修改Deny from all
Allow from 127.0.0.1替换为:
Allow from all#Allow from 127.0.0.1
Copy after login

Restart the service

Open C:\Windows\System32\drivers\etc\hosts and add:

//添加站点127.0.0.1 test01.com127.0.0.1 test02.com
Copy after login

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(或改成其它未被占用端口号)
Copy after login
ServerName localhost:80替换为:ServerName localhost:8080(与上面修改的端口号要一致)
Copy after login

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!

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
3 weeks 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 configure python environment variables in Win11? Tips for adding environment variables in win11python How to configure python environment variables in Win11? Tips for adding environment variables in win11python Feb 29, 2024 pm 04:30 PM

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

Learning Go language from scratch: environment configuration is no longer an obstacle Learning Go language from scratch: environment configuration is no longer an obstacle Feb 21, 2024 pm 02:12 PM

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

Teach you to create a virtual host and run php projects (phpstudy + wamp) Teach you to create a virtual host and run php projects (phpstudy + wamp) Aug 07, 2022 pm 03:17 PM

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.

The Complete Guide to Go Locale Setup: A Walkthrough Guide to Creating a Development Environment The Complete Guide to Go Locale Setup: A Walkthrough Guide to Creating a Development Environment Feb 18, 2024 pm 10:26 PM

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

A must-read for Python developers: PyCharm environment configuration guide A must-read for Python developers: PyCharm environment configuration guide Feb 23, 2024 pm 01:57 PM

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.

How to deal with data inconsistency errors between the development environment and the production environment in PHP language development? How to deal with data inconsistency errors between the development environment and the production environment in PHP language development? Jun 10, 2023 am 10:31 AM

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 environment configuration tutorial: quick start configuration steps Feb 21, 2024 pm 07:57 PM

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

Steps to set up and install Golang development environment on Mac computer Steps to set up and install Golang development environment on Mac computer Feb 24, 2024 pm 04:30 PM

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/).

See all articles