Home >Backend Development >PHP Tutorial >Use port mapping to allocate ports to each project in Apache to enable one port to access a website_PHP tutorial
The main function of port mapping is that the actual Internet can access the computer currently being mapped. First, we need to perform port mapping on the router. Common open ports are 80, 21, 3389, etc. 80 is the website Commonly used ports, 21 is a common port for FTP servers, and 3389 is a remote desktop connection port. The following will explain the specific method of port mapping in detail!
step1. Open httpd.conf and find the line Listen 80
Add
afterListen 8080
Listen 8001
Listen 8002
Listen 8003
That is to say, each project occupies one port, just like the software in the computer, each software occupies one port
step2. Find
Options FollowSymLinks
AllowOverride all
Order deny,allow
Deny from all
Satisfy all
Modify to the above content
step3. Add
at the endNameVirtualHost *:80
DocumentRoot "d:/wamp/www"
ServerName localhost
DocumentRoot "D:/wamp/www/RED4S_V3.0/svn/repos"
ServerName 127.0.0.1:8003
The above means: the project directory of port 8003 is D:/wamp/www/RED4S_V3.0/svn/repos
That is to say, if you want to add any project in the future, you only need to listen to a port first, and then add a