[Switch] Apache server download and installation (2) Apache server download and installation

The operation of PHP must be supported by a server. What is a server? In layman's terms, a computer is installed with server software, and the computer can be called a server. The server software and the computer's own operating system are two different things. The computer's own operating system can be linux, Unix, Windows or MacOS. At the same time, the service software can also be Apache (PHP), Tomcat (java/jsp), IIS (asp).

   PHP mainly uses the Apache server, the mainstream site building combination is LAMP (Linux, Apache, MySQL, PHP), and the integrated server software under Windows is WAMP (Windows, Apache, MySQL, PHP). In addition, there are some other PHP server software, such as Germany's lighttpd, Russia's nginx.

   In my study, I mainly use the Apache server, so here I mainly describe the download and installation of the Apache service.

   (1) Apache official website to download Apache HTTP Server server

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

   ①Open apache official website http://www.apache.org/    

   ②Click Download in the upper right corner, the following interface will appear, here are the mirror servers, just find one, here is the recommended version. 

   ③The directory list appears. These are the project lists of apache. I don't understand why apahce browses in this way. It's ugly. 

   ④Click "httpd", the following interface will appear  

   ⑤ Click the red box, the following interface will appear 

   ⑥After entering the following interface, select the first item ApacheHaus, which is a third-party download platform. Downloading an independent Apache from its website will be a compressed package. Of the other four, the second is also a standalone Apache download address, and the other three are integrated development environments. The first one I chose.   

   ⑦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, and the compiled code with VS2012 cannot be used in Windows XP and Server 2003. used in. For the sake of better compatibility, I chose 32-bit Apache compiled with VC9, choose to download here, and the download process is complete!  

   (2) Installation of Apache server

   After the Apache server download is complete, unzip it.

   1. Download the installation package

   

   2. Unzip the file to the directory you want to put it in, here I choose to put it in the D:\Apache-2.4.20 directory. 

   

   Note: The name of Apache24 can be changed according to your own situation. I changed it to "Apache", as follows:

   

   (3) Apache server configuration

   Open the httpd.conf file (under D:\Apache-2.4.20\Apache\conf, this is mine, if the location is different, the file location will be different)

   ①Modify the directory location, as shown in the following figure:

   

   If your port 80 is occupied (you can view it with the command netstat -a under cmd), then change port 80 to something else and save it.

   

   ② Configure and install the main service of Apache, with it, Apache can be started. Open a cmd window and enter: "D:\Apache-2.4.20\Apache\bin\httpd.exe" -k install -n apache, remember to include quotation marks. The command means, install the apache service, and name the service apache (you can also change it to something else), press Enter.

   After the service is installed, it will be automatically tested. If there is any problem, the window will prompt an error. At this time, please check according to the error.

   The normal installation is completed as shown in the following figure:

   

   Among them, Errors reported here must be corrected before the service can be started. If not, it succeeds.

   (四)Apache服务器的启动

   配置好Apache服务器之后,我们便能启动服务器,Windows下Apache服务器的启动方式有三种。

   1.利用Windows启动

   打开计算机管理,找到apache服务项,选择后,右键单击,便可选择相应操作(启动、停止、重新启动) 

   2.利用命令行启动

   不知道为什么我用命令行启动不了,截图如下:

   

   3.利用Apache服务器自身的视窗打开

   找到bin目录下的ApacheMonitor.exe,打开

   

   双击运行,桌面右下角会出现图标,双击打开窗口界面,会看到如图所示:

   

   点击左侧start,启动apache服务。

   补充句,从该界面可看出,其可以手动控制服务的开启与关闭,为了节省资源,关闭Apache服务器的时候,请先点击“Stop”关闭apache服务。当然,该服务也可以windows系统服务中关闭(建议设置成手动)。

   下图显示的是该服务成功显示的状态:

   

   打开浏览器,输入访问http://localhost,若出现如下图所示界面,则Apache服务器的基本配置完毕,此时apache服务器已经可以运行,更具体的配置,需要使用者自行去参悟了。   

   (五)apache服务的卸载

   若Apache服务器软件不想用了,想要卸载,需要先卸载apache服务(切记,若直接删除安装路径的文件夹,会有残余文件在电脑,可能会造成不必要的麻烦),在cmd命令窗口,输入如下(建议先停止服务再删除):sc delete apache(apache是Apache服务器的服务名)。

   

   注意:apache服务的卸载,我没试过,不知道可行否?只是好不容易才弄好Apache服务器,不想再折腾了。

   到此为止,Apache服务器的下载、安装、启动和卸载全部结束。

   :关于Apache服务器下的各个文件的用途,如下图所示:

   

   参考:

   1.(二)Apache服务器的下载与安装

   2.apache官网怎样下载apache HTTP Server服务器

   3.Apache服务器最新版下载、安装及配置(win版),作者:idea_wj。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326074504&siteId=291194637