• Welcome to Auciou's Blog! Subscibe
  • HomeAbout AuciouArchivesContactSite MapLinks

  • Create the development environment of Apache

    Auciou posted on October 09, 2009 at 00:25

    As the preceding approach, http://www.auciou.com/peace/78 (Reinstall Apache and PHP for one step), after create the development environment of Apache, while reinstall the system, you may reinstall Apache and PHP for just one step. The essential of create the development environment is revising the apache\conf\httpd.conf file, this file needs to be backuped, set for one time, hereafter need not to set it repeatedly. Here I'll briefly introduce the approach that change the port, create the virtual hosting, change the main directory of default local sites.

    Take the article before, for instance, all the same, the system is Win XP, create the folder D:\server:
    Apache extracts at D:\server\apache;
    PHP 5 extracts at D:\server\php5.

    All of the settings below, we will change the file D:\server\apache\conf\httpd.conf, please open this file by a text tool.

    1. Change the port. If you depend on PHP development, I suggest that do not change the port, the default port is 80. If you need to change the port, for instance, I change the port to 60. Find "Listen 80", change to Listen 60, restart Apache. Then you may use http://localhost:60 to visit the main directory.

    2. Create the virtual hosting. For instance, my site's long-distance address is http://www.auciou.com, in order to simulate the effect of long-distance, as well I can make my local computer as a server. In order to avoid that the accidental mess of operations of local and long-distance happens, we may use a sub domain to simulate, the sub domain of 3 characters is the best, as ww2.auciou.com, or wwa.auciou.com. (Commentary: this sub domain, just revise the local file "hosts", do not need to add on the domain management.)

      The approach of creating a virtual hosting: write the codes as below at any position in the httpd.conf file:

      <VirtualHost *:80>
      ServerName ww2.auciou.com
      DocumentRoot F:/site/auciou
      </VirtualHost>

      Commentary: the third line DocumentRoot F:/site/auciou, is the path of my blog in the local harddisk. Then open this file C:\WINDOWS\system32\drivers\etc\hosts, write a line as below:

      127.0.0.1 ww2.auciou.com

      The virtual hosting have been set up, restart Apache, then you may use http://ww2.auciou.com to visit the local sites. To set for many virtual hostings, are the same steps. (In addition, if you use IIS for a few, you may use the Port 80 for Apache and PHP, IIS uses the Port 50 or others.)

    3. Change the main directory of default local sites, that's to say that revise the corresponding directory of http://localhost.
      Find ServerRoot c:/www
      Change to ServerRoot F:/site

      At last, restart Apache.

    1 Comment:
    1   Auciou October 09, 2009 at 04:16
    Trackback From Reinstall Apache and PHP for one step

    Configure the file D:\server\apache\conf\httpd.conf first, then install Apache. Such as change the port, create the virtual hosting, change the main directory of local site, all of them are written the correlative codes in the httpd.conf configuration file, in order to understand more easily for you, I omit this step.

    Post a comment:
    Name: (* Required)
    URL:
    Code: q48u58e68s78t88 (* Required)

    Comments:

        Remember? Yes No

    Post a trackback directly

  • Auciou: Programmer

    Peaceful Seabed | My column

    Category:
    Program | Internet | Computer
    Blog Research | PHP | Philosophy


    TDNote | Gratitude | Matnue | Aucist | Aroat | Aufirm | IXNes | Anydiary | Cersta | Coumit | Tovate | Aroat | Aucist | Matnue | Sinvide | Serble | Auciou's column | Peaceful Seabed | Webshu | Sail every day | Sail every day

    Archives:
    January 2011 | January 2010
    December 2009 | October 2009 | September 2009 | April 2009
    December 2008 | November 2008
    May 2007 | April 2007
    August 2005 | July 2005 | June 2005
    May 2005 | April 2005 | March 2005
    February 2005 | January 2005

    Recent articles:
    My Go Daddy hosting is fast
    Create a house with your spouse on the interest
    Pending time which add a domain of hosting, was more than 36 hours
    Diary: 2010-01-15
    Many Linux hostings do not support the mod_expires module
    Figured out, there is still a way
    About the delicated IP of IXWebHosting
    About the QUERY_STRING parameter of URL
    About the ping value and speed of site
    The relation between program and .htaccess file
    Saved a delicated IP
    Judge that does a long-range file exist in PHP
    How to call the Confederation of Planets and the high evolving beings of alien/pray/make a wish
    Use Apache as the local virtual hosting to preview the Blog
    Create the development environment of Apache
    Reinstall Apache and PHP for one step
    The elements of program of preventing the spam and closing IP
    How to close the visit log of ixwebhosting
    Happy Wedding to a friend
    Make an easy Audio/Video converter


  • Copyright © 2007-2025 auciou.com All rights reserved.
    Programmed by Auciou.