LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-16-2010, 11:04 AM   #1
Dreft
LQ Newbie
 
Registered: Oct 2009
Posts: 15

Rep: Reputation: 0
Apache VirtualHost's


Hello. I created VirtualHost in apache configuration file.

Code:
NameVirtualHost 77.79.13.20:80

<VirtualHost 77.79.13.20:80>
   DocumentRoot "/var/www/host"
   ServerName host.t2p.lt
</VirtualHost>
Now, http://host.t2p.lt works perfect, take site visitor to exact page - www.t2p.lt/host/

but if I do http://www.host.t2p.lt it take visitor to www.t2p.lt page.

Whats wrong and what should I include ?



Sorry for thread, I just must include this:
Code:
<VirtualHost 77.79.13.20:80>
   DocumentRoot "/var/www/host"
   ServerName www.host.t2p.lt
</VirtualHost>
And works perfect.

Last edited by Dreft; 12-16-2010 at 11:06 AM.
 
Old 12-16-2010, 02:55 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
The host name to ip resolution is a typically DNS function. For example you would want an A record to host.t2p.lt and a CNAME for www.host.t2p.lt that points to the same address. In your Apache configuration you can use an ALIAS directive for the host, which will tell Apache that the particular host file is for both host.t2p.lt and www.host.t2p.lt, but it requires that these addresses both resolve to the same location.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
setting up apache from scratch on a linux machine, apache failed message upon bootup dramous43 Linux - Enterprise 2 01-26-2010 07:53 AM
Apache Webserver on Slackware - Failed to Start Apache - 'no listening sockets .." CCTVGuru Linux - Server 4 10-11-2009 01:14 AM
Apache2 VirtualHost's NOT working randomblink Linux - Server 1 09-21-2008 01:35 AM
apache benchmarks (apache v13 / apache v20) ; large differences between benchmarking markus1982 Linux - Software 0 02-08-2003 10:53 AM
Apache and VirtualHost's slowrider Linux - Networking 0 03-17-2002 12:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration