Guest User

Untitled

a guest
Mar 1st, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. Method Not Allowed
  2.  
  3. The requested method GET is not allowed for the URL /admin/index.html.
  4.  
  5. /index.html (Public root / auth form)
  6. /admin/index.html (The contents of the folder i wish to protect)
  7.  
  8. <form method="POST" action="/admin">
  9. User: <input type="text" name="httpd_username" value="" />
  10. Pass: <input type="password" name="httpd_password" value="" />
  11. <input type="submit" name="login" value="Login" />
  12. </form>
  13.  
  14. <VirtualHost *:80>
  15. ServerAdmin webmaster@mydomain.com
  16. ServerName mydomain.com
  17. ServerAlias admin.mydomain.com
  18.  
  19. DocumentRoot /var/www/mydomain.com/admin/
  20.  
  21. <Directory /var/www/mydomain.com/admin/>
  22. <LimitExcept GET POST>
  23. Require all denied
  24. </LimitExcept>
  25. Options -ExecCGI -FollowSymLinks -Includes -Indexes -MultiViews
  26. Require all granted
  27. </Directory>
  28.  
  29. <Location /admin>
  30. SetHandler form-login-handler
  31. AuthFormLoginRequiredLocation http://admin.mydomain.com/index.html
  32. AuthFormLoginSuccessLocation http://admin.mydomain.com/admin/index.html
  33. AuthFormProvider file
  34. AuthUserFile /var/www/mydomain.com/admin_inc/.htpasswd
  35. AuthType form
  36. AuthName realm
  37. Session On
  38. SessionCookieName session path=/private;domain=admin.mydomain.com;httponly;secure;
  39. SessionCryptoPassphrase secret
  40. </Location>
  41.  
  42. </VirtualHost>
  43.  
  44. [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/
  45.  
  46. <VirtualHost *:80>
  47. ServerAdmin webmaster@example.com
  48. ServerName example.com
  49. ServerAlias www.example.com
  50.  
  51. DocumentRoot /var/www/example.com/
  52.  
  53. <Location /admin>
  54. # 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
  55. AuthFormLoginRequiredLocation http://www.example.com/index.html
  56. AuthFormLoginSuccessLocation http://www.example.com/admin/index.html
  57. AuthFormProvider file
  58. AuthUserFile /var/www/example.com/.htpasswd
  59. AuthType form
  60. AuthName realm
  61. Session On
  62. SessionCookieName session path=/private;domain=www.example.com;httponly;secure;
  63. SessionCryptoPassphrase secret
  64. </Location>
  65. <Location /admin/dologin>
  66. # Since this location is a sub-path of the previous one, it inherits all parameters above
  67. # It will be the only URL to be able to process form logins, and the only one to require POST
  68. SetHandler form-login-handler
  69. </Location>
  70.  
  71. </VirtualHost>
  72.  
  73. <form method="POST" action="/admin/dologin">
  74. User: <input type="text" name="httpd_username" value="" />
  75. Pass: <input type="password" name="httpd_password" value="" />
  76. <input type="submit" name="login" value="Login" />
  77. </form>
Add Comment
Please, Sign In to add comment