Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Method Not Allowed
- The requested method GET is not allowed for the URL /admin/index.html.
- /index.html (Public root / auth form)
- /admin/index.html (The contents of the folder i wish to protect)
- <form method="POST" action="/admin">
- User: <input type="text" name="httpd_username" value="" />
- Pass: <input type="password" name="httpd_password" value="" />
- <input type="submit" name="login" value="Login" />
- </form>
- <VirtualHost *:80>
- ServerAdmin webmaster@mydomain.com
- ServerName mydomain.com
- ServerAlias admin.mydomain.com
- DocumentRoot /var/www/mydomain.com/admin/
- <Directory /var/www/mydomain.com/admin/>
- <LimitExcept GET POST>
- Require all denied
- </LimitExcept>
- Options -ExecCGI -FollowSymLinks -Includes -Indexes -MultiViews
- Require all granted
- </Directory>
- <Location /admin>
- SetHandler form-login-handler
- AuthFormLoginRequiredLocation http://admin.mydomain.com/index.html
- AuthFormLoginSuccessLocation http://admin.mydomain.com/admin/index.html
- AuthFormProvider file
- AuthUserFile /var/www/mydomain.com/admin_inc/.htpasswd
- AuthType form
- AuthName realm
- Session On
- SessionCookieName session path=/private;domain=admin.mydomain.com;httponly;secure;
- SessionCryptoPassphrase secret
- </Location>
- </VirtualHost>
- [Mon May 19 10:26:38.xxxxxx 2014] [auth_form:error] [pid xxxxx] [client xxxxxx:xxxxx] AH01811: the form-login-handler only supports the POST method for /admin/index.html, referer: http://admin.mydomain.com/
- <VirtualHost *:80>
- ServerAdmin webmaster@example.com
- ServerName example.com
- ServerAlias www.example.com
- DocumentRoot /var/www/example.com/
- <Location /admin>
- # Protect all resources under /admin with form auth. Note that the login form is NOT under /admin : not sure this is required, but this is how I got it working
- AuthFormLoginRequiredLocation http://www.example.com/index.html
- AuthFormLoginSuccessLocation http://www.example.com/admin/index.html
- AuthFormProvider file
- AuthUserFile /var/www/example.com/.htpasswd
- AuthType form
- AuthName realm
- Session On
- SessionCookieName session path=/private;domain=www.example.com;httponly;secure;
- SessionCryptoPassphrase secret
- </Location>
- <Location /admin/dologin>
- # Since this location is a sub-path of the previous one, it inherits all parameters above
- # It will be the only URL to be able to process form logins, and the only one to require POST
- SetHandler form-login-handler
- </Location>
- </VirtualHost>
- <form method="POST" action="/admin/dologin">
- User: <input type="text" name="httpd_username" value="" />
- Pass: <input type="password" name="httpd_password" value="" />
- <input type="submit" name="login" value="Login" />
- </form>
Add Comment
Please, Sign In to add comment