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 - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-19-2004, 03:24 PM   #1
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336

Rep: Reputation: 54
apache virtual hosts


I just made a virtual host on my LAN server, it works, but the problem is that it does not only work for the given host, but for the whole server, so basically it just overrides the rest of the settings. The main hostname of the server is borg, and the virtual host is *.ebay.* but even if I access the server with borg, it still goes to the virtual host. Why?!

So I tried to create another virtual host called borg, but it said I can only have one, and the first one takes priority.... that's odd since I thought it was possible to have more then one virtual host... it sort of defeats the purpose if I'm limited to one per server.

Is there a way to get this to work properly? I need to do this in order to block ebay from my network and have it so it says it's down, so I will add ebay in the hosts file on the computer downstairs. But I still need to be able to access the root portion of my server the way it is under the root host. Thanks in advance!
 
Old 06-19-2004, 03:38 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
httpd.conf file posted here please.. or we're clueless as you are. And any more details will help you may have.
 
Old 06-19-2004, 03:50 PM   #3
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336

Original Poster
Rep: Reputation: 54
<VirtualHost *:80>
ServerAdmin webmaster@ebay.ca
DocumentRoot /data/intranet/main/ebay
ServerName *.ebay.*
errordocument 404 /data/intranet/main/ebay/index.php
</VirtualHost>

That's the part I modified, so anything with ebay in it should use it, otherwise use the server's root settings (which are working correctly without the virtual host part added.)

I tried putting

another one like this:

<VirtualHost *:80>
DocumentRoot /data/intranet/main/www
ServerName borg
</VirtualHost>

But it says it can't resolve borg. But I figured if it does not comply with the ebay one, it should just use the root settings, no?
 
Old 06-20-2004, 04:37 AM   #4
Cerbere
Member
 
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
Two things to try:

1) You need a 'NameVirtualHost *:80' (just one) directive before the two <VirtualHost *:80> directives.

2) Change your 'ServerName *.ebay.*' to 'ServerName ebay.com', then use 'ServerAlias *.ebay.*'

I'd also suggest you switch the two VH's so borg comes first, because any ambiguous requests will default to the first VH.

And trickykid, why speaking like yoda are you?

Enjoy!
--- Cerbere
 
Old 06-20-2004, 09:05 AM   #5
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Also if you have your main configuration already setup to use port 80, you really don't need to specify the port in your virtual hosts config either, something like this is doable:

<VirtualHost *>
ServerAdmin webmaster@ebay.ca
DocumentRoot /data/intranet/main/ebay
ServerName ebay.com
ServerAlias *.ebay.*
errordocument 404 /data/intranet/main/ebay/index.php
</VirtualHost>

<VirtualHost *>
DocumentRoot /data/intranet/main/www
ServerName borg
</VirtualHost>
 
  


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
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 06:29 AM
Apache/Virtual Hosts Help C-Squared Linux - General 9 08-04-2003 12:45 PM
Apache Virtual Hosts (again) scatcat Linux - General 1 10-17-2002 09:51 AM
Apache: Virtual hosts pk21 Linux - Software 15 10-08-2002 05:08 PM
apache virtual hosts jonfa Linux - General 1 06-04-2002 01:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:09 PM.

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