This forum is no longer active. Please post your questions to our new community site

Forums MAMPStack

Use http://example-local.com to see a local Web site

Subscribe to Use http://example-local.com to see a local Web site 4 post(s), 2 voice(s)

 
Avatar tbassetto 2 post(s)

Hello,

I have installed mampstack 1.O beta4 on Leopard.

I can see my local Web sites using http://127.0.0.1:8080

On http://127.0.0.1:8080/Live/example.com/, I have the copy of my website http://example.com

I would like to use http://example-local.com on my personal computer to see http://127.0.0.1:8080/Live/example.com/

How can I do ? On /etc/hosts I added the line 127.0.0.1 example-local.com So now http://example-local.com:8080 show the same content as http://127.0.0.1:8080

But I don’t want to see http://127.0.0.1:8080, I want http://127.0.0.1:8080/Live/example.com/

So I added this code on apache2.conf :
NameVirtualHost *:8080

<virtualhost> ServerAdmin admin@example.com DocumentRoot ”/Users/thomas/Sites/Live/example.com” ServerName example-local.com ErrorLog “logs/example-local-error_log” CustomLog “logs/example-local-access_log” common
</virtualhost>

But after restarting apache, it’s always http://127.0.0.1:8080 displayed :/

May you help me ?

Thanks

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

A really easy solution is to create a redirection page in the main location. Try the following:

Go to apache2/htdocs and move index.html to index-backup.html. Then create the following index.html file:


<html>
<body onLoad = "parent.location = 'http://example-local.com:8080/Live/example.com/'"\>
</body>
</html>

I hope it helps!

 
Avatar tbassetto 2 post(s)

Finally I used on httpd-vhosts.conf :


NameVirtualHost  *:8080
<VirtualHost *:8080>
        ServerAdmin <a href="mailto:thomas@pouet.com">thomas@pouet.com</a>

        DocumentRoot /Users/thomas/Sites
        <Directory /Users/thomas/Sites>
                Order allow,deny
                Allow from all
                Options Indexes FollowSymLinks
                AllowOverride None
        </Directory>

</VirtualHost>

<VirtualHost *:8080>
        ServerAdmin <a href="mailto:webmaster@example-local.com">webmaster@example-local.com</a>
        ServerName example-local.com
        ServerAlias *.example-local.com <a href="http://www.example-local.com">www.example-local.com</a>

        DocumentRoot /Users/thomas/Sites/Live/example.com
        <Directory /Users/thomas/Sites/Live/example.com>
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog "logs/example-local-error_log" 
        CustomLog "logs/example-local-access_log" common
</VirtualHost>

And it works.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

I’m glad to hear this! Thanks for posting the solution, I’m sure that will help to other BitNami users.

Forums MAMPStack