• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 709
  • Last Modified:

Apache 2 - virtual host question

Hi gang,

I have a question on Apache 2, running on RedHat Linux 8 server that's pretty up2date.

I have two DNS servers running on a hosting server geographically separate from my server.  In the index.html file I have a meta refer that goes back to my server on port 8080.  This all works just dandy, but by the time the page goes back to my IP, it goes to the apache general page, not my home page.

Here's my httpd.conf file:

NameVirtualHost 68.101.124.184:8080

<VirtualHost 68.101.124.184:8080>
DocumentRoot /var/www/advancedglobalsolutions
ServerName 68.101.124.184
DirectoryIndex index.php
<Directory /var/www/advancedglobalsolutions/family>
AuthType Digest
AuthName "family"
AuthDigestFile /etc/webmin/passwd/digest
Require user family
</Directory>
</VirtualHost>

I left out the rest for sake of space and simplicity, so if it is necessary, please let me know and I'll send you the whole file.

I can't figure out what the problem is.

TIA,
Mike
0
mikebentley
Asked:
mikebentley
  • 10
  • 8
  • 2
  • +1
1 Solution
 
samriCommented:
Mike,

Could you try to fix the ServerName directive to have the your hostname instead of IP address.  IE, if you website is www.yoursite.tld, then try using

ServerName www.yoursite.tld

cheers.
0
 
mikebentleyAuthor Commented:
I had that original, and that didn't work.

Mike
0
 
pjedmondCommented:
Yuk!!!! What are you actually trying to do?

I presume that you are hosting more than one website on one server?...and I presume that you have ONE ethernet card ONLY in that system? ..and that all connections will be received on that?

Your extract above looks as if you might be planning on multiple network interfaces, and a seperate site on each interface?

Try the following structure for a single interface, and multiple domains/web addresses:
--------------------------------------X8-------------

NameVirtualHost *:8080   # Any port 8080 connection on any interface is virtual host

# Virtual host www.mysite.com
<VirtualHost _default_:8080>     # On default interface - assume one:)
DocumentRoot /var/www/html/www/
        Options ExecCGI
        ServerName www.mysite.com
        ScriptAlias /cgi-bin/ /var/www/cgi-bin/main/
</VirtualHost>

# Virtual host www.battlefields.com
<VirtualHost _default_:8080>
        DocumentRoot /var/www/html/battlefields/
        ServerName www.battlefields.com
</VirtualHost>

# Virtual host www.alex.com
<VirtualHost _default_:8080>
        DocumentRoot /var/www/html/alex/
        ServerName www.alex.com
        DirectoryIndex index.htm
</VirtualHost>
--------------------------------------X8-------------

DNS servers must resolve:

www.alex.com
www.battlefields.com
www.mysite.com

to the interface of this system.

Hope that the above makes sense. Remember, that you attempt to access the site using the IP address, then it will access the default site only, there is no way for the server to be avble to work out which name you mean!!!

Hope that helps:)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
pjedmondCommented:
124.184

Interesting domain:)
0
 
doveditulCommented:


  Hy
 
try
 
 " UseCanonicalName DNS "
0
 
samriCommented:
pjedmond,

gee.. I shuold;ve check what is the content on the site (seems to be closed now).

anyway,
Mike: any luck?
0
 
pjedmondCommented:
http://68.101.124.184:8080

Gives an Advanced Global Solutions (Under Construction) page:)
0
 
mikebentleyAuthor Commented:
PJ, been too long since I've come here, sorry.

The site seems to be up now, so I'll close this out.

Thanks for your help, and I'll be contacting your expertise for help in the near future.

Sincerely,
Mike
0
 
mikebentleyAuthor Commented:
PJ, to answer your question, yes, I have two interfaces on my RedHat Linux 8 box, one LAN interface, going to my cable modem, and another wireless card, going to my LAN.

I have an intranet I'm hosting on the LAN  side, and two sites www.journeyministriesinc.org, www.advancedglobalsolutions.com, on my WAN side.

The DNS host company will not let me put any of my own records on their server w/o charging me a fee, so I'm stuck with having to circumvent the whole thing.  So far, I have the http redirect meta for the advancedglobal site.

Now, problem is, I can't get the site to resolve (ie:  when you came to it, you said there was a construction page?  Should be my page).  the other site doesn't even come up, nor does my intranet, although I have it named after my server, and setup in apache.

Mike
0
 
pjedmondCommented:
Still gives an Advanced Global Solutions (Under Construction) page:)

If you can't get the DNS working, then it is virtually impossinle to have virtual hosts, as http1.1 is required for virtual hosts (on the same interface).

Sort out the DNS, then come back to this - why try and make life difficult (impossible?) :)

If you can't ping it, then hey - no change of seeing the webpage!  :)
0
 
mikebentleyAuthor Commented:
Should resolve to this:
http://68.101.124.184:8080/

I'm showing it is.  Maybe it's something internal to me.

Mike
0
 
pjedmondCommented:
Yep - double clicking on that also gives me the test page:)

A problem with your routing/firewall?...something else?
0
 
pjedmondCommented:
Try using trace, and ping and see if it gets to that address, in which case your routing is OK. Then have fun woth the firewalls:)
0
 
pjedmondCommented:
Just to let you know that there is something funny going on with:

http://www.advancedglobalsolutions.com/

at the moment. I get a NetFirms free web hosting and then it moves on to the Advanced Global Solutions (Under Construction) page.

Sorry makes sense - you've redirected it in the meta tags:

<meta http-equiv="refresh" content="0; URL=http://68.101.124.184:8080/">
0
 
pjedmondCommented:
Just to let you know that there is something funny going on with:

http://www.advancedglobalsolutions.com/

at the moment. I get a NetFirms free web hosting and then it moves on to the Advanced Global Solutions (Under Construction) page.

Sorry makes sense - you've redirected it in the meta tags:

<meta http-equiv="refresh" content="0; URL=http://68.101.124.184:8080/">
0
 
mikebentleyAuthor Commented:
Yeah, that's my only option right now.  They won't work with me on DNS, and my ISP blocks port 80, so that's the best I've been able to come up with so far.
0
 
pjedmondCommented:
/me thinks you need to change ISP:)...and possibly web host?
0
 
mikebentleyAuthor Commented:
Wish I could, but me have no $, thus, my predicament.
0
 
mikebentleyAuthor Commented:
Can I manipulate my DNS by putting my DNS server, www-1.advancedglobalsolutions.com, into play, assign my IP to that domain (www-1), and put their IP in for the www address, and redirect it that way, with a third DNS server?

I thought of doing that, and then if it worked, starting up the other website to they'll both go to their respective page on port 8080, or putting the other site on, say, port 8010 or something.

Does this make sense?

Mike
0
 
mikebentleyAuthor Commented:
Think I figured it out.  Thanks for all the help.

Mike
0
 
pjedmondCommented:
A pleasure - What you're suggesting..is virtually what I'm doing with my domain and the DNS - Problem is the blocking of port 80, so you can't connect directly to it on your own server:(

All the best..and...don't let the b*******ds get you down!
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 10
  • 8
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now