Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Web design "Lab" - How?

  • 16-08-2005 9:51pm
    #1
    Closed Accounts Posts: 975 ✭✭✭


    http://www.apachefriends.org/en/xampp-windows.html
    I've been looking at this as a testbed on my home network, so I can develop a website before making it live, The problem is I'll be developing a few sites at a time. Does anybody know a good solution to rotate sites on apache?

    A web server can only serve one site thru default port 80. How can I swap sites while developing multiple sites simultaneously?

    To be a little clearer, I want to be able to type in www.hamsterburgers.com on the development box on the local network and have the hosts.txt resolve this to the ip address on my local web server (192.168.yada.yada) . When I change projects to www.100usesforaciscorouter.com I'd like to be able to run a quick script on the server which would swap apache config files and have the server return the new website after a reboot or restarting the apache service.

    Does this make sense? Does my bum look big in this?


Comments

  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    Have a look at the documentation for the virtualhost directive in apache:

    http://httpd.apache.org/docs/2.0/vhosts/

    This allows you to set up multiple web sites in the one Apache installation. Apache uses the requested hostname to determine which pages to serve.

    Run the same kind of setup at home, though I use a DNS server to resolve spoof hostnames. So if I have a project www.mydomain.com, I add a DNS record for www.mydomain.xom and use that hostname for development.


  • Closed Accounts Posts: 519 ✭✭✭smeggle


    totally lost me as to why you want a local service to return via typing a canocal name when simply 127.0.0.1/whatever folder name will do the same as your asking.
    A web server can only serve one site thru default port 80. How can I swap sites while developing multiple sites simultaneously?

    If your using a local service (I.E. for your use only), then Apache will serve you any number of webroot folders as I said. I can say open ff and open 10 seperate sites (in tabs) via 127.0.0.1/folder name for viewing/developement. I can also access phpmyadmin and work on the local db/db's at the same time. Assuming I'm running Apache as a local service that is.

    The changes or affects take place and are displayed if I then request via the canocal name.

    oh yeah 127.0.0.1 or whatever your webservers i.p. is 192.168.etc.etc


  • Closed Accounts Posts: 975 ✭✭✭squibs


    Have a look at the documentation for the virtualhost directive in apache:
    Thanks - that may be just what I need
    Run the same kind of setup at home, though I use a DNS server to resolve spoof hostnames
    Interesting - must look for a freebie. This is new to me.
    totally lost me as to why you want a local service to return via typing a canocal name when simply 127.0.0.1/whatever folder name will do the same as your asking.
    Because I use absolute URLs - don't want to have to change all my links when I migrate the site to the live server.


  • Closed Accounts Posts: 631 ✭✭✭daram


    why use absolute urls? whats the benifit of that? it means the website is useless if the client wants to change domain name. Also, although not by much, it slows the whole site down, because DNS is brought back into the equation with every link click.


  • Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭Eoin


    Presuming that all the domain names point to the apache server, then something like this should work in your httpd.conf file:
    <VirtualHost IPADDRESSHERE:80>
        SSLEngine off
        DocumentRoot "/site1/"
        ServerName www.site1.com
    </VirtualHost>
    
    <VirtualHost IPADDRESSHERE:80>
        SSLEngine off
        DocumentRoot "/site2/"
        ServerName www.site2.com
    </VirtualHost>
    


  • Advertisement
  • Closed Accounts Posts: 975 ✭✭✭squibs


    I'm really not sure why I use absolute URLs. Time to rethink that strategy I suppose. Thanks for the virtualhost example.


  • Closed Accounts Posts: 631 ✭✭✭daram


    I use a program called Easy-PHP to do all local testing of pages with server-side stuff in them. Works a treat. It sits in the system tray when running and includes apache, mysql, php4 etc etc. The main benifit is that when you close the program, it shuts down all those services. The system tray thing also lets you fast-switch between different sites and also get into other services like phpMyAdmin and likewise. Doesnt really help with the absolute url thing. But a handy program none the less. Free too.


Advertisement