?
Solved

Domain Parking (2 domains, 1 website)

Posted on 2004-03-22
18
Medium Priority
?
323 Views
Last Modified: 2010-03-04
Hello,

I have been looking for a solution to my problem all week, so I hope Experts Exchange can help me out.

I'm running about 8 domains on one IP attached to my Linux server with Apache and Plesk 5. I would like (example) domain.net to be an exact mirror of domain.com, not a redirect. I read this is called "domain parking".

I am fairly new to Apache, so I would really appreciate if someone could give me some detailed help on this one. Perhaps a step-by-step how-to.

I already tried something I found on the web:

pico /etc/httpd/conf/httpd.conf

Then, on the last line of httpd.conf, I added:

<VirtualHost 111.111.111.111>
ServerName www.domain.com
DocumentRoot /home/httpd/vhosts/domain.com/httpdocs
</VirtualHost>

<VirtualHost 111.111.111.111>
ServerName www.domain.net
DocumentRoot /home/httpd/vhosts/domain.com/httpdocs
</VirtualHost>

Both with valid IPs and paths of course.

Then i restarted httpd and named server. Didn't work. Domain.net was still unchanged.

Looking forward to hearing from anyone who thinks he/she has a solution. Again, it's a Linux server with Apache and Plesk.
0
Comment
Question by:rvdmei
[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
  • 7
18 Comments
 
LVL 10

Expert Comment

by:Mercantilum
ID: 10650685
Did you forget the

 NameVirtualHost *

( or     NameVirtualHost 111.111.111.111 )

in your httpd.conf ?

See http://httpd.apache.org/docs/vhosts/name-based.html
0
 

Author Comment

by:rvdmei
ID: 10651176
I did. But now that I changed that, it still doesn't work.

It used to be:

#NameVirtualHost *

It's now:

NameVirtualHost *

<VirtualHost 111.111.111.111>
ServerName www.domain.com
DocumentRoot /home/httpd/vhosts/domain.com/httpdocs
</VirtualHost>

<VirtualHost 111.111.111.111>
ServerName www.domain.net
DocumentRoot /home/httpd/vhosts/domain.com/httpdocs
</VirtualHost>

And I restarted httpd again. Domain.net still shows the same website. There still is an account open for Domain.net in Plesk, is that okay or do I have to remove that?
0
 
LVL 10

Expert Comment

by:Mercantilum
ID: 10651248
1. try to have a * after VirtualHost since you have only 1 IP ... moreover it will drop the 127.0.0.1 case (e.g. if local loop is used for your local acccesses it wont work :)

2. try to add ServerAlias, in this case you have only 1 VirtualHost  (you could remove it ... but let's try :)
    ServerName www.domain.com
    ServerAlias *.domain.net

But probably the 1. would have already fixed the pb :)
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

 

Author Comment

by:rvdmei
ID: 10651406
I tried both:

<VirtualHost *>
ServerName www.domain.com
ServerAlias *.domain.net
DocumentRoot /home/httpd/vhosts/domain.com/httpdocs
</VirtualHost>

Then I restarted httpd. Domain.net still remains the same.

Is placement of the code of importance? I have the VirtualHost code at the bottom of httpd.conf.

PS: When I restart httpd, I get this message:

Stopping httpd: [OK]
Starting httpd: [warn] module mod_frontpage.c is already added, skipping
[OK]

I assume that has nothing to do with this, but I thought I'd mention it anyway.
0
 

Author Comment

by:rvdmei
ID: 10651447
Do I need to have the domain installed in Plesk or is that of no importance? I deleted it but that doesn't make any difference, so I'll add it again.
0
 
LVL 10

Expert Comment

by:Mercantilum
ID: 10651464
I don't think it is important that the code is at the bottom.
Your virtual hosts config is not taken into account

In your httpd.conf do you have somewhere

ServerName www.domain.com

Ok, try as root the command

httpd -S

it will list you the virtual config as it sees it
0
 

Author Comment

by:rvdmei
ID: 10651817
"In your httpd.conf do you have somewhere

ServerName www.domain.com"

No, just:

#ServerName localhost

httpd -S returns:

"Syntax error on line 14 of /etc/httpd/conf/httpd.include:
Invalid command 'php_admin_flag', perhaps mis-spelled or defined by a module not included in the server configuration"

Eek, sounds bad. I appreciate your support so far.
0
 
LVL 10

Expert Comment

by:Mercantilum
ID: 10651833
So, add the

ServerName www.domain.com

and comment line 14 (put a # on top)
0
 

Author Comment

by:rvdmei
ID: 10652005
I added ServerName www.freestuffplaza.com and fixed line 14, but i keep getting syntax errors. I added some #'s again, but still getting syntax errors. "Invalid command 'PerlHandler', perhaps mis-spelled..etc" this time.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10653301
silly question: do all your domains already resolve to the same IP?
0
 

Author Comment

by:rvdmei
ID: 10653402
Yes.
0
 
LVL 10

Expert Comment

by:Mercantilum
ID: 10654768
I suggest you put back the original initial httpd.conf file, with just a few more lines (ServerName, NameVirtualHost, VirtualHost [with ServerAlias]) ; you probably inserted some bad chars in the current file, and it will be difficult to fix it.
0
 

Author Comment

by:rvdmei
ID: 10660986
I never changed the current file and when I just switched to a backup my host made all sites went down.

Maybe I should get this domain parking idea out of my head.
0
 

Author Comment

by:rvdmei
ID: 10661062
Current file = the httpd.conf file that came with the server when i ordered it.
0
 
LVL 10

Expert Comment

by:Mercantilum
ID: 10663754
Actually it should not be that difficult :) Try to reinstall Apache
0
 

Author Comment

by:rvdmei
ID: 10665491
To me, that's difficult ;) In the meantime, I'm sure you've given the solution to the domain parking problem, on a normal working server that is. So I'll give you the points.

Thanks for the support.
0
 
LVL 10

Accepted Solution

by:
Mercantilum earned 1500 total points
ID: 10667392
Reinstall Apache from scratch, and check the points we raised above in the new config.
Oh! Just an idea: would you have used a windows tool to edit the httpd.conf file and instead of LF you get CRLR at end of each line ?
(not sure apache cares but just incase)
0
 

Author Comment

by:rvdmei
ID: 10668178
I used Putty (ssh) to edit httpd.conf.
0

Featured Post

Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

Question has a verified solution.

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

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
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.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
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