WebFaction
Community site: login faq

Hi,

I upload my project files to webfaction. However my site is far from ready. How can I make it ask for an admin password if someone tries to see it using a web browser. I have created the .htpasswd file (found a .htpasswd generator on the web). I think I need to do something with .htaccess file. But I am not sure what.

any help would be appreciated.

asked 30 Nov '10, 05:57

xpanta
623344
accept rate: 0%

edited 30 Nov '10, 06:41


You're definitely on the right track here :)

Our documentation on password protecting your site with a .htaccess file should have you up and running in no time.

permanent link

answered 30 Nov '10, 06:01

David L ♦♦
1.4k13
accept rate: 45%

Thank you. I did as it says and got an internal Server Error (500). I pasted the contents exactly to my .htaccess file. Only I changed this line AuthUserFile /home/<your_username>/webapps/<webapp_name>/.htpasswd to match my details. .htaccess and .htpasswd are in the same directory /home/xpanta/webapps/myproject/

Tried restarting the server,too. Should I wait more time?

EDIT: These are file permissions of the files mentioned above: -rw-rw-r-- (maybe this helps)

(30 Nov '10, 07:03) xpanta

Ah, of course. The instructions above were specifically for 'PHP/CGI/static' applications.

As you're using a Django application you'll need to add a module to your Apache config. Just add this line to your httpd.conf:

LoadModule authn_file_module modules/mod_authn_file.so
(30 Nov '10, 07:11) David L ♦♦

Thanks again. I did as you said but still I get an internal server error. I tried restarting the server. I must have done something wrong.

I can copy paste any details from log files.

(30 Nov '10, 10:00) xpanta

You enable basic authentication in your httpd.conf. You can see an example of doing so in the following forum post:

http://forum.webfaction.com/viewtopic.php?pid=8440#p8440

permanent link

answered 30 Nov '10, 10:20

aaronh ♦♦
1.3k3
accept rate: 34%

Thank you very much.

The title of that thread (you just pointed me to) should have been "Secure Django Development site without an htaccess file" because the only place htaccess is mention is in the title :)

However it did the trick for a moment. Although the logon windows appears and I give username and password after providing my credentials I still get internal server error.

I need to investigate further and maybe return with another set of questions :)

(30 Nov '10, 14:04) xpanta
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×45
×33
×4

question asked: 30 Nov '10, 05:57

question was seen: 5,542 times

last updated: 30 Nov '10, 14:39

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM