LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 01-17-2007, 06:02 PM   #1
jyamada1
LQ Newbie
 
Registered: Jan 2007
Posts: 5

Rep: Reputation: 0
apache2 vhost site makes default site inaccessible


i'm trying to setup a local LAMP development environment. i had apache2, php5, mysql5, and phpmyadmin up and running.

i tried adding a virtualhost entry to point to a development folder, though, and now localhost is directed to that folder instead of /var/www. (i'm using the updated sites-available, sites-enabled virtualhost config).

is there something i should have changed in the default site config in sites-available to make sure only dev.mysite.com and www.dev.mysite.com address are routed to the alternative DocRoot? i want to keep /var/www as the root for localhost addresses. hope thats clear. thanks!

here are the contents of the new conf file in sites-available:
Code:
<VirtualHost dev.mysite.com>
        ServerAdmin webmaster@localhost
        ServerName dev.mysite.com
        ServerAlias www.dev.mysite.com
        DocumentRoot /home/myname/wwwdev/mysite.com/
        CustomLog /var/log/apache2/mysite.com-access.log combined
</VirtualHost>
 
Old 01-17-2007, 06:11 PM   #2
gregmcavoy
Member
 
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54

Rep: Reputation: 15
I'm not a pro, but as I understand it, once you switch to using virtual hosts, the first virtual host you list becomes the default. Create a virtual host for what you want to be the default, then list any other virtual hosts after that.
 
Old 01-17-2007, 06:18 PM   #3
jyamada1
LQ Newbie
 
Registered: Jan 2007
Posts: 5

Original Poster
Rep: Reputation: 0
ok, but how exactly does that work with the sites-enabled way of listing hosts? that is, in that way the "list" of hosts is a directory of symlinks and doesn't really have an order.
 
Old 01-17-2007, 07:06 PM   #4
gregmcavoy
Member
 
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54

Rep: Reputation: 15
I believe they are processed in numberical/alphabetical order (which would explain why "000" begins the default). See http://www.linux.com/article.pl?sid=05/09/01/186204.
 
Old 01-17-2007, 09:42 PM   #5
jyamada1
LQ Newbie
 
Registered: Jan 2007
Posts: 5

Original Poster
Rep: Reputation: 0
great! of course that makes a lot of sense. while the site name (which starts with 'd') is definitely after 000, it's good to know about the processing order.

the link you gave helped a lot and now i've got it working. i thought that the VirtualHost start tag should include the site name. by changing it from
Code:
<VirtualHost dev.mysite.com>
to
Code:
<VirtualHost *>
, everything started working as expected.

thanks for the help!
 
  


Reply

Tags
apache2, default, development, virtualhost


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How can I permanently change YOU default site? Adrian Baker Suse/Novell 2 10-29-2006 04:09 PM
How can i change my Default site page in Redhat 9 winxandlinx Linux - Networking 1 07-18-2006 12:03 PM
apache2 Home practice site comprookie2000 Linux - Networking 3 01-19-2005 05:44 PM
How To: Use Windows Partition for Default Apache 2 Web Site RavenLX Linux - Networking 0 01-18-2005 02:41 PM


All times are GMT -5. The time now is 08:43 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration