PDA

View Full Version : virtualhosts and webpassword



<-- R O B -->
02-09-2004, 04:54 AM
Hi All

I'm trying to enable webpassword for a virtualhost via sitemanager, but I get the message "The directory does not exist. Please enter a valid url...."

This is the scenario:

my main domain is abc.com.

I have a virtualhost (def.com)

def.com's root is defined in a sub-folder of abc.com - lets call it 'def'

Within this folder I have a folder called 'admin' which I want to protect.

So my path to the folder I want to protect is '/www/htdocs/def/admin'

I can browse to this folder (http://def.com/admin) no problem so this is not a question of a spelling error.

In site manager I start to create a new webpassword entry - I enter the url 'http://def.com/admin' and fill in the rest of the fields and when I press enter I get the above error message.

If I enter http://abc.com/def/admin and the url the password is created - but only works when I browse to the url http://abc.com/def/admin - not when I browse to http://def.com/admin.

Does anybody have a solution to this?

P.S Site manager sucks for managing virtual hosts - does anyone know of another application that i could install that might make my life a little less painful?[/list]

<-- R O B -->
02-09-2004, 05:11 AM
ok figured it out !

I'n your httpd.conf file you MUST define your document root as :

/var/www/html/your_vhosts_root_folder

and NOT as:

/www/htdocs/

which is what I had been doing previously

rchub
08-12-2004, 07:25 PM
Where is this "httpd.conf" file that you are talking about?

I am having a hard time using .htaccess file in my sub domain names. I called the Tech Support and was told that it is not possible to do it.

Seems like you did it, can you please provide a step-by-step instruction on how to modify the files so my .htaccess and .htpasswd file will work?

Thanks.

wildjokerdesign
08-12-2004, 07:46 PM
httpd.conf is located in /ect/httpd/conf/

rchub
08-12-2004, 08:03 PM
Now that I found it, do I just simply change /www/htdocs to /var/www/html/myvirtualdomainfolder? Will this affect anything with my primary domain?

wildjokerdesign
08-12-2004, 08:52 PM
I can't say for sure. I know Rob still visit the forum but this is a pretty old thread so not sure if he is still checking it or not. I would think that there would be a virtual host set up for your virtual domain and that if you just changed that on it shouldn't effect your primary domain. If you do anything make sure to make a backup of the original file in case some goes wrong. :) Also after makeing changes to the httpd.conf file you have to restart apache and that can be done in your Site Manager. It can also be done in an SSH session if you are comfortable with that. Wish I could be more help. If Rob does not reply in a day or so you might try PM'ing him.

rchub
08-13-2004, 09:04 AM
Good News!

After much frustration with the .htaccess file and tech support with WestHost, I decided to just go to sleep and forget about it. However, the next morning when I woke up, all the sudden the password works! Looks like to me WestHost was doing something in the middle of the night fixing my problem. Anyhow, this is all I did:

1. create a regular .htaccess file (can be found on many web sites, search Google for ".htacesss")
2. create a .htpasswd file, which also can be found on Google
3. upload the .htaccess file into the directory you want to protect (using ASCII, not Binary!)
4. upload the .htpasswd file the same way but to a directory that is above your /www/yourvirtualdomain folder
5. you should be good to go!

WestHost - TMonsen
08-13-2004, 04:01 PM
Rchub,

You are right, we did continue to work on this for you. The reason that your .htaccess file was not working for your domain alias', was that the alias was not allowing the rewrite rules. I added the following to your
virtual host directives.

&lt;Directory />
AllowOverride All
&lt;/Directory>

rchub
08-13-2004, 04:07 PM
Where did you add that? in the httpd.conf file?

wildjokerdesign
08-13-2004, 04:41 PM
Yes rchub that would have been added to the httpd.conf If you take a look at it I would imagin you'll see it. It should be at the bottom of the file and I think that would have been inserted in between something that looks like this:

&lt;VirtualHost *>
ServerName virtualhost.yourdomain.com
ServerAlias www.virtualhost.yourdomain.com
DocumentRoot /path/to/virtualhost/dirctory
&lt;/VirtualHost>

rchub
08-13-2004, 05:21 PM
I found it, it's at the bottom of the file, looks something like this:

&lt;VirtualHost *>
ServerName abc.com
ServerAlias www.abc.com
DocumentRoot /var/www/abc
&lt;Directory />
AllowOverride All
&lt;/Directory>
&lt;/VirtualHost>

Thanks again for everyone's help, my web sites are finally working now.