How to create Apache htpasswd file in Linux OS?

What is htpasswd?

At times during web development, we will need to prevent the whole world from being able to access a particular website. That’s when Apache htpasswd comes into the picture. htpasswd is usually used together with htaccess.

Tutorial

This tutorial will teach you how to create a htpasswd file using command line.

Creating a htpasswd for the first time

Example

Appending new user to existing htpasswd file

Example

Using htpasswd in htaccess

 

That’s it you are done!

Install APC (Alternative PHP Cache) in CentOS 5/6/7 and Fedora 20/21

APC (Alternative PHP Cache) is a free and open source tool to cache PHP codes.

phpapc

1. Install Dependency Packages for APC

2. Install APC using PECL (PHP Extension Community Library)

Press “Enter” for the following options

2a. [Alternative]

If the above command fails, you can use the following method to install APC as well.

3. Enable APC PHP Extension

4. Restart Apache Service for APC

CentOS

Fedora

5. Verify APC Installation

Create a file named phpinfo.php in Apache web root directory. For example our Apache web root directory is /var/www

And add the following code to the php file

[Optional] If you do not have nano installed

Open the following url in your web browser

Screen Shot 2015-08-02 at 2.48.22 pm

 

6. Enable PHP APC administration

Copy the following file to any web directory that you want. For example, in this case we will copy it to the web root directory.

Open the file apc.php 

In nano editor, use “Ctrl-w” to search for the username and password field to modify.

Open the following link in your web browser.

You should see your APC stats and that’s it!

 

Installing Webmin on CentOS/RHEL 5/6/7 and Fedora 20/21

Wedmin is a web-based interface for you to manage your linux systems. It allows you to setup user accounts, configure cron jobs, manage Apache and many more.

webmin-logo

1. Download Webmin RPM

2. Install Webmin using RPM Command

3. Access Webmin in Browser

Additional Information

Below are the commands to start, stop, restart and get status of Webmin service