apache手动安装

1、下载apache对应的版本,解压到本地盘符

2、修改Apache24\conf\httpd.conf 配置文件

//修改web服务的安装路径

Define SRVROOT "c:/wapm/Apache24"
ServerRoot "${SRVROOT}"

//配置服务监听端口

Listen 80

//关联php模块

LoadModule php5_module "C:/wapm/php/php5apache2_4.dll"
AddType application/x-httpd-php .php
PHPIniDir "c:/wapm/php"

//支持 ssl

LoadFile "C:/wapm/php/ssleay32.dll"
LoadFile "C:/wapm/php/libeay32.dll"

//server name

ServerName 127.0.0.1:80

//禁止目录浏览

<Directory />
AllowOverride none
Options FollowSymLinks
Require all granted
</Directory>

//修改默认页配置

<IfModule dir_module>
DirectoryIndex index.html index.php index.htm
</IfModule>

//日志等级  错误日志输出文件

ErrorLog "logs/error.log"

LogLevel error

# Virtual hosts 虚拟 主机 设置多域名访问
Include conf/extra/httpd-vhosts.conf

# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

//ssl配置

# Secure (SSL/TLS) connections
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
#Include conf/extra/httpd-ssl.conf
Include conf/extra/httpd-ahssl.conf
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
<IfModule http2_module>
ProtocolsHonorOrder On
Protocols h2 h2c http/1.1
</IfModule>

3、安装apache服务

    a:打开cmd,命令行定位到apache下bin文件夹 :   cd:\apache24\bin

   b:httpd -k install  -n apache24(服务的名称)

4、删除 apache服务

   a:打开cmd,命令行定位到apache下bin文件夹 :   cd:\apache24\bin

   b:输入 sc delete apache24(服务的名称)     或  httpd-k uninstall -n "服务名"

5、ApacheMonitor.exe

  在安装目录中,找到D:\PHPServer\Apache24\bin\ApacheMonitor.exe可执行文件,双击运行,桌面右下角会出现图标,双击打开窗口界面

6、启动一个已经安装的Apache服务:

     httpd-k start

7、要停止一个已经安装的Apache服务:

    httpd-k stop   或     httpd-kshutdown

8、要重启一个运行中的Apache服务:
    httpd-k restart

posted @ 2018-12-08 16:01  雪豹666  阅读(441)  评论(0编辑  收藏  举报