The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]




Версия для распечатки Пред. тема | След. тема
Новые ответы [ Отслеживать ]
help!  .htaccess, !*! Grayich, 01-Дек-04, 17:38  [смотреть все]
Неполучается разрешить определенный ip и все остальное запретить

пишу
Order Deny,Allow
Deny from all
Allow from 192.168.0.9

в итоге  >>>

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, you@your.address and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


в логах
-----------httpd-access.log
192.168.0.9 - - [01/Dec/2004:16:35:52 +0200] "GET /favicon.ico HTTP/1.1" 404 281 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MyIE2)"
192.168.0.9 - - [01/Dec/2004:16:35:52 +0200] "GET /www/ HTTP/1.1" 500 600 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MyIE2)"
192.168.0.9 - - [01/Dec/2004:16:35:52 +0200] "GET /favicon.ico HTTP/1.1" 404 281 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MyIE2)"
192.168.0.9 - - [01/Dec/2004:16:35:52 +0200] "GET / HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MyIE2)"

-----------httpd-error.log
[Wed Dec  1 16:35:52 2004] [alert] [client 192.168.0.9] /usr/local/www/data/www/.htaccess: order not allowed here

что я нетак делаю ?

Спасибо.

  • help!  .htaccess, !*! gr, 00:09 , 02-Дек-04 (1)
    >Неполучается разрешить определенный ip и все остальное запретить
    >
    >пишу
    >Order Deny,Allow
    >Deny from all
    >Allow from 192.168.0.9
    >
    >в итоге  >>>
    >
    >Internal Server Error
    >The server encountered an internal error or misconfiguration and was unable to
    >complete your request.
    >Please contact the server administrator, you@your.address and inform them of the time
    >the error occurred, and anything you might have done that may
    >have caused the error.
    >
    >More information about this error may be available in the server error
    >log.
    >
    >
    >в логах
    >-----------httpd-access.log
    >192.168.0.9 - - [01/Dec/2004:16:35:52 +0200] "GET /favicon.ico HTTP/1.1" 404 281 "-" "Mozilla/4.0
    >(compatible; MSIE 6.0; Windows NT 5.1; MyIE2)"
    >192.168.0.9 - - [01/Dec/2004:16:35:52 +0200] "GET /www/ HTTP/1.1" 500 600 "-" "Mozilla/4.0
    >(compatible; MSIE 6.0; Windows NT 5.1; MyIE2)"
    >192.168.0.9 - - [01/Dec/2004:16:35:52 +0200] "GET /favicon.ico HTTP/1.1" 404 281 "-" "Mozilla/4.0
    >(compatible; MSIE 6.0; Windows NT 5.1; MyIE2)"
    >192.168.0.9 - - [01/Dec/2004:16:35:52 +0200] "GET / HTTP/1.1" 304 - "-" "Mozilla/4.0
    >(compatible; MSIE 6.0; Windows NT 5.1; MyIE2)"
    >
    >-----------httpd-error.log
    >[Wed Dec  1 16:35:52 2004] [alert] [client 192.168.0.9] /usr/local/www/data/www/.htaccess: order not
    >allowed here
    >
    >что я нетак делаю ?
    >
    >Спасибо.


    директива Options в кнфиге апача.

    в простейшем случае запиши
    Options All

    (достаточно Options Auth  -  вот тут я не помню посмотри доку)

    • help!  .htaccess, !*! Lucky, 08:28 , 02-Дек-04 (2)
      httpd.conf
      ---------------------------------------
      <Directory />
          Options FollowSymLinks
          AllowOverride All
      </Directory>
      ---------------------------------------
      .htaccess
      ---------------------------------------
          Order deny, allow
          Deny from all
          Allow from 192.168.0.9
      ---------------------------------------
      • help!  .htaccess, !*! Grayich, 09:15 , 02-Дек-04 (3)
        -------------httpd.conf
        <Directory />
            Options FollowSymLinks
            AllowOverride All
        </Directory>

        <Directory "/usr/local/www/data">
            Options Indexes FollowSymLinks MultiViews
            AllowOverride AuthConfig
            Order allow,deny
            Allow from all
        </Directory>

        --------------.htaccess
        Order deny,allow
        Deny from all
        Allow from 192.168.0.9

        --------------httpd-error.log
        [Thu Dec  2 08:13:05 2004] [alert] [client 192.168.0.9] /usr/local/www/data/www/.htaccess: order not allowed here

        таже ерунда :(

        • help!  .htaccess, !*! Lucky, 09:19 , 02-Дек-04 (4)
          >-------------httpd.conf
          ><Directory />
          >    Options FollowSymLinks
          >    AllowOverride All
          ></Directory>
          >
          ><Directory "/usr/local/www/data">
          >    Options Indexes FollowSymLinks MultiViews
          >    AllowOverride AuthConfig
          >    Order allow,deny
          >    Allow from all
          ></Directory>
          >
          >--------------.htaccess
          >Order deny,allow
          >Deny from all
          >Allow from 192.168.0.9
          >
          >--------------httpd-error.log
          >[Thu Dec  2 08:13:05 2004] [alert] [client 192.168.0.9] /usr/local/www/data/www/.htaccess: order not
          >allowed here
          >
          >таже ерунда :(


          Смотри настройки конфига апачевского для этой дирктории.
          Там собака и порылась

          • help!  .htaccess, !*! Grayich, 17:54 , 02-Дек-04 (5)
            >Смотри настройки конфига апачевского для этой дирктории.
            >Там собака и порылась

            ну ничегошегьки невижу :(  может еще какая причина может быть ?

            • help!  .htaccess, !*! gr, 02:21 , 03-Дек-04 (6)
              >>Смотри настройки конфига апачевского для этой дирктории.
              >>Там собака и порылась
              >
              >ну ничегошегьки невижу :(  может еще какая причина может быть ?
              >

              директива Options в конфиге апача.

              Options All

              подсказываю 2-й раз тривиальную хрень неправильную кстати чтобы у тебя заработало.

              • help!  .htaccess, !*! Grayich, 09:03 , 03-Дек-04 (7)
                >директива Options в конфиге апача.
                >
                >Options All
                >
                >подсказываю 2-й раз тривиальную хрень неправильную кстати чтобы у тебя заработало.


                -------------httpd.conf
                <Directory />
                    Options FollowSymLinks
                    AllowOverride All
                </Directory>

                <Directory "/usr/local/www/data">
                    Options All
                    AllowOverride AuthConfig
                    Order allow,deny
                    Allow from all
                </Directory>

                И так делал , результат тотже.

                • help!  .htaccess, !*! Lucky, 10:32 , 03-Дек-04 (8)
                  Покажи свой .htaccess как есть ничего не изменяя.
                  Ось какая, апач какой?
                  • help!  .htaccess, !*! Grayich, 10:50 , 03-Дек-04 (9)
                    >Покажи свой .htaccess как есть ничего не изменяя.
                    >Ось какая, апач какой?


                    uname -sr
                    FreeBSD 5.2.1-RELEASE

                    pkg_info |grep apache
                    apache-1.3.33_1     The extremely popular Apache http server.  Very fast, very

                    ----.htaccess
                    cat /usr/local/www/data/www/.htaccess
                    Order allow,deny
                    Allow from 192.168.0.9
                    Deny from All
                    #AuthName "Blah blah blah"
                    #AuthType Basic
                    #AuthUserFile /etc/.htpasswd
                    #require valid-user
                    ---------------------------------------

                    если оставить только
                    AuthName "Blah blah blah"
                    AuthType Basic
                    AuthUserFile /etc/.htpasswd
                    require valid-user

                    то паролирование работает без проблемм

                    • help!  .htaccess, !*! Lucky, 10:58 , 03-Дек-04 (10)
                      >>Покажи свой .htaccess как есть ничего не изменяя.
                      >>Ось какая, апач какой?
                      >
                      >
                      >uname -sr
                      >FreeBSD 5.2.1-RELEASE
                      >
                      >pkg_info |grep apache
                      >apache-1.3.33_1     The extremely popular Apache http server.  
                      >Very fast, very
                      >
                      >----.htaccess
                      >cat /usr/local/www/data/www/.htaccess
                      >Order allow,deny
                      >Allow from 192.168.0.9
                      >Deny from All
                      >#AuthName "Blah blah blah"
                      >#AuthType Basic
                      >#AuthUserFile /etc/.htpasswd
                      >#require valid-user
                      >---------------------------------------
                      >
                      >если оставить только
                      >AuthName "Blah blah blah"
                      >AuthType Basic
                      >AuthUserFile /etc/.htpasswd
                      >require valid-user
                      >
                      >то паролирование работает без проблемм
                      >
                      >
                      >
                      >


                      Конфич апача высылай на мыло.
                      info (a) lucky.ymrc.ru

  • help!  .htaccess, !*! Grayich, 08:03 , 01-Фев-05 (11)
    непрошло и полгода :) вопрос решился, а всегото неправильно написал, вместо:
    Order Deny,Allow
    Deny from all
    Allow from 192.168.0.9

    нужно писать:
    Order Deny,Allow
    Allow from 192.168.0.9
    Deny from All

    теперь возник следующий вопрос, как и можно ли вообще такое сделать, для 192.168.0 доступ обычный, а для всех остальных по паролю ?

    -------------------------------------------------------------
    Order Deny,Allow
    Allow from 192.168.0.9
       AuthName "введи пароль"
       AuthType Basic
       AuthUserFile /etc/.htpasswd
       require valid-user
    Deny from All

    думал что то вроде этого но пароль запрашивает у всех, как исключить запрос пароля у подсети или отдельных ip ?

    • help!  .htaccess, !*! Grayich, 14:59 , 03-Фев-05 (12)
      возможно ли такое вообще средствами apache ?
      для определенных ip доступ без авторизации, для всех остальных через нее ?
      • help!  .htaccess, !*! Lucky, 15:05 , 03-Фев-05 (13)
        >возможно ли такое вообще средствами apache ?
        >для определенных ip доступ без авторизации, для всех остальных через нее ?
        >
        НЕ могу сказать наверняка.
        В таком случае лучше использовать обычную авторизацию из форм. Безопасность на том же уровне, что и средствами апача - т.е. никакая ;)
        при условии, что это не через https )

        • help!  .htaccess, !*! Grayich, 19:14 , 03-Фев-05 (14)
          >НЕ могу сказать наверняка.
          >В таком случае лучше использовать обычную авторизацию из форм. Безопасность на том
          >же уровне, что и средствами апача - т.е. никакая ;)
          >при условии, что это не через https )


          все и с этим разобрался, когда читал howto апача както этого невидел или неправильно понял :)  щас перечитал, сделал и вроде даже работает :)
          http://httpd.apache.org/docs/howto/auth.html#satisfy

          вот мой .htaccess

          AuthType Basic
          AuthName "Бутонь пасворд"
          Require valid-user
          AuthUserFile /etc/.htpasswd
          Order allow,deny
          Allow from 192.168.0
          Satisfy any

          может тут чего лишнего есть ? :)




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру