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

How to support php after virtual host is configured with apache

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

Share

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

This article shows you how to support php after the virtual host is configured with apache. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

The premise of configuring an Apache virtual host is that a PHP runtime environment has been correctly configured on the computer as a server, so the Apache virtual host can be configured only after there is a PHP environment.

When configuring the PHP runtime environment, if it is used as a server, then it is necessary to configure a virtual host for Apache. In the configuration of the virtual host, the domain name can be docked with the specified project, and the corresponding project content can be accessed by entering the specified domain name in the web page. Configuring the virtual host of Apache is a must to create a PHP server.

The configuration of Apache virtual space is performed in the httpd.conf file of Apache. The specific steps are as follows:

(1) navigate to the Apache2\ conf\ httpd.conf file, and add the following to this file:

ServerAdmin any@any.comDocumentRoot "E:\ wamp\ www\ mingribook" ServerName www.mingribook.comErrorLog "logs/phpchina1.com-error.log" CustomLog "logs/phpchina1.com-access.log" common

Line 1, define the label of the virtual server and specify the port number.

Line 2, specify an email address, which can be specified at will.

Line 3 defines the specific path of the project to be accessed in the Apache server.

Line 4 specifies the access name of the server, that is, the domain name bound to the project.

Lines 5 and 6 define the location where log files are stored in Apache.

Line 7, define the closing tag of the virtual server.

The above 7 lines of code complete the configuration of a virtual server. If there are multiple domain names and multiple projects under the Apache server need to be bound, then by analogy, you can bind different project files for each domain name by binding different project files for each domain name, that is, modify the values specified by DocumentRoot and ServerName.

(2) after completing the configuration of the web space, you need to save the httpd.conf file and restart the Apache server.

If a virtual host is configured in the Apache server, other projects can no longer be accessed directly through the path in the Apache server, but must be accessed using the server name specified in the virtual host.

The above content is how to support php after the virtual host is configured with apache. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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