[+] Debian 9 Mod_rewrite

Konfiguracja serwerów, usług, itp.
ndjaro
Posty: 41
Rejestracja: 13 października 2013, 15:16
Lokalizacja: Nowa Dęba

[+] Debian 9 Mod_rewrite

Post autor: ndjaro »

Witajcie, mam problem z modem rewrite. Włączyłem go a2enmod rewrite dodałem RewriteEngine on w .htaccess

Po zmianie parametru AllowOverride All (etc/apache2/apache2.conf) i wpisaniu adresu IP strona jest niedostępna i wrzuca się sam protokół HTTPS. Dodam, że kod strony i skróconych linków jest na 100% poprawny ponieważ działa dobrze na innym serwerze.

Kod: Zaznacz cały

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>
Ostatnio zmieniony 13 czerwca 2018, 05:56 przez ndjaro, łącznie zmieniany 1 raz.
Awatar użytkownika
LordRuthwen
Moderator
Posty: 2302
Rejestracja: 18 września 2009, 21:45
Lokalizacja: klikash?

Re: Debian 9 Mod_rewrite

Post autor: LordRuthwen »

1. Co oznacza, że strona jest niedostępna (jakiś kod odpowiedzi? Jakieś logi?)
2. Co oznacza, że "wrzuca się sam protokół HTTPS"?
3. Jak wygląda htaccess?
4. Na jakich portach słucha apache?
ndjaro
Posty: 41
Rejestracja: 13 października 2013, 15:16
Lokalizacja: Nowa Dęba

Re: Debian 9 Mod_rewrite

Post autor: ndjaro »

Więc tak troszkę namieszałem sam :) Wywala logi:

Kod: Zaznacz cały

[Tue Jun 12 13:22:23.595148 2018] [:error] [pid 17194] [client 192.168.0.7:58807] PHP Fatal error:  Uncaught Error: Call to undefined function ereg() in /var/www/html/baner.php:30\nStack trace:\n#0 /var/www/html/sklep/index.php(10): require()\n#1 {main}\n  thrown in /var/www/html/baner.php on line 30
[Tue Jun 12 13:22:26.218250 2018] [:error] [pid 17197] [client 192.168.0.7:58806] PHP Notice:  A session had already been started - ignoring session_start() in /var/www/html/baner.php on line 2
[Tue Jun 12 13:22:26.218374 2018] [:error] [pid 17197] [client 192.168.0.7:58806] PHP Fatal error:  Uncaught Error: Call to undefined function ereg() in /var/www/html/baner.php:30\nStack trace:\n#0 /var/www/html/sklep/index.php(10): require()\n#1 {main}\n  thrown in /var/www/html/baner.php on line 30
[Tue Jun 12 13:22:26.847267 2018] [:error] [pid 18068] [client 192.168.0.7:58805] PHP Notice:  A session had already been started - ignoring session_start() in /var/www/html/baner.php on line 2
[Tue Jun 12 13:22:26.847371 2018] [:error] [pid 18068] [client 192.168.0.7:58805] PHP Fatal error:  Uncaught Error: Call to undefined function ereg() in /var/www/html/baner.php:30\nStack trace:\n#0 /var/www/html/sklep/index.php(10): require()\n#1 {main}\n  thrown in /var/www/html/baner.php on line 30
[Tue Jun 12 13:22:27.144777 2018] [:error] [pid 17586] [client 192.168.0.7:58808] PHP Notice:  A session had already been started - ignoring session_start() in /var/www/html/baner.php on line 2
[Tue Jun 12 13:22:27.144882 2018] [:error] [pid 17586] [client 192.168.0.7:58808] PHP Fatal error:  Uncaught Error: Call to undefined function ereg() in /var/www/html/baner.php:30\nStack trace:\n#0 /var/www/html/sklep/index.php(10): require()\n#1 {main}\n  thrown in /var/www/html/baner.php on line 30
[Tue Jun 12 13:22:27.536670 2018] [:error] [pid 17195] [client 192.168.0.7:58810] PHP Notice:  A session had already been started - ignoring session_start() in /var/www/html/baner.php on line 2
[Tue Jun 12 13:22:27.536776 2018] [:error] [pid 17195] [client 192.168.0.7:58810] PHP Fatal error:  Uncaught Error: Call to undefined function ereg() in /var/www/html/baner.php:30\nStack trace:\n#0 /var/www/html/sklep/index.php(10): require()\n#1 {main}\n  thrown in /var/www/html/baner.php on line 30
[Tue Jun 12 13:24:11.513711 2018] [:error] [pid 17196] [client 192.168.0.7:58867] PHP Notice:  A session had already been started - ignoring session_start() in /var/www/html/baner.php on line 2
[Tue Jun 12 13:24:11.513839 2018] [:error] [pid 17196] [client 192.168.0.7:58867] PHP Fatal error:  Uncaught Error: Call to undefined function ereg() in /var/www/html/baner.php:30\nStack trace:\n#0 /var/www/html/sklep/index.php(10): require()\n#1 {main}\n  thrown in /var/www/html/baner.php on line 30
[Tue Jun 12 13:29:56.864091 2018] [mpm_prefork:notice] [pid 16374] AH00169: caught SIGTERM, shutting down
[Tue Jun 12 13:29:57.170834 2018] [mpm_prefork:notice] [pid 22113] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Tue Jun 12 13:29:57.171046 2018] [core:notice] [pid 22113] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jun 12 13:37:48.475526 2018] [:error] [pid 22131] [client 192.168.0.7:59199] PHP Notice:  A session had already been started - ignoring session_start() in /var/www/html/baner.php on line 2
[Tue Jun 12 13:37:48.475700 2018] [:error] [pid 22131] [client 192.168.0.7:59199] PHP Fatal error:  Uncaught Error: Call to undefined function ereg() in /var/www/html/baner.php:30\nStack trace:\n#0 /var/www/html/sklep/zamow.php(9): require()\n#1 {main}\n  thrown in /var/www/html/baner.php on line 30
[Tue Jun 12 13:37:56.307715 2018] [:error] [pid 22132] [client 192.168.0.7:59200] PHP Notice:  A session had already been started - ignoring session_start() in /var/www/html/baner.php on line 2
[Tue Jun 12 13:37:56.307884 2018] [:error] [pid 22132] [client 192.168.0.7:59200] PHP Fatal error:  Uncaught Error: Call to undefined function ereg() in /var/www/html/baner.php:30\nStack trace:\n#0 /var/www/html/sklep/zamow.php(9): require()\n#1 {main}\n  thrown in /var/www/html/baner.php on line 30
[Tue Jun 12 13:37:57.214994 2018] [:error] [pid 22133] [client 192.168.0.7:59201] PHP Notice:  A session had already been started - ignoring session_start() in /var/www/html/baner.php on line 2
[Tue Jun 12 13:37:57.215168 2018] [:error] [pid 22133] [client 192.168.0.7:59201] PHP Fatal error:  Uncaught Error: Call to undefined function ereg() in /var/www/html/baner.php:30\nStack trace:\n#0 /var/www/html/sklep/zamow.php(9): require()\n#1 {main}\n  thrown in /var/www/html/baner.php on line 30
Ale to głównie wina kodu PHP. Mój portal

Kod: Zaznacz cały

www.zpodziemia.pl
dobrze wyświetla się na PHP5.6 na PHP7 ma już problem. Ale będę musiał to rozwiązać raczej na innym forum. Przez to, że trzeba poprawić kod PHP wywalało błąd 500 i strona była niedostępna. Protokół HTTPS uruchamiał się przez kod, który był w .htaccess, musiałem go wyłączyć w sieci lokalnej.

Kod: Zaznacz cały

#RewriteCond %{HTTP_HOST} ^www.zpodziemia.pl [NC]
#RewriteRule ^(.*)$ https://zpodziemia.pl/$1 [L,R=301]

#RewriteCond %{HTTPS} off
#RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI}

#Redirect 301 https://zpodziemia.pl/index.php https://zpodziemia.pl/
Więc póki co będę musiał doinstalować PHP5.6 i w międzyczasie poprawiać kod strony ;)
Awatar użytkownika
Yampress
Administrator
Posty: 6365
Rejestracja: 09 sierpnia 2007, 21:41
Lokalizacja: PL

Re: Debian 9 Mod_rewrite

Post autor: Yampress »

oznacz więc temat jako rozwiązany
viewtopic.php?f=15&t=34136
Zablokowany