Nov 17

 

what is .htaccess ?

In several web servers (most commonly Apache), .htaccess (hypertext access) is the default name of directory-level configuration files. A .htaccess file is placed in a particular directory, and the directives in the .htaccess file apply to that directory, and all subdirectories thereof. It provides the ability to customize configuration for requests to the particular directory. The file name starts with a dot because dot-files are by convention hidden files on Unix-like operating systems. A subset of Apache’s .htaccess syntax is also supported by other web servers, such as Sun Java System Web Server and Zeus Web Server.

Setup :

  1. Go to /etc/httpd/conf/httpd.conf and changes
    – Options Indexes Multiviews
    to
    – AllowOverride AuthConfig
     
  2. Restart the httpd service

             #service httpd restart

        3. Create the .htacces usually on the public_html folder

                # vi .htaccess

                AuthType Basic
                AuthName "Stoooop! Limited Access Choy!!!"
                AuthUserFile "/opt/test.passwd"
                Require user adityo

     

        4. Create the user and password

             # /usr/bin/htpasswd -c /opt/test.passwd adityo
             New password:
             Re-Type new password:
             Adding password for user adityo

         5. We can see the user and password on opt/test.passwd or the directory you set the passwd

             #cat /opt/test.passwd
             adityo:VdktHJc9rTipoU
             
 

        6. how to add another user on .hatccess

            #/usr/bin/htpasswd  /home/blogbin/test.passwd prie
             New password:
             Re-type new password:
             Adding password for user prie

            You can see the user on opt/test.passwd

      #cat /opt/test.passwd
         adityo:VdktHJc9rTipoU
         prie:9U6X9AsqI8/02

 

    now you can try to authenticate the .htaccess on your http://localhost / web address

Nov 17

What is RPMforge and DAG ? RPMforge is one of the participating repositories in the rpmrepo project DAG is  a mirror of the RPM repositories provided The Red Hat Enterprise Linux group and  maintained by Dag Wieers as part of the RPMforge project. The RPMforge collaboration repackages many RPMs that are not included as part of the stock Linux distributions, including versions of many packages still in testing. Here is the steps to setup : Installing RPMFOrge

  1. Adding RPMforge Repository :

# yum -y install yum-priorities

  1. Download and install rpmforge :

# wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

# rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm

# rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm

Installing DAG

  1. First we need to Install Dag’s GPG Key, you need to download it first from http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt or http://dag.linux.iastate.edu/dag/RPM-GPG-KEY.dag.txt

# wget http://dag.linux.iastate.edu/dag/RPM-GPG-KEY.dag.txt

2.  Once you have downloaded the key, import it into your keyring with the command

# rpm --import RPM-GPG-KEY.dag.txt 3. Configuring yum To Use This Repository, you can do it by either create the file /etc/yum.repos.d  /dag.repo or add the DAG to /etc/yum.repos.d/CentOS-Base.repo

# vi /etc/yum.repos.d/CentOS-Base.repo

add this line on the bottom :

[dag] name=Dag RPM Repository for Red Hat Enterprise Linux

baseurl=http://dag.linux.iastate.edu/dag/redhat/el5/en/$basearch/dag

gpgcheck=1

enabled=1

Now you can run yum to see the repository works or not. You should see this line on your yum

#yum update

Setting up Update Process Setting up repositories

dag                       100% |=========================| 1.1 kB    00:00

c4-testing                100% |=========================|  951 B    00:00

update                    100% |=========================|  951 B    00:00

rpmforge                  100% |=========================| 1.1 kB    00:00

base                      100% |=========================| 1.1 kB    00:00

kbs-CentOS-Extras         100% |=========================|  951 B    00:00

centosplus                100% |=========================|  951 B    00:00

addons                    100% |=========================|  951 B    00:00

extras                    100% |=========================| 1.1 kB    00:00