LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-10-2003, 08:01 PM   #1
granny
Member
 
Registered: Nov 2002
Distribution: RH
Posts: 141

Rep: Reputation: 15
apache virtual servers


hey guys, I want to use virtual hosts for 3 seperate websites. Let's say a.test.com, b.test.com, and c.test.com But in addition I want to be prompted for a password for each website.

Considering DNS is configured to resolve all of the names correctly, what would be the proper virtual host directive to put in to use seperate .htaccess files to access the seperate websites? Here is what I have at the bottom of my httpd.conf file. RH7.3

namevirtualhost 192.168.1.100
<VirtualHost "a.test.com">
DocumentRoot "/testa"
ServerName a.test.com
</VirtualHost>

<VirtualHost "b.test.com">
DocumentRoot "/testb"
ServerName b.test.com
</VirtualHost>


<VirtualHost "c.test.com">
DocumentRoot "/testc"
ServerName c.test.com
</VirtualHost>

Currently this works fine, just no authentication prompt. TIA!!!
 
Old 09-10-2003, 08:03 PM   #2
granny
Member
 
Registered: Nov 2002
Distribution: RH
Posts: 141

Original Poster
Rep: Reputation: 15
O wait! Would this work? Just repeat the steps for a and c also? Thanks!


<VirtualHost "b.test.com">
DocumentRoot "/testb"
ServerName b.test.com
<Directory "/testb">
Allowoverride All
</directory>
</VirtualHost>

Nevermind, that didn't work.

Last edited by granny; 09-10-2003 at 08:16 PM.
 
Old 09-10-2003, 10:36 PM   #3
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,906

Rep: Reputation: 91
Wouldn't htpasswd, a php script or such be needed for password access?
 
Old 09-10-2003, 11:42 PM   #4
granny
Member
 
Registered: Nov 2002
Distribution: RH
Posts: 141

Original Poster
Rep: Reputation: 15
yea I am using htaccess files. What I thought might work, because this is how I do it for seperate directories is as follows. Ex using b.test.com

The document root for b.test.com is /btest

In /btest I created an .htaccess file that points to the file /btestpasswd/.htpasswd for user authentication.

Then ran htpasswd /btestpasswd/.htpasswd webuser
and gave him a password.

I thought this would work, but no authentication prompt. If I do the same thing for example on a directory that I have aliased, it works perfectly!
 
  


Reply


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
Apache + virtual servers yussef Debian 1 01-31-2005 09:48 PM
Apache + virtual servers yussef Linux - Software 0 01-08-2005 01:05 PM
apache virtual servers knueven7 Linux - Software 2 03-31-2003 12:14 PM
Mandrake / Apache Virtual Servers mortalfrog Linux - Newbie 1 03-18-2002 09:23 AM
Apache and Virtual Servers... BaerRS Linux - General 2 03-08-2002 09:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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