SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: subdomain

  1. #1
    SitePoint Zealot beeXtreem's Avatar
    Join Date
    Jan 2006
    Location
    Nigeria
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    subdomain

    Please, I'd like to know how to configure my wamp to run using a custom domain name rather than localhost, and to create subdomains on it too. Please how do I do this?
    JC Rocks!!

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Addict
    Join Date
    Apr 2007
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its pretty easy actually...

    Step 1
    =====

    Open hosts file in c:\windows\system32\drivers\etc using notepad and add the following lines...

    127.0.0.1 test.com
    127.0.0.1 site1.test.com

    Step2
    ====

    Open httpd.conf located in C:\Program Files\wamp\bin\apache\Apache2.2.11\conf. Change the line that says...

    #Include conf/extra/httpd-vhosts.conf

    to

    Include conf/extra/httpd-vhosts.conf

    Step 3
    =====

    Open httpd-vhosts located in C:\Program Files\wamp\bin\apache\Apache2.2.11\conf\extra and add the following to the end of the file

    <VirtualHost *:80>
    DocumentRoot "D:/projects/test"
    ServerName test.com
    </VirtualHost>

    <VirtualHost *:80>
    DocumentRoot "D:/projects/site1"
    ServerName site1.test.com
    </VirtualHost>

    Where DocumentRoot is path to your files and ServerName is the name of the server as setup in hosts file and you are all set. Let me know if you run in to any problems.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2009
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It works easily I made sub.localhost but the
    localhost
    doesn't longer work only
    sub.localhost
    works , how can we have both ?

  5. #5
    SitePoint Addict
    Join Date
    Apr 2007
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Adding another entry corresponding to localhost as below will solve the problem...

    <VirtualHost *:80>
    DocumentRoot "D:/projects"
    ServerName localhost
    </VirtualHost>

    Quote Originally Posted by php_lover View Post
    It works easily I made sub.localhost but the
    localhost
    doesn't longer work only
    sub.localhost
    works , how can we have both ?

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2009
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It actually works well , thanks for sharing .

  7. #7
    SitePoint Zealot beeXtreem's Avatar
    Join Date
    Jan 2006
    Location
    Nigeria
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a million
    JC Rocks!!

  8. #8
    SitePoint Addict
    Join Date
    Apr 2007
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are welcome


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •