Reply to comment

Simple Staging

Here's yet another idea for setting up your computer to stage a bunch of websites. I run servers on 127.0.0.1 and name all the websites so they end in ".lo" like "test.lo" and "id.lo". I put these into /etc/hosts:

127.0.0.1 test.lo
127.0.0.1 id.lo

Then, create the typical config files (in /etc/apache2/sites-enabled).

Last, create an index.php in /var/www that reads /etc/hosts and generates a page of links to these staging sites:

<?php
$f = file("/etc/hosts");
foreach($f as $line)
        if (preg_match("/\b([\w-]+?\\.lo)/", $line, $p))
                print "<p><a href='http://$p[1]'>$p[1]</a></p>\n";

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <b> <dd> <dl> <dt> <i> <li> <ol> <u> <ul> <p> <br> <div> <pre> <code> <img><h1><h2><h3><h4> <blockquote>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

.