- Create a .htpasswd file:
$ htpasswd -c .htpasswd <username> password:
- Create or add these lines to .htaccess file:
- To protect a directory:
AuthUserFile /full/path/to/.htpasswd AuthType Basic AuthName "Protected Folder" Require valid-user
- To protect a file:
AuthUserFile /full/path/to/.htpasswd AuthType Basic AuthName "Protected Page" <Files "protected_page.html"> Require valid-user </Files>
- To protect a directory:
Tuesday, November 15, 2011
How to protect a web page with htaccess with a password
Sunday, November 13, 2011
Linux Yum commands
Display available updates for installed software
Check for and update a package
Search a package or list all
Install a package
Remove/Uninstall a package
Install/Update group packages
List packages that are not official RHN
Find out which package is a file from
$ yum list updatesApply updates
$ yum updateList installed packages
$ yum list installed <package-name> # e.g. $ yum list installed httpdOR
$ rpm -qa | grep httpd*
Check for and update a package
$ yum update <package-name>
Search a package or list all
$ yum list <package-name/regex/wildcard> $ yum list all # list group packages $ yum grouplist
Install a package
$ yum install <package-name>
Remove/Uninstall a package
$ yum remove <package-name>
Install/Update group packages
$ yum groupinstall "Development Tools" $ yum groupupdate "Development Tools"
List packages that are not official RHN
$ yum list extras
Find out which package is a file from
$ yum whatprovides <filename>
Subscribe to:
Posts (Atom)