?
Solved

Apache 2 - virtual host question

Posted on 2003-03-06
21
Medium Priority
?
691 Views
Last Modified: 2013-11-15
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
Comment
Question by:mikebentley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 8
  • 2
  • +1
21 Comments
 
LVL 15

Expert Comment

by:samri
ID: 8086695
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
 

Author Comment

by:mikebentley
ID: 8088833
I had that original, and that didn't work.

Mike
0
 
LVL 22

Accepted Solution

by:
pjedmond earned 200 total points
ID: 8091719
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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 22

Expert Comment

by:pjedmond
ID: 8091729
124.184

Interesting domain:)
0
 

Expert Comment

by:doveditul
ID: 8092587


  Hy
 
try
 
 " UseCanonicalName DNS "
0
 
LVL 15

Expert Comment

by:samri
ID: 8101418
pjedmond,

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

anyway,
Mike: any luck?
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 8101727
http://68.101.124.184:8080

Gives an Advanced Global Solutions (Under Construction) page:)
0
 

Author Comment

by:mikebentley
ID: 8112599
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
 

Author Comment

by:mikebentley
ID: 8112640
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
 
LVL 22

Expert Comment

by:pjedmond
ID: 8113064
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
 

Author Comment

by:mikebentley
ID: 8113194
Should resolve to this:
http://68.101.124.184:8080/

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

Mike
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 8113434
Yep - double clicking on that also gives me the test page:)

A problem with your routing/firewall?...something else?
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 8113442
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
 
LVL 22

Expert Comment

by:pjedmond
ID: 8113479
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
 
LVL 22

Expert Comment

by:pjedmond
ID: 8113531
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
 

Author Comment

by:mikebentley
ID: 8113615
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
 
LVL 22

Expert Comment

by:pjedmond
ID: 8113713
/me thinks you need to change ISP:)...and possibly web host?
0
 

Author Comment

by:mikebentley
ID: 8114296
Wish I could, but me have no $, thus, my predicament.
0
 

Author Comment

by:mikebentley
ID: 8114316
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
 

Author Comment

by:mikebentley
ID: 8114887
Think I figured it out.  Thanks for all the help.

Mike
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 8115399
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

The Ideal Solution for Multi-Display Applications

Check out ATEN’s VS1912 12-Port DP Video Wall Media Player at InfoComm 2017. Kerri describes how easy it is to design creative video walls in asymmetric layouts and schedule detailed playlists ahead of time with its advanced scheduling feature.

Question has a verified solution.

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

By default, Carbonite Server Backup manages your encryption key for you using Advanced Encryption Standard (AES) 128-bit encryption. If you choose to manage your private encryption key, your backups will be encrypted using AES 256-bit encryption.
Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
Suggested Courses

777 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