Unix/Linux Go Back    

Web Programming Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, HTML, SEO, and other Web APIs and topics.

Two separate domains - and files

Web Programming

Closed Linux or Unix Question    
Thread Tools Search this Thread Display Modes
Old Unix and Linux 02-25-2013
davidm123SED davidm123SED is offline
Registered User
Join Date: Jan 2013
Last Activity: 13 March 2015, 1:43 PM EDT
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Two separate domains - and files

I've been asked to 'troubleshoot' a webserver where two different TLDs are being served. Or to be more accurate, 'domain.com' and 'domain.fr'.

So we have


And then for some reason, the httpd.conf file points to two different configuration files.


And then in there, there are Virtualhost stuff, and what else, I don't know.

It's a bit of a dog's breakfast.

Anyway, to cut a long story short, when someone points at domain.com, he gets to domain.com, but when someone points to domain.fr, he still goes to domain.com.

So something's wrong. But the whole thing is such a mess, that I don't even know where to start. Can someone give me some tips?

Sponsored Links
Old Unix and Linux 02-26-2013
DGPickett DGPickett is offline Forum Advisor  
Registered User
Join Date: Oct 2010
Last Activity: 4 November 2015, 3:30 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,671
Thanks: 8
Thanked 587 Times in 560 Posts
Show the conf:


Virtual Hosts:

The Apache web server allows one to configure a single computer to represent multiple websites as if they were on separate hosts. There are two methods available and we describe the configuration of each. Choose one method for your domain:
  • Name based virtual host: (most common) A single computer with a single IP adress supporting multiple web domains. The web browser using the http protocol, identifies the domain being addressed.
  • IP based virtual host: The virtual hosts can be configured as a single multi-homed computer with multiple IP addresses on a single network card, with each IP address representing a different web domain. This has the appearance of a web domain supported by a dedicated computer because it has a dedicated IP address.
Configuring a "name based" virtual host:

A virtual host configuration allows one to host multiple web site domains on one server. (This is not required for a dedicated linux server which hosts a single web site.)

NameVirtualHost XXX.XXX.XXX.XXX

<VirtualHost XXX.XXX.XXX.XXX>
ServerName www.your-domain.com - CNAME (bind DNS alias www) specified in Bind configuration file (/var/named/...)
ServerAlias your-domain.com - Allows requests by domain name without the "www" prefix.
ServerAdmin user1@your-domain.com
DocumentRoot /home/user1/public_html
ErrorLog logs/your-domain.com-error_log
TransferLog logs/your-domain.com-access_log

Last edited by DGPickett; 02-26-2013 at 05:23 PM..
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Using bash to separate files files based on parts of a filename Breentax Shell Programming and Scripting 1 07-19-2012 02:22 AM
Divide data into separate files dodasajan Shell Programming and Scripting 6 04-12-2012 05:59 AM
Need to find occurrences of email domains in all files in a directory linuxhombre Shell Programming and Scripting 4 10-15-2009 02:39 PM
Comparing Counts Within Separate Files gator76 Shell Programming and Scripting 2 01-09-2008 03:53 PM
How to separate 0kb files from the rest!!! kumarsaravana_s Shell Programming and Scripting 3 04-02-2007 09:38 AM

All times are GMT -4. The time now is 07:49 PM.