andy27367451 发表于 2017-1-6 10:12:06

64位系统安装配置Apache

  64位的系统想安装Apache,网上找没有安装文件,只有免安装解压缩文件,配置过程中遇到一些问题,顺便将网上的一些文章整理一下
  1.   首先下载64位Apache压缩包,见附件。
  2. 将压缩包解压。例如我存放在 D:/Java/httpd-2.2-x64。
  打开httpd.conf,修改相关路径
  ServerRoot "D:/Java/httpd-2.2-x64"
  DocumentRoot "D:/Java/httpd-2.2-x64/htdocs"
  <Directory "D:/Java/httpd-2.2-x64/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
  等等...
  
3. 以管理员身份运行 DOS Command(Runasadministrator),进入D:/Java/httpd-2.2-x64。
  
4. 执行 httpd -k install:
  D:\Java\httpd-2.2-x64\bin>httpd -k install
  Installing the Apache2.2 service
  The Apache2.2 service is successfully installed.
  Testing httpd.conf....
  Errors reported here must be corrected before theservicecanbestarted.
  httpd: Syntax error online35ofD:/Java/httpd-2.2-x64/conf/httpd.conf:
  ServerRootmust be a valid directory
  在执行 httpd -k install 的时候,显示上面那些信息表明已经安装成功。我安装时报了ServerRoot must be avaliddirectory,不用理会。自己手工编辑httpd.conf, 只要将ServerRoot指向正确的目录即可。
  这一步假如没有以管理员身份运行cmd,则会报错:(OS 5)拒绝访问。  : Failed to open the WinNT service manager
  
5. 执行 httpd -k start:
  D:\Java\httpd-2.2-x64\bin>httpd -k start
  D:\Java\httpd-2.2-x64\bin>
  
如果没有提示错误,则表明启动成功。
  如果报以下错误:
   (OS 10013)以一种访问权限不允许的方式做了一个访问套接字的尝试。  : make_sock: could not bind to address 0.0.0.0:80
  no listening sockets available, shutting down
Unable to open logs
  表明80端口被占用了,将httpd.conf里的Listen 80 改为其它端口,如81.
页: [1]
查看完整版本: 64位系统安装配置Apache