
selym
-
Posts
6 -
Joined
-
Last visited
Posts posted by selym
-
-
Hi Ric,
Thanks again for the response. I've commented on your post below.
Ok Try this:Edit file UniServer\udrive\htpasswd\www\.htpasswd
Add your name password pair to the end of this file e.g.
root:root
me:me123
(Note: Change root:root to something else or just delete it.)
Yes, this part above I had already done. This file has my login credentials like so: myusername:password
Copy .htaccess from www to folder UniServer\udrive\www\gallerySo far so good. I had already done the above part as well.
Edit the copied file:Delete its content and add these lines:
AuthName "Uniform Server - Server Access"
AuthType Basic
AuthUserFile /htpasswd/www/.htpasswd
Require user myusername
Note 1: In both of the files replace me with your user name change me123 with a password you want to use.
Note 2: If your name contains spaces enclose it in quotes “me mate”
Okay, this is where I had to make a change. This is what I had in my .htaccess in the gallery subdirectory:
AuthName "Please login to access MyDomain.com"
AuthType Basic
AuthUserFile W:\htpasswd\www\.htpasswd
Require valid-user
and I changed it to...
AuthName "Please login to access MyDomain.com"
AuthType Basic
AuthUserFile /htpasswd/www/.htpasswd
Require user myusername
Access the gallery folder using http://localhost/gallery/ or http://your_domain/gallery/When I use localhost on the local machine, I only have to login once. When I use my domain name on my local machine, it's once as well. It's when I enter my domain name from an external machine, it requires two logins.
Note 3: Make sure these four lines in UniServer\udrive\www\.htpasswd are commented out as shown:#AuthName "Uniform Server - Server Access"
#AuthType Basic
#AuthUserFile /htpasswd/www/.htpasswd
#Require valid-user
Okay, this part threw me for a bit of a loop. Did you mean UniServer\udrive\htpasswd\www\.htpasswd? I don't have an .htpasswd at UniServer\udrive\www and even at UniServer\udrive\htpasswd\www\.htpasswd I don't have anything like the above to comment out. All I have is the myusername:password in that file.
What also throws me off is that after the first login, the domain name reverts to the IP when prompting me for another login. It's like it's not resolving properly...I'm just not sure what I may have done wrong.
If there's any other info I can provide, please don't hesitate to ask. Thanks so much for taking the time to help!
Selym
-
Hi Ric,
Thanks for responding. Although I'm away from the machine at the moment, I can start this reply and give you some info now. I'll have to add the contents of my .htaccess to this post a bit later.
My site is located in UniServer\udrive\www
I am password protecting a picture gallery installed in a subdirectory called gallery. When I click the link to this gallery from my home page (mydomain.com) I get the password prompt, and them my address reverts to my IP (123.45.67.89/gallery and I get the password prompt again.
Thanks very much for the help.
Selym
Without knowing your server configuration it’s difficult to determine the cause of the double login.
Where have you located your site, is it in folder UniServer\udrive\www or UniServer\udrive\ssl?
What is the content of .htaccess file (folder where you located the site).
At each login what does the browser address bar display.
All the best
Ric
-
Thanks, that was very helpful.
Using that first wiki page, I was able to password protect my site, but the problem I'm having is that it prompts me twice. If I login once, the login box pops up again...and if I login again, I'm fine...but if I hit cancel that second time, it still lets me in, but prompts me on every single click going forward until I login again.
Anyone ever experience something like that?
The Wiki is a good place to start! These pages may be of help:
Extending Apache’s basic authentication using mod rewrite.
All the best
Ric
-
Hi nojiri,
Thanks for the quick reply. So it's that easy, huh? And then just point the domain name to the subdirectory instead I'd imagine, huh? Cool, thanks again. I appreciate it.
Selym
Hi Selym,
You can host multiple sites on one Uniform Server by creating separate folders for each site in:
Uniserver>Udrive>www folder. For example:
Uniserver>Udrive>www>Site1
Uniserver>Udrive>www>Site2
etc.
Then, point your browser to each appropirate site to open it, such as:
etc.
Hope that helps.
Cheers! - nojiri
-
I did a quick search for "multiple websites" but didn't find anything, so I hope someone can help.
How would I go about hosting more than one website on one instance of Uniform Server?
Thanks,
Selym
Password Protecting Directories
in Uniform Server - Windows
Posted
Hi Ric,
I checked/tried everything you suggested with no luck. I do appreciate all the time you spent trying to help. I am going to continue to try and hunt down a root cause, and if there's anything else you can think of or info I can provide that may help arrive at a solution, please don't hesitate to ask.
It's a tough one since it could be a number of different things or a combination of many things. While it's not the end of the world if I don't find an answer, my stubborn side does hope I can figure it out eventually.
Thanks again Ric!
Sel