Skip to main content
Home
The Baheyeldin Dynasty
The journey for wisdom starts with knowledge
  • Home
  • About
  • Site Map
  • Contact

How to protect a Drupal web site that is under development

  1. Home

By Khalid on 2005/09/14 - 22:45, last updated 2005/09/16 - 19:43

Those who like sausages should not see how they are made -- Anonymous

When you are in the midst of developing a web site, you often do not want anyone to see it while it is work in progress. Things are often broken, look ugly, ...etc.

Keeping humans off is not the only reason as well: you also need to keep out search engine crawlers, comment spam bots, email harvesters, Internet Archiver, ...etc.

At the same time, you want specific people to be able to access the site, such as the theme designer, fellow developers, someone from the client's company, ...etc. 

So here is a step by step guide on how to do that.

These instructions apply to Drupal and non-Drupal installation alike, as long as you are using the Apache web server. The instructions apply mostly to a UNIX/Linux system from the shell command line (e.g. via ssh to your web host server).

Create the password file

You need to create a password file. This password file must be created with the htpasswd command. Make sure you are in the directory that Drupal is installed  (the same directory that has the index.php and .htaccess files).

To use this command, you must say:

htpasswd -c .htpasswd user1

The -c option creates the file for the first time. guest is the ID you will enter the password for. 

You will be prompted for a password. Pick one that has both letters and numbers in it. 

Modify the .htaccess file

Next, in the .htaccess file, add the following lines. 

AuthType Basic
AuthName "Company XYZ Test Server"
AuthUserFile .htpasswd
Require valid-user 

 The AuthName will appear in the popup window in the browser when the user is prompted for a user name and password.

The AuthUserFile points to the file you created in the previous step.

Now you can pass on the user name and password to the client or others who need to see the site while it is under development. 

Further reading

More information can be found in the Apache documentation page on Authentication, Authorization and Access Control. 

Contents: 
Drupal
  • Add comment

Comments

Ramdak (not verified)

robots.txt

Thu, 2005/09/15 - 03:14

Hello Khalid,

This is useful, but adding some info about robots.txt might make it even more so? When I was working on my test sites, I noticed google, msn and other bots (including some nasties) crawling them and it stopped only after I added that file.

Also, one thing that wasn't clear to me was how people will be able to access the content of a dev site unless anonymous access is turned on. Or, am I confusing something else?

Thanks,
Ramdak

  • reply

Boris Mann (not verified)

Or just use securesite

Mon, 2005/09/19 - 17:24

Or, just enable the securesite module, and you can manage access directly through your Drupal site.

  • reply

moshe Weitzman (not verified)

thanks for the writeup ...

Tue, 2005/09/20 - 23:31

thanks for the writeup ... an even more drupalish solution is to use securesite.module from contrib

  • reply

Ber (not verified)

securesite.module

Fri, 2005/09/23 - 07:30

Your system works very fine, but can require a lot of administrative overhead.
"hi ber, i wanted to add some content, but I lost my password, could you please send it to me again. And could you please not make such hard to remember passwords, please rather use my firstname". Sigh. using one user, 'devel' with password 'pwd' or so works fine for hiding from crawlers etc, yet is insecure.

I recently found out about securesite.module. Just install and configure that, and it works like a breeze!

  • reply

Boris Mann (not verified)

Or just use the securesite module

Fri, 2005/10/07 - 03:11

Or just use the securesite module.

  • reply

Current

Pandemic

  • COVID-19
  • Coronavirus

Search

Site map

Contents

  • Family
    • Khalid
    • Ancestry
    • Extended
  • Friends
  • Nokat نكت
  • Writings
    • Cooking
    • Culture
    • Science
    • History
    • Linguistics
    • Media
    • Literature
    • Politics
    • Humor
    • Terrorism
    • Business
    • Philosophy
    • Religion
    • Children
  • Technology
    • Linux
    • Arabization
    • Drupal
      • Association
    • Software
    • Internet
    • Technology in Society
    • Digital Archeology
    • NCR History
    • MidEast Internet
    • Programming
    • Saudi ISPs
    • Miscellaneous
  • Places
    • Canada
      • Weather
    • Egypt
      • Cuisine
      • Alexandria
      • E.G.C.
    • USA
    • Saudi Arabia
  • Interests
    • Astronomy
    • Fishing
    • Photography
    • Snorkeling
    • Nature
    • Photomicroscopy
  • Miscellany

In Depth

  • al-Hakim bi Amr Allah: Fatimid Caliph of Egypt الحاكم بأمر الله
  • Alexandria, Egypt
  • Arabic on the Internet
  • Articles on the history of Muslims and Arabs in the Iberian Peninsula تاريخ المسلمين و العرب في الأند
  • DIY GOTO Telescope Controller With Autoguiding and Periodic Error Correction
  • E.G.C. English Girls College in Alexandria, Egypt
  • Egyptian Cuisine, Food and Recipes مأكولات مصرية
  • George Saliba: Seeking the Origins of Modern Science?
  • Internet Scams and Fraud
  • Mistaken for an Arab or Muslim: Absurdities of being a victim in the War on Terror
  • Mistaken Identity: How some people confuse my site for others
  • One People's Terrorist Is Another People's Freedom Fighter
  • Overview of Google's Technologies
  • Photomicroscopy
  • Pseudoscience: Lots of it around ...
  • Resources for using Google Adsense with Drupal
  • Rockwood Conservation Area, Southern Ontario
  • Selected Symbolic Novels And Movies
  • Snorkeling the Red Sea near Jeddah
  • Updates and Thoughts on the Egyptian Revolution of 2011

Recent Content

Most recent articles on the site.

  • Origin Of COVID-19: Natural Spillover, Lab Leak Or Biological Weapon?
  • Kamal Salibi and the "Israel from Yemen" theory
  • How To Upgrade HomeAssistant Core In A Python Venv Using uv
  • Ancestry - Paternal Side
  • Review of Wait Water Saver For Whole House Humidifiers
more

Most Comments

Most commented on articles ...

  • Another scam via Craigslist: offering more than asking price
  • Warning to female tourists thinking of marrying Egyptians
  • Craigslist classified for used car: Cheque fraud scam
  • Winning the lottery scam email: World Cup South African lottery
  • Email Scam: BMW 5 Series car and lottery winning
more

About Khalid

Various little bits of information ...

  • Khalid Baheyeldin: brief biography
  • Presentations and Talks
  • Youtube Videos
  • GitHub Projects
  • Drupal.org Profile
  • Astrophotography @ Flickr

Sponsored Links

Your Link Ad Here

Tags

Android Mobile Ubuntu Sony OnStep OpenWRT Router Ericsson COVID-19 Rogers Coronavirus Arabic Kubuntu Home Assistant GSM Telescope tablet Spectrum Scam Python 419 Laptop Firefox DIY CPU Conspiracy Comet Balkanization backup App
More

© Copyright 1999-2025 The Baheyeldin Dynasty. All rights reserved.
You can use our content under the Terms of Use.
Please read our privacy policy before you post any information on this site.
All posted articles and comments are copyright by their owner, and reflect their own views and opinions, which may not necessarily be consistent with the views and opinions of the owners of The Baheyeldin Dynasty.

Web site developed by 2bits.com Inc.