Two separate domains - and files | Unix Linux Forums | Web Programming

  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 Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-25-2013
davidm123SED davidm123SED is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 25 September 2013, 9:35 AM EDT
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Two separate domains - and files

Hi,
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

/var/www/domain.com
/var/www/domain.fr

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

/etc/httpd/conf/domain.d.com/httpd.conf.com
/etc/httpd/conf/domain.d.fr/httpd.conf.fr

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?

Thanks.
Sponsored Links
    #2  
Old 02-26-2013
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 8 July 2014, 12:19 PM EDT
Location: Southern NJ, USA (Nord)
Posts: 4,378
Thanks: 8
Thanked 535 Times in 514 Posts
Show the conf:

inux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html

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
</VirtualHost>

Last edited by DGPickett; 02-26-2013 at 04:23 PM..
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 01:22 AM
Divide data into separate files dodasajan Shell Programming and Scripting 6 04-12-2012 04:59 AM
Need to find occurrences of email domains in all files in a directory linuxhombre Shell Programming and Scripting 4 10-15-2009 01:39 PM
Comparing Counts Within Separate Files gator76 Shell Programming and Scripting 2 01-09-2008 02:53 PM
How to separate 0kb files from the rest!!! kumarsaravana_s Shell Programming and Scripting 3 04-02-2007 08:38 AM



All times are GMT -4. The time now is 04:18 AM.