Edited (again): I thought that an apache2 installation on my ubuntu os (personal) would enable me to "host" websites internally - without going onto the web. I am realizing now that the two domains that "work" are actually registered domain names, the other two are names that I intend to register later when I go live. But disconnecting to the Internet stops even the first two domains from working - though I know them to be pulling their files from the localhost.mysitename.com . What's happening here? I'm now reading up on etc/host and etc/host.conf and etc/nsswitch.conf - am I heading in the right direction?
I re-wrote this questions with more info. The problem persists. Thanks:
How in the world can you thoroughly read the apache docs on vHost configuring, try virtually every concoction and still have the initial scenario where the first two vHosts and directories work great and then every one after comes up bad. "Bad Request" "Server Not Found."
Here's the basic vHost file (in /etc/apache2/sites-available), replicated exactly 4 times over with only the "mysitename1" changing, its DocumentRoot and its Directory changing. BTW, this version is using the localhost IP (127.0.0.1) but I've used *:80 with the exact same results.
<VirtualHost 127.0.0.1>
ServerAdmin xx@yyyyy.com
ServerName localhost.mysitename1.com
DocumentRoot /home/folder/folder/folder/folder
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/folder/folder/folder/folder>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog "path to this site's error.log"
LogLevel warn
CustomLog "path to this site's access.log"
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
And inside the ports.conf is this: (I've started with the *:80 instead of the 127.0.0.1) - same results as described above:
Listen 80
NameVirtualHost 127.0.0.1
I'm wondering about the doc sentence of: "You can put entries in your hosts file for local testing, but that will work only from the machine with those hosts entries." That is all I'm trying to do, essentially a developing environment where I can work on multiple sites locally. I can't find this "hosts" file, but I'm wondering if I entered my first two domains (a long time ago) and forgot how I did it. ??
Thanks for any help.