Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Configuration method of Apache Multi-Port and Multi-site

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report