Solved

Trying to access apache virtual hosts from outside LAN

Posted on 2007-12-05
9
1,338 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
ID: 20412048
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
ID: 20412148
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
ID: 20412509
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
Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

Author Comment

by:c9k9h
ID: 20412622
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
 

Author Comment

by:c9k9h
ID: 20412638
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
ID: 20413781
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
ID: 20413839
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
ID: 20414024
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
ID: 20452842
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

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Guacamole and browser performance 1 127
Web Site Hosting 10 96
how to use external config file with Spring MVC 4 159
Why Xampp showing MySQL as Maria DB on Welcome Page ? 8 111
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…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

696 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