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 install apache

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

Share

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

This article mainly introduces how to install apache, which can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

Download Apache HTTP Server server from 1.apache official website

I believe that when some friends first use the apache server, they all want to download it from the official website, but they may be a little at a loss in the face of many projects, images and directories on the official website. Here are the specific steps:

①, open the apache official website http://httpd.apache.org/ (or Baidu "download apache").

②, click Download, and the following interface appears.

③, select Windows version to download, and click on the link.

④, in the new interface, you will find the words VC9 and VC11. By reading the relevant content, we know that VC9 refers to the code compiled with VS2008, while VC11 is compiled with VS2012, while those compiled with VS2012 cannot be used in Windows XP and Server 2003. For the sake of compatibility, I chose to compile Apache with VC9, choose to download here, and the download process is complete!

Installation of 2.Apache server

After downloading the Apache server, decompress it.

1. Download the installation package

two。 Extract the file to the directory you want to place, and here I choose to put it in the D:\ Apache-2.4.20 directory.

Note: Apache24 name can be changed according to your own situation, I will change it to "Apache", as follows:

Configuration of 3.Apache server

Open the httpd.conf file (for example, under D:\ Apache-2.4.20\ Apache\ conf)

① modifies the actual absolute installation directory of Apache: you cannot have "/" or "\" at the end, because the later configured directory already begins with "/" or "\", as shown in the following figure (where "${SRVROOT}" refers to the defined SRVROOT path variable):

(it can be "/" or "\").

If your port 80 is occupied (you can use the command netstat-an-o | findstr 80 under cmd), change port 80 to something else.

Check whether the configuration file is legal: httpd-t

② installs the main service of Apache: only with it can Apache start. You can add the httpd.exe environment variable, then open the cmd window and enter:

Httpd-k install-n Apache

This command means to install an Apache service that can be hosted by Windows, where the parameter after "- n" is a custom Windows service name, and then you can use the command of the Windows management service to manage the apache service, such as "net start/stop apache" (start / stop service).

After the service is installed and completed, it will be tested automatically. If there is any problem, the window will indicate an error. Please troubleshoot according to the error at this time.

The normal installation is shown in the following figure:

Among them, Errors reported here must be corrected before the service can be started. The errors reported here must be corrected before the service starts. "

Startup of 4.Apache server

After configuring the Apache server, we can start the server. There are three ways to start the Apache server under Windows.

1. Start with Windows

Open computer management, find the apache service item, select, right-click, you can select the appropriate action (start, stop, restart)

two。 Start using the command line

Httpd-k start: no detailed error messages are prompted.

Httpd-k start-n apache: will prompt a detailed error message, in which the "apache" is changed to your Apache service name, which can be found in the computer service.

Httpd-k restart-n apachet: restart.

Net start apache: leverages the Windows managed service command.

3. Open it using the Apache server's own window

Find the ApacheMonitor.exe in the bin directory and open it

Double-click to run, an icon will appear in the lower right corner of the desktop. Double-click to open the window interface, and you will see as shown in the figure:

Click start on the left to start the apache service.

As can be seen from this interface, it can manually control the opening and closing of the service. In order to save resources, when shutting down the Apache server, please click "Stop" to close the apache service. Of course, this service can also be turned off in the windows system service (it is recommended to set it manually).

The following figure shows the status of the successful display of the service:

Open the browser and enter to access http://localhost. If the interface shown in the following figure appears, the basic configuration of the Apache server is complete, and the apache server is ready to run.

Uninstall the 5.Apache service

If you do not want to use the Apache server software, if you want to uninstall it, be sure to uninstall the apache service and then delete the installation files (remember, if you delete the folder of the installation path directly, there will be residual files on the computer, which may cause unnecessary trouble). In the cmd command window, enter the following (it is recommended to stop the service before deleting):

Httpd-k uninstall or sc delete apache (apache is the service name of the Apache server).

At this point, the download, installation, startup, and uninstallation of the Apache server are all over.

Note: the purpose of each file under the Apache server is shown in the following figure:

Thank you for reading this article carefully. I hope it will be helpful for everyone to share how to install apache. At the same time, I also hope you can support us, pay attention to the industry information channel, and find out if you have any problems. Detailed solutions are waiting for you to learn!

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