After talking about the configuration of php, today we will introduce the installation and configuration of apache. I believe that after finishing this lesson, PHP learners will basically be able to install and configure apache by themselves.
1. Apache installation
First download an apache installation package from the Internet. Here we take apache_2.2.6 as an example. Briefly introduce the installation and configuration of apache.
1. Run apache_2.2.6-win32-x86-no_ssl.msi
Network Domain Fill in: Your local domain name can be filled in 127.0.0.1
Server Name Fill in: Server name
Administrator's Email Address Fill in your email
Then click Next to proceed Installation will not be introduced here.
2. After installation, open the httpd.conf file in the conf directory under the installation directory, and add the following three lines at the end:
LoadModule php5_module "c:php/php5apahe2_2.dll"
AddType application/x-http-php. php
PHPIniDir "c:php"
This connects php and apache.
3. The service after apache is installed can be seen in "Start->Programs->Management Tools->Services".
2.apache configuration
1.apache configuration file description
Find httpd.conf in the conf folder of the installation directory. This is the main configuration file of apache.
# is a comment
listen 80 means the listening port is port 80
DocumentRoot “D:/Program Files/Apache Software Foundation/Apaeh2.2/htdocs” Website program root directory
DirectoryIndex index.html Website program default file name
2. Simple Configure apache
Change DocumentRoot "D:/Program Files/Apache Software Foundation/Apaeh2.2/htdocs" to DocumentRoot "e:/source", which means that the root directory of the website program is set to the source folder of the e drive
Also change
Then, turn on the virtual host - remove the ";" in front of "Include config/extra/http-vhosts.conf" Then, locate DirectoryIndex index.php index.html so that when www.a.com is entered, index will be executed first. php file
Finally add the virtual host, open httpd-vhosts.conf under extra in the configuration file directory, add
ServerAdmin webmaster@dummy-host2.127.0.0.1
DocumentRoot " e:/source/test"
ServerName www.test.com
ErrorLog "logs/dummy-host2.127.0.0.1-error.log"
CustomLog "logs/dummy-host2.127.0.0.1-access.log" common
3. Modify the host file
Find the C:WINDOWSsystem32driversetchosts file
Add a line 127.0.0.1 www.test.com
This will simply configure the apache environment. At this time, PHP learners need to go to e:/ Add a test folder under source and add a web page in it, and that's it.

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 English version
Recommended: Win version, supports code prompts!

Atom editor mac version download
The most popular open source editor