Home | Hardware | Internet News |Web Hosting |IT Management |Network Storage
LinuxPlanet
Search 
  Power Search | Tips 

 Front Door
 Discussion
 LinuxEngine
 Opinions
 Reports
 Reviews
 Tutorials
 News
 Technology Jobs

 Browse by subject.
Free Newsletter

Linux Planet
Linux Today
More Free Newsletters

Be a Commerce Partner

Compare Prices
Corporate Awards
Cell Phones
Find Software
Remote Online Backup
Auto Insurance Quote
Web Design
Calling Cards
Promotional Pens
Hurricane Shutters
Corporate Gifts
Condos For Sale
Memory Upgrades
Boat Donations



internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Print this article
Email this article
Related Items

•  Setting Up a MySQL Based Website - Part I

Whitepaper: HP StorageWorks All-in-One Storage System: iSCSI Advanced Topics. Click here to open this PDF.

   LinuxPlanet / Tutorials



  Rethinking the Datacenter
Sponsored by HP
Today's datacenters need to increase utilization, get control over power and cooling costs, and align with business objectives. Download this eBook to learn about the challenges facing the data center in a world where digital information is growing at a torrid pace and costs are being held in check. Learn more. »
 
  Putting the Green into IT
Sponsored by HP
Electricity use in data centers is skyrocketing, sending energy bills through the roof, creating environmental concerns and generating negative publicity. "Going Green" means looking to technologies like virtualization, energy-efficient chips and racks, and implementing policies that extend beyond the data center. Learn more. »
 
  Managing the Modern Network
Sponsored by HP
In a global economy where information crosses the globe in an instant, and where Web-based applications power business, it's more important than ever to ensure your network is safe from threats and optimized to deliver the data your business needs. »
 
  Evaluating Software as a Service for Your Business
Sponsored by Webroot
Is Software as a Service just hype, or is something really going on here? See if your company can benefit as SaaS tries to change the face of the enterprise. »
 
  Is Your Disaster Recovery Plan Good Enough?
Sponsored by HP
Preparing for a disaster is more often than not part of the storage planning process, and it is one of the most difficult tasks, since it includes local hardware and software, networking equipment, and a test plan. Learn how to get disaster recovery right. »
 
Setting Up a MySQL Based Website - Part II
Performing User Authentication via MySQL

Andrew Chen
Monday, January 24, 2000 07:49:58 AM

In my last article covering MySQL and Web servers, I talked about creating a guest book that would allow our visitors to leave a message for everyone to see. This was all fine and dandy; however, there is more that we can do with a Web site using mySQL and Apache. In this article covering the creation of a mySQL-based Web site, we'll be talking about using mySQL as a user-authentication database.

One of the many popular features of a Web site is to create a "Members Only" section--a section that can be only accessed by authenticated users. Apache includes facilities to do this without the help of an external module, but only with a flat file or a basic database file.

A flat file can be useful when you'll only have a handful of people, and want an easy way to administer the user list. Since the password database will be text (similar to /etc/passwd), opening it in any text editor will allow you to edit user names and passwords. The drawbacks to flat-file databases? With a large number of entries, authentication becomes slower and administration becomes much harder. When using a database file, access times are somewhat quicker, but administration is harder since the file is not text-based.

For large Web sites, a separate database program is necessary to keep track and authenticate users. This is where mySQL comes in. By creating a mySQL table for authenticating users, or using an existing table, you can administer user list with the mySQL database tool and have fast authentication. For this example, we will be using an existing table of users, which we can assume is the list of "members" for this Web site. Our sample table will look something like this:

username  passwd  groups 
bob  h4oBGB89Z0wZo  user 
josephkoo  hn8HdBZegkRfe  admin 
steve  9AzT4j2RRb8sd  user 
dingo  Cj2y9SjERpTRH  user 

We created this table in the apache database under the table name of members. We have also created a special mySQL username of apache with a password of authenticate. This account will be used to read in the authentication table when a user accesses a "Members Only" page.

Next: Setting up Mod_auth_mysql »

Skip Ahead

1 Performing User Authentication via MySQL
2 Setting up Mod_auth_mysql
3 Protecting a Directory





Linux is a trademark of Linus Torvalds.


internet.com home | search | help! | about us

Jupiter Online Media

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers