2012年6月20日 星期三

1. Install the Apache 2.2.X

Install the Apache 2.2.X
=====================================================================

A) from Official ASF build from http://httpd.apache.org/
---------------------------------------------------------------------

(v2.2.22 tested)

STEP1:  download and execute apache_2.2.x-win32-x86-no_ssl.msi most

        with default setting

STEP1:  must be 'I accept the terms...', click 'Next'

STEP2:  in Server Information,

        enter your 'Network Domain' & 'Server Name' and you don't

        have one just enter 'localhost'

        NOTE:   you can still edit lines below in the

                [Apache-folder]\conf\httpd.conf

                after installed...

                        Listen 80

                        ServerAdmin admin@example.com

                        ServerName www.example.com:80

        enter a email address

        pick 'for All Users, on Port 80, as a Service', click 'Next'



STEP3:  when ask  setup type, pick 'Typical', click 'Next' button

STEP4:  when ask dest folder, recommend change to C:\Apache2.2 just

        for easy accessing, click 'Next' and install


To test if worked
----------------------------------------------------------------------

STEP5:  open url http://127.0.0.1 or http://localhost in web browser

        to see if httpd work





B) from Apache Lounge Build from http://www.apachelounge.com/
---------------------------------------------------------------------

(v2.2.22 tested)

STEP1:  must first install (not needed for Win7) the Visual C++ 2010

        SP1 Redist Package

        http://www.microsoft.com/download/en/details.aspx?id=8328

STEP2:  download and unzip (it has a Apache2 folder inside)

        httpd-2.2.x-win32-x86-ssl.zip

        to C:\ so you see C:\Apache2\bin...

STEP3:  edit the [Apache-folder]\conf\httpd.conf

        1. if you change the root folder name from C:\Apache2, please

            edit all 'C:/Apache2' inside to meet the right folder

           NOTE: Please use slash '/' as folder dividing

        2. you need to replace all 'www.example.com' with your own

           server name

           NOTE: if you don't has one and want to run just in local

                 computer, then replace with 'localhost'

        3. edit ServerAdmin for the right email address

        4. you may need to edit below lines

                Listen 80

                ServerName www.example.com:80

           for port 80 conflicted/reassigned

STEP3:  from C:\Apache2\bin,

        A) run directly in a DOS box

        >httpd.exe

        B) or install httpd as a service

        >httpd.exe -k install

STEP4:  run Apache Monitor (use when httpd as a service)

        double click ApacheMonitor.exe, or put it in your startup

        folder

        pick in task bar to see if httpd service started or you can

        stop/restart it


To test if worked
---------------------------------------------------------------------

STEP5:  open url http://127.0.0.1 or http://localhost in web browser

        to see if httpd work









FAQ
=====================================================================

Q: Windows could not start the Apache2 on local computer

   Errors reported: "httpd.exe could not reliably determine the

   server's fully qualified domain name..."

A1: ServerName automatic determiation has failed...

  check the 'ServerName' setting in the

  [Apache-folder]\conf\httpd.conf

  if it has a comment mark it means to determind the domain name

  automatically seems it don't succeed, just remove the comment mark

  and assign a right one

                #ServerName www.example.com:80
                -->
                ServerName www.example.com:80

                if you don't has one and want to run just in local

                computer then change to

                ServerName localhost:80

A2: Port 80 conflicted...

   There is some other program listening on port 80, usual suspects

   are Skype, NOD32, TeamViewer,...Some others

   Way to correct it is either shutting down the program that's using

   the port 80 or configure it to use a different port. Finally you

   still can configure the Apache to listen on a different port.

   1) Way to diagnose which app, if any, has bound to port 80 is run

   the netstat with those options

   >netstat -a -p tcp

   look for :80 next to the local IP address (second column)

   and find the PID (last column). Then, on the task manager you can

   find which process has the PID you got in the previous step. (You

   might need to add the PID column on the task manager)

   2) To reconfigure the port for httpd.exe please edit the

   httpd.conf as follows

        Listen 8080

        ServerName www.example.com:8080

        or in local computer

        ServerName localhost:8080

   restart the Apache server after changing the port number

沒有留言:

張貼留言