dcsimg

Get LILO to Run in Linear Mode, Password-Protecting Web Pages

I have been trying to install Linux, but am unable to boot the machine. Every time I install it from the CD-ROM and then reboot the machine, I get the following output: 01 01 01 01 01 01 01 01 01 It continues infinitely. The LILO prompt never comes up. Is there any way to fix this?

1

I have been trying to install Linux, but am unable to boot the machine. Every time I install it from the CD-ROM and then reboot the machine, I get the following output:

01 01 01 01 01 01 01 01 01
It continues infinitely. The LILO prompt never comes up. Is there any way to fix this?

I have seen this error before. In my experience, the quickest way to fix this is to use the linear option when installing LILO. The first thing you’ll have to do is reboot your system using a rescue disk. Then, run the LILO command as follows:


/sbin/lilo -l -v

That might solve your problem. This causes LILO to run in linear mode -l, with verbose output -v, which allows you to see what the LILO command is actually doing. That way, if you are still encountering any odd problems while running LILO, this will allow you to see it on screen and might just lead you to the root of the problem.

2

I want to password-protect some areas of a Web site that I have just constructed. How can I do this?

The most basic way to password-protect your Web pages is by using the .htaccess function. However, the procedure for setting this up is dependent on whether or not your site uses “virtual hosting.” Since you did not specify, I will incorporate virtual hosting into this step-by-step.

1. First, login to your Web server and cd to the public_html directory. If you are using virtual hosting, switch to the vhost_yourdomain.com/http-docs directory now.


cd ~/public_html

or


cd ~/vhost_yourdomain.com/
http-docs

2. Place all the files you want to pass-word-protect in their own directory. For example: ~/public_html/private/ or ~/vhost_yourdomain.com/http-docs/private.


mkdir private
mv secret_file.html private

3. Tell the Web server that this directory is password-protected. Do this by creating a file named .htaccess in the directory you just created. In our example, the directory we just created is named private.


cd private
vi .htaccess

4. Being aware of case sensitivity, place what you find in Figure One (pg. 100) in that file. Remember to replace yourusernamehere with your own user name and yourdomain.com with your domain name. Also, note that the user names in the require user line are only examples.




Figure One: Creating .htaccess

For SoloActs:

AuthUserFile /home/yourusernamehere/
public_html/private/.htpasswd
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic
<Limit GET POST>
require user gbrown mike
</Limit>

For CompleteActs:

AuthUserFile
/CompleteAct/domains/yourdomain.com/
http-docs/private/.htpasswd
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic
<Limit GET POST>
require user gbrown mike
</Limit>

5. Give passwords to the users you included in the requireuser line (Note that passwords are case sensitive). You will need to run htpasswd for each user you will allow to access your private Web page. All of these should be listed in the require user line.

The htpasswd program will now construct the password file for you. You simply need to supply it with the name of the password file, the user, and the user’s password when you are prompted. (See Figure Two, pg. 100) The passwords will be stored in encrypted form.




Figure Two: Setting up Passwords


# htpasswd -c .htpasswd gbrown
Adding password for gbrown
New password:[enter password here]
Re-type new password:[enter password again]
# htpasswd .htpasswd mike
Adding password for mike.
New password:[enter password here]
Re-type new password:[enter password again]

htpasswd takes two arguments: (1) the name of the password file (commonly .htpasswd), and (2) the name of the user to be given a password. An optional flag (-c) tells htpasswd to create the password file. You will need to use that flag only when you add the first user to a password file that you have just created for the first time (Note that in our example, we did not use the -c flag for giving mike a password, because the password file was created when we assigned a password to gbrown).

The contents of the .htpasswd file look something like this:


gbrown:$1$hH$sCtEGuWVmN2bD5
N22t/hr1
gbrown:$1$vq$FUsPx0Ofzt/AzX
VtLMVrw.


To delete a user, edit the .htpasswd file with vi (or pico, or emacs, or whatever)and delete the line corresponding to that user. To change a user’s password, run htpasswd.htpasswd user. You will be prompted for the user’s new password.

That’s all there is to it! Now if a user attempts to access one of the pages that you put in your private directory (either by trying to access it by its specific URL or by clicking on a link you created in a publicly accessible Web page), they will be prompted for a username and password. You can always protect or unprotect materials by moving them into or out of the private subdirectory.

Remember, this is merely the simplest way to add password-protection to your Web site. There are lots of more sophisticated ways to set up access control. If you would like more information on these more complicated methods, we refer you to the Mosaic User Authentication Tutorial available at http://hoohoo.ncsa.uiuc.edu/docs-1.5/tutorials/user.html.




App Tips


Tech Support MTV Main

Tech Support MTV Controls

* Broadcast 2000 — A very cool application that turns your Linux computer into an off-line editing tool. It can edit, record, composite audio and video, and is even capable of rendering special effects (such as dissolves). With a simple WinTV card and a VCR, you will be able to do some amazing things with a Linux box. Now there’s one more thing Linux is rendering obsolete — $60,000 video editing machines.

* Icecast — This is a powerful streaming media server for Linux. Icecast’s output is based on the MP3 audio format. I use it at home to stream digital audio to a cheap i386 box that is connected to my stereo. With no effort, I am able to run my own non-stop audio channel and enjoy hours and hours of listening pleasure.

* MTV — This cool toy is an MpegTV Player, or more accurately, an MPEG-1 Movie & VCD Player with a very easy-to-use interface. It can be used as a helper application in Netscape. I find it to be among the best video playback devices around. I use it for almost any media in MPEG format that I happen to encounter.



Gaylen Brown is a senior consultant at Linuxcare, Inc. He can be reached at tech@linux-mag.com.

Comments are closed.