Get the App
SLTechnology News&Howtos  ›  Servers  › 

Configuration method of Apache Multi-Port and Multi-site

Shulou Source: shulou.com Published: 2022-06-01 11:07:09 11月14日 Update

This article introduces the relevant knowledge of "the configuration method of Apache multi-port and multi-site". In the operation of the actual case, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Apache multi-port multi-site configuration method, the configuration of apache server friends can refer to. Configure httpd.conf

Listen to multiple ports

The copy code is as follows:

# Listen: Allows you to bind Apache to specific IP addresses and/or

# ports, instead of the default. See also the

# directive.

#

# Change this to Listen on specific IP addresses as shown below to

# prevent Apache from glomming onto all bound IP addresses.

#

# Listen 12.34.56.78:80

Listen 8081

Listen 8082

Listen 8083

# add listening ports

After the following contents are set, you can check whether the port is open through netstat-n-a.

Open a virtual site

The copy code is as follows:

# Virtual hosts

# Include conf/extra/httpd-vhosts.conf

# modified to

# Virtual hosts

Include conf/extra/httpd-vhosts.conf

Configure the PHP module

Load php module. Php5apache2_2 indicates that you are using apache2.2 or above

LoadModule php5_module "c:/php/php5apache2_2.dll"

PHPIniDir "C:/php"

Configure php file type mapping

AddType application/x-httpd-php .php

Configure conf/extra/httpd-vhosts.conf

The copy code is as follows:

ServerAdmin webmaster@dummy-host. http://www.bbqmw.net/qm_bbqmbd/localhost

DocumentRoot "C:/PhpDocRoot/Site1"

ServerName localhost

ServerAlias localhost

ErrorLog "logs/dummy-host.localhost-error.log"

CustomLog "logs/dummy-host.localhost-access.log" common

Options Indexes FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

ServerAdmin webmaster@dummy-host2.localhost

DocumentRoot "C:/PhpDocRoot/Site2"

ServerName localhost

ErrorLog "logs/dummy-host2.localhost-error.log"

CustomLog "logs/dummy-host2.localhost-access.log" common

Options Indexes FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

...

It must be necessary.

Try restarting apache, and if something goes wrong, check the log file under logs and the error log recorded by windows's event Viewer.

This is the end of the content of "Apache multi-port and multi-site configuration method". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Configuration port code site method content file more module knowledge monitoring utility learning next event representative can pass dilemma multiple actual Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Apple NVidia Shulou Technology Xiaomi