apache_htaccess_centos
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| apache_htaccess_centos [2015/03/30 07:44] – luke7858 | apache_htaccess_centos [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| \\ | \\ | ||
| - | .htaccess | + | .htaccess |
| + | If you change the apache configuration file then this will allow it for all vhosts created. If you allow the .htaccess in a vhost config file then it will only work for that specific vhost. | ||
| + | |||
| + | You may have to uncomment the section in the **/ | ||
| <sxh bash> | <sxh bash> | ||
| Line 21: | Line 24: | ||
| Order allow,deny | Order allow,deny | ||
| allow from all | allow from all | ||
| - | # Uncomment this directive is you want to see apache2' | ||
| - | # default start page (in / | ||
| - | # | ||
| </ | </ | ||
| </ | </ | ||
| + | \\ | ||
| + | === Basic http File Protection (authentication) === | ||
| This example shows the file being used to protect the specific file that admins use to log into the wordpress site (wp-login.php), | This example shows the file being used to protect the specific file that admins use to log into the wordpress site (wp-login.php), | ||
| Line 37: | Line 38: | ||
| </ | </ | ||
| </ | </ | ||
| - | + | \\ | |
| + | === Document Path Protection (authentication) === | ||
| + | <sxh bash> | ||
| + | < | ||
| + | AuthName " | ||
| + | AuthType Basic | ||
| + | AuthUserFile / | ||
| + | Require valid-user | ||
| + | </ | ||
| + | </ | ||
| \\ | \\ | ||
| === Mod_rewrite apache === | === Mod_rewrite apache === | ||
| Line 64: | Line 74: | ||
| You can use an online generator to produce the .htpasswd username and hashed password or you can do it via the command line. | You can use an online generator to produce the .htpasswd username and hashed password or you can do it via the command line. | ||
| + | == Command Line Example == | ||
| + | Change the path below to where you wish to store the password file | ||
| + | <sxh bash> | ||
| + | htpasswd -c / | ||
| + | </ | ||
| **Example: | **Example: | ||
| Line 74: | Line 88: | ||
| </ | </ | ||
| | | ||
| - | | + | \\ |
| === phpMyAdmin .htaccess === | === phpMyAdmin .htaccess === | ||
apache_htaccess_centos.1427701492.txt.gz · Last modified: 2024/05/23 07:26 (external edit)
