SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2007
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    One WAMP Two Sites: How?

    Hello there.

    I'm doing my experimenting in WAMP, which of course contains the site that I am working on in a folder called WWW.

    If I want to start putting together a second site, how do I do that? Make another folder called WWW2 ? Will whatever functions that WAMP has to operate on the website files be able to find them in WWW2?

    Or do I rename the first site's folder WWW1 and make a new folder for WWW? And progressively have a series of WWWx folders for a series of websites, from which I rename off the number to activate one or the other?

    I could try it but I'm afraid of blowing up 500 pages that I've worked on for years.

    Thank you kindly.

    Pseu

  2. #2
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by Mr pseudonym View Post
    Hello there.

    I'm doing my experimenting in WAMP, which of course contains the site that I am working on in a folder called WWW.

    If I want to start putting together a second site, how do I do that? Make another folder called WWW2 ? Will whatever functions that WAMP has to operate on the website files be able to find them in WWW2?

    Or do I rename the first site's folder WWW1 and make a new folder for WWW? And progressively have a series of WWWx folders for a series of websites, from which I rename off the number to activate one or the other?

    I could try it but I'm afraid of blowing up 500 pages that I've worked on for years.

    Thank you kindly.

    Pseu
    Hi Pseu,

    You typically create a new folder for each website under the www folder. Examples of two sites:

    www/abc/index.html
    www/def/index.html

    Above you have two site folders, abc and def. You could then structure folders inside abc and def:

    Code:
    // Site abc.com
    www/abc/
    --> css
    ------>style.css
    --> scripts
    ------>buttons.js
    ------>gallery.js
    index.html
    about.html
    
    // Site def.com
    www/def/
    --> css
    ------>style.css
    --> scripts
    ------>buttons.js
    ------>menu.js
    index.html
    services.html
    about.html
    You then need to ensure that Wamp is configured to use named hosts. If this is configured then you need to edit the httpd.cof to ensure that your virtualhosts include is active (is not commented out), like:
    Code:
    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf
    If the vhosts configuration files is enabled then navigate to and open it.

    You then create two virtual hosts like this:
    Code:
    <VirtualHost *:80>
        DocumentRoot /var/www/abc
        ServerName www.abc.com
        ServerAlias abc.com
    
        <Directory "/var/www/abc">
            allow from all
            Options -Indexes
        </Directory>
    </VirtualHost>
    
    <VirtualHost *:80>
        DocumentRoot /var/www/def
        ServerName www.def.com
        ServerAlias def.com
        <Directory "/var/www/def">
            allow from all
            Options -Indexes
        </Directory>
    </VirtualHost>
    Then you need to restart Wamp.

    Finally you need to alter your host file windows/system32/etc/hosts
    Code:
    127.0.0.1    abc.com
    127.0.0.1    def.com
    If you need to find out more, there are hundreds (if not thousands) of tutorials on creating multiple site under WAMP or setting virtual hosts. Google is you friend

    Steve
    Last edited by ServerStorm; Jan 30, 2013 at 22:17.
    ictus==""

  3. #3
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,630
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Here is a good link on how. http://cesaric.com/?p=255

  4. #4
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,095
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    I have mine setup like this http://christianvarga.com/blog/2012/05/vhosts-and-mamp/ very similar to what ServerStorm suggested.

  5. #5
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,630
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    I did not want to move all my websites into the www folder. So I create a virtual site like the above link shows. Basically you just point wamp at wherever your site currently lives. This way you don't have to move anything.

  6. #6
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,607
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    Yep!

    SS has just completed this with a very stubborn member in another thread but his information is spot on!

    As for the directory, using any directory on your computer (test server) became the standard with Apache 2.x (it HAD to be in the htdocs folder in Apache 1.x ... if I remember correctly). Personally, I keep all my virtual hosts (and other web-related files) on a separate partition (so I can keep it separated from other nonsense - easier to backup all my websites that way).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


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
  •