Solved

Trying to access apache virtual hosts from outside LAN

Posted on 2007-12-05
9
1,334 Views
Last Modified: 2008-02-01
Hello,

I have been hosting a single URL for a few years now and which is a registered domain, dns'd via everydns.net and running on a WAMP server. The single URL works perfect, however, I am trying to set up some new virtual hosts so that I can host multiple URLS from home. My problem is that I have got them to work from home on the LAN accessing them using http://mysite.localhost but I cant seem to access them from outside the network, nor am I able to assign a parked url to them.

My Apache configuration is as follows:

httpd.conf:
NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>
DocumentRoot "C:\wamp\www\zerocarbonearth"
ServerName zerocarbonearth.localhost
</VirtualHost>

<VirtualHost 127.0.0.1>
DocumentRoot "C:\wamp\www\uscarbonfree"
ServerName uscarbonfree.localhost
</VirtualHost>

<VirtualHost 127.0.0.1>
DocumentRoot "C:\wamp\www\mainediscalliance"
ServerName mainediscalliance.localhost
</VirtualHost>
------------------------------------------------------------


And for the windows hosts file:

127.0.0.1       localhost
127.0.0.1            zerocarbonearth.localhost
127.0.0.1            uscarbonfree.localhost
127.0.0.1            mainediscalliance.localhost


Thanks!
0
Comment
Question by:c9k9h
  • 5
  • 4
9 Comments
 
LVL 18

Expert Comment

by:Johnjces
Comment Utility
Are your virtual domains regsitered in an Internet DNS Service like your single URL through everydns.net?

If not, no one will ever see them. Make sure that they get proper DNS registrations through your DNS provider.

John
0
 

Author Comment

by:c9k9h
Comment Utility
yes, the actual domains are registered through godaddy and they are on my DNS server as dynamic domains I have a static ip address....
0
 
LVL 18

Expert Comment

by:Johnjces
Comment Utility
Just for info I looked on the web and...

www.uscarbonfree.com
This page is parked free, courtesy of GoDaddy.com  at IP 68.178.232.100

www.mainediscalliance.com came back to IP 82.197.131.52

www.zerocarbonearth.com/ came back to IP 64.185.133.92

zerocarbonearth.com came back to IP: 208.67.219.132

and

mainediscalliance.com resolved back to IP 82.197.131.52

DNS issue most likely. Did you set up the DNS stuff correctly on your account pages on GoDaddy?

That's about all I can think of.

John
0
 

Author Comment

by:c9k9h
Comment Utility
yea it shouldn't be as difficult as it seems...
zerocarbonearth.com is parked correctly... that is because it is on my DNS server as well as my apache server.... so it's pulling the correctly, however, when i go to the live site it is pulling the site (carbonfreeus.com) from the root directory rather than from where it is supposed to /www/zerocarbonearth. so it definitely seems like a problem with my apache settings, does this sound about right?
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:c9k9h
Comment Utility
Also, shouldnt there be a way to access it directly on the backend? say http://mysite.carbonfreeus.com?
0
 
LVL 18

Expert Comment

by:Johnjces
Comment Utility
To access them locally you would need to add them to that machine's host file as far as I know. If you are running an Internet DNS service at your location, I do not know how to add a local host record and local IP to a domain name that already has INternet DNS records assigned on that DNS server.

I am confused about pulling carbonfreeus.com from your root directory when you only mention virtual servers of uscarbonfree....

John
0
 

Author Comment

by:c9k9h
Comment Utility
I have already added them to the machines host file and they work fine as far as accessing them locally. The only other domains i have on the dns server are zerocarbonearth.com and carbonfreeus.com (both in different folders on my home server) both live sites bring me to carbonfreeus.com. Should i set the zerocarbonearth.com to a secondary domain?

Also... where in apache do you set the folder permissions? i'm running filezilla client/server with full read/write/delete/append permissions and for some reason i cannot chmod any directories to say, 777, nor can I access PhpMyAdmin from outside the LAN. I'm getting a 404 error stating that I do not have permission.  Any ideas here? Thanks for your help John, I really appreciate it!
0
 
LVL 18

Accepted Solution

by:
Johnjces earned 125 total points
Comment Utility
I am confused again. You are running Apache on a Windows PC correct? (WAMP). Not certain why you would need to change permission using Unix (Linux) chown number, i.e. 777 etc.

I can only advise you about my Linux setup using Apache and virtual hosts that I have running.

I have a conf.d directory /etc/httpd/conf.d/ and under this directory is a file with one of my virtual domains as a configuration file called

mankindsauces.com.vhost

containing

<VirtualHost *:80>
      ServerName mankindsauces.com
      ServerAlias *.mankindsauces.com
      DocumentRoot /var/www/virtual/mankindsauces.com
      ErrorLog /var/log/httpd/mankindsauces.com_error_log
      CustomLog /var/log/httpd/mankindsauces.com_access_log combined
</VirtualHost>

Here is where it points to the physical location/directory on my server of where the web files, index.htm etc, are located.

Not knowing how Windows Apache uses its httpd.conf file, (should be the same), I have no virtual domains entered into that conf file.

So.... I am not certain how to help you from this point.

I am not certain either on how that other domain is popping up, carbonfreeus.com.

Hopefully I have helped a tad and some other expert will know the answers. I do not at this point.

Good luck and I am learning too!

John
0
 
LVL 18

Expert Comment

by:Johnjces
Comment Utility
Did I truly help you?

I didn't think this would be THE correct answer. If so great and thanks, but let me know if you would if in fact this solved or helped to solve your problem.

And... what was the final fix?

Thanks

John
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now