Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Configuring proper index

Posted on 2006-11-20
12
Medium Priority
?
202 Views
Last Modified: 2010-03-04
I have a critical issue that is simple in nature.  I am not familar with apache and I have www.abc.com going to the correct page and abc.com going to the incorrect page.  I want to get abc.com to point to the same page that www.abc.com is pointed to.  

I am currently searching through apache's documentation and forums... I gotta get this fixed tonight and any direction to the correct documentation page would be helpful.  

Also, how can I tell what version of apache we are using?

P
0
Comment
Question by:PeterZog
  • 6
  • 5
12 Comments
 

Author Comment

by:PeterZog
ID: 17984942
Ok I got into httpd.conf.  There are <virtualhost www.abc.com> settings among others like <xyz.abc.com> ... but there is nothing for <virtual abc.com>  ... there is a <virtualhost abc.ourisp.com>  ... Is THIS what I adjust for abc.com?

Peter
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17985007
What platform are you running Apache on?

In the <virtualhost www.abc.com> paramters add:

      ServerAlias abc.com

So you have:

     <virtualhost www.abc.com> 
     "other paramters"
     ServerAlias abc.com
     </virtualhost>

0
 

Author Comment

by:PeterZog
ID: 17985045
Thanks I'll give that a try.  Apache is running on Windows Server.  Does that have an impact?
0
Industry Leaders: 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!

 
LVL 57

Expert Comment

by:giltjr
ID: 17985077
Not with the ServerAlias.

However, it does to figure out what version of Apache you are running.  In Windows go to program files and look for a directory like "Apache" or "Apache Software Foundation", under this there should be a directory with the version/release of Apache.
0
 

Author Comment

by:PeterZog
ID: 17985116
Ok, that took care of 50% of the problem.  I didn't tell you that I have two domains that are hosting ... and they are both having the problem.  What you suggested corrected the problem for one domain but not the other.

There is a difference in config for these two:

The NOW working one:

<Virtual Host www.abc.com>
    ServerAdmin  xxxxxxxxxx
    DocumentRoot xxxxxxxxxxx
    DirectoryIndex xxxxxxxxxxx
    ServerName 216.17.xxx.xxx
    ErrorLog xxxxxx
    CustomLog xxxxxxxx
    ServerAlias abc.com
</VirtualHost>

The one that is still incorrect:
<VirtualHost www.xyz.com>
    ServerAdmin  xxxxxxxxxx
    DocumentRoot xxxxxxxxxxx
    DirectoryIndex xxxxxxxxxxx
    ServerName 216.17.xxx.xxx
    ErrorLog xxxxxx
    CustomLog xxxxxxxx
           Alias /admin "/var/www/html/xyz/admin"
           <Location /admin>
           AuthName "Authorised Users"
           DirectoryIndex admin.php index.html index.htm
           AuthType basic
           AuthUserFile /etc/.xyz
           require valid-user
           </Location>
      ServerAlias xyz.com
</VirtualHost>

Is that exact code making the difference?



ServerAlias abc.com
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17985128
I would try what I have below.  I would also check the logs to see if there are any errors.

<VirtualHost www.xyz.com>
    ServerAdmin  xxxxxxxxxx
    DocumentRoot xxxxxxxxxxx
    DirectoryIndex xxxxxxxxxxx
    ServerName 216.17.xxx.xxx
    ErrorLog xxxxxx
    CustomLog xxxxxxxx
    ServerAlias xyz.com
           Alias /admin "/var/www/html/xyz/admin"
           <Location /admin>
           AuthName "Authorised Users"
           DirectoryIndex admin.php index.html index.htm
           AuthType basic
           AuthUserFile /etc/.xyz
           require valid-user
           </Location>
</VirtualHost>
0
 

Author Comment

by:PeterZog
ID: 17985177
Hey I really appreciate the help... a couple things...

1. I just commented the extra code out for the time being.  I'll see if someone screams about it.

2. The problem came back... I wanted to make sure that I actually made the change.  So I commented out the ServerAlias code www.abc.com, saved the file, checked it and it went to the incorrect page, then I uncommented the code, saved it and it went to the incorrect page again.   (???)  

Could this be because of DNS caching or something?  Does it take time sometimes for the httpd.conf changes to take effect?  I have triple checked my code to make sure I am not missing something.

Peter  
0
 

Author Comment

by:PeterZog
ID: 17985259
This server has multiple instances of apache folders (different versions and projects).  How can I tell which httpd.conf is actually being used?  
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 17986009
Try the Following

NameVirtualHost *:80

<VirtualHost *:80>
     ServerName abc.com
     ServerAlias abc.com *.abc.com 216.17.xxx.xxx
     DocumentRoot xxxxxxxxxxxxxxxxxxxxxx
     ServerAdmin  xxxxxxxxxx
     DirectoryIndex xxxxxxxxxxx
     ErrorLog xxxxxx
     CustomLog xxxxxxxx
</VirtualHost>

<VirtualHost *:80>
     ServerName xyz.com
     ServerAlias xyz.com *.xyz.com 216.17.xxx.xxx
     DocumentRoot xxxxxxxxxxxxxxxxxxxxxx
     ServerAdmin  xxxxxxxxxx
     DirectoryIndex xxxxxxxxxxx
     ErrorLog xxxxxx
     CustomLog xxxxxxxx
</VirtualHost>
0
 

Author Comment

by:PeterZog
ID: 17986881
It still doesn't work.  How can I make sure that the httpd.conf that I am editting is the one being used?
0
 
LVL 57

Accepted Solution

by:
giltjr earned 2000 total points
ID: 17987360
Are both Virtualhost definitions in the same conf file?  If so and changing the 1st one works, then the correct conf file is being use.

Just to make sure "http://abc.com" is returning the same page as "http://www.abc.com."?  Correct?

What do you get when you try "http://xyz.com"?

If you have not tried I would suggest:

<VirtualHost *:80>
  ServerName www.xyz.com
  ServerAlias xyz.com *.xyz.com
  "other parms"
</VirtualHost>

Is there a special reaons you have a IP address in there?  Does the "xyz" domain have a unique IP address?

Also do you have the parameter:

     NameVirtualHost

This should come before first <VirtualHost> definition.  You can code it as:

    NamveVirtualHost *:80
0
 
LVL 57

Expert Comment

by:giltjr
ID: 18000653
Glad to see you got it working.  Thanks.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month12 days, 23 hours left to enroll

971 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