Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have been using my local machine as a web server for a while, and I have several websites set up locally on my machine, all with similar Vhost files like the one seen here

/etc/apache2/sites-available/john.smith.com:

<VirtualHost *:80>
RewriteEngine on
RewriteOptions Inherit

ServerAdmin www-data@john.smith.com
ServerName john.smith.com
ServerAlias www.john.smith.com
DocumentRoot /home/john/smith

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
LogFormat "%v %l %u %t \"%r\" %>s %b" comonvhost
CustomLog /var/log/apache2/access.log comonvhost
</VirtualHost>

then I set up the /etc/hosts file like so for every Vhost:

192.168.1.100     www.john.smith.com       john.smith.com
192.168.1.100     www.jane.smith.com       jane.smith.com
192.168.1.100     www.joe.smith.com        joe.smith.com
192.168.1.100     www.jimbob.smith.com     jimbob.smith.com

Now I am hosting my friend's website until he gets a permanent domain. I have port forwarding set up to redirect port 80 to my machine, but I don't understand how the global ip fits into all of this. Do I for example use the following web site addresses (assume global ip is 12.34.56.789):

12.34.56.789.john.smith
12.34.56.789.jane.smith
12.34.56.789.joe.smith
12.34.56.789.jimbob.smith
share|improve this question

migrated from stackoverflow.com Oct 4 '12 at 0:46

This question came from our site for professional and enthusiast programmers.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.