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

Add ports on apache

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

How to set up a new port in Apache

Environment:

Windows server 2008 R2, Apache, PHP5

Steps:

Create a directory and put an index.php in it.

Open the Apache\ conf\ httpd.conf file and make the following changes:

#

# Options FollowSymLinks

# AllowOverride None

# Order deny,allow

# Deny from all

#

The reason for commenting out the above code is that there is a Deny from all setting in it. If it is not commented out, there will be a 403 Forbidden error when accessing the site on the port.

Listening port

S

Open comments for the following two items:

LoadModule vhost_alias_module modules/mod_vhost_alias.so

Include conf/extra/httpd-vhosts.conf

Comment out the following

Open the conf/extra/httpd-vhosts.conf file and add the following code at the end of the file:

ServerAdmin aa@hotmail.com

DocumentRoot "C:/develop"

ServerName localhost

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

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

Restart Apache

Visit the site and you can see the content.

Note:

When you do your own test program, you don't have to establish a port. You can do it in the following three ways:

Multi-site:

NameVirtualHost *: 80

ServerName www.a.com

DocumentRoot www/one

ServerName www.b.com

DocumentRoot www/two

Multiple virtual directories:

Alias / test "E:\ www"

AllowOverride All

Options Indexes FollowSymLinks Includes

Order allow,deny

Allow from all

Multi-port

ServerName www.c.com

DocumentRoot www/newport

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