httpd-xampp.conf: jak zezwolić na dostęp do zewnętrznego IP poza localhost?

Nie znalazłem właściwej odpowiedzi, która pasuje do mnie w innych pytaniach. Tak wygląda httpd-xampp.conf oryginalnie:

#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
        Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>

Co zrobić, jeśli chcę dodać inny adres IP poza Require local?

Na przykład poniżej Require local próbowałem:

allow from xxx.xxx.xxx.xx

To znaczy:

#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
        Require local
        allow from xxx.xxx.xxx.xx
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>

Ale nadal blokuje dostęp do tego zewnętrznego adresu IP.

Jak to naprawić? Jak Mogę dodać więcej adresów IP, aby umożliwić im dostęp?

Używam XAMPP 5.6.3 w środowisku Windows.

Author: Cameron Samuels, 2015-01-15

9 answers

allow from all nie będzie działać razem z Require local. Zamiast tego spróbuj Require ip xxx.xxx.xxx.xx

Na Przykład:

# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
    Require local
    Require ip 10.0.0.1
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
 25
Author: Deepak Naik,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-12-31 09:51:48

Próbowałem tego i działa. Bądź ostrożny. Oznacza to, że każdy użytkownik sieci LAN ma do niego dostęp. Odpowiedź deepaka Naika jest bezpieczniejsza.

#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
    # Require local
    Require all granted
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
 11
Author: ,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-06-10 12:42:25
<Directory "C:/xampp/">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

Oto co dodałem na końcu pliku \xampp \ apache \ conf \ extra \ httpd-xampp.plik conf przed tagiem

 5
Author: DevelopmentBucket,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-12-27 07:43:47

Dodaj poniższy kod do pliku d:\xampp\apache\conf\extra\httpd-xampp.conf:

<IfModule alias_module>
...
    Alias / "d:/xampp/my/folder/"
    <Directory "d:/xampp/my/folder">
        AllowOverride AuthConfig Limit
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>

Powyżej config może uzyskać dostęp z http://127.0.0.1/

Uwaga: ktoś proponuje zamienić z Require local na Require all granted ale nie działa dla mnie

<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
    # Require local
    Require all granted
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
 1
Author: nguyên,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-09-08 11:55:00
For Ubuntu xampp,
Go to /opt/lampp/etc/extra/
and open httpd-xampp.conf file and add below lines to get remote access,
    Order allow,deny
    Require all granted
    Allow from all

in /opt/lampp/phpmyadmin section.

I uruchom ponownie lampp używając, /opt/lampp/lampp restart

 0
Author: Syed Abdul Qadeer,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-04-10 10:27:26
<Directory "E:/xampp/phpMyAdmin/">
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
Require all granted

 -1
Author: Vinod Tiwari,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-10-21 06:02:38

W systemie windows wszystko, co musisz zrobić, to przejść do wyszukiwania windows Zezwól na aplikację przez Zaporę systemu Windows.kliknij Zezwól innej aplikacji wybierz Apache i oznacz publiczny i prywatny . Otwórz cmd, naciskając przycisk windows + R write cmd niż w CMD write ipconfig znajdź swoje ip . następnie otwórz przeglądarkę Zapisz swój adres ip http://172.16..x i będziesz na stronie startowej XAMPP.jeśli chcesz uzyskać dostęp do swojej lokalnej strony po prostu umieścić / infront swojego ip np http://192.168.1.x / yousite . Teraz możesz uzyskać dostęp do swojej witryny w prywatnych komputerach sieciowych .

Mam nadzieję, że to rozwiąże twój problem

 -1
Author: Ataur Rahman,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-12-02 07:05:10

Allow from all nie będzie działać razem z Require local. Zamiast tego spróbuj wymagać ip xxx.xxx.xxx. xx

Na Przykład:

# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
    Require local
    Require ip 10.0.0.1
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
 -1
Author: Orang22,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-08-03 11:44:46

Otwórz nową aplikację "HTTPD" (serwer Apache) w firewallu

Spójrz na to: https://www.youtube.com/watch?v=eqgUGF3NnuM

 -3
Author: Ben-Tommy Eriksen,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-07-18 09:14:12