Strona 1 z 1
[+] Debian 9 Mod_rewrite
: 07 czerwca 2018, 20:18
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>
Re: Debian 9 Mod_rewrite
: 07 czerwca 2018, 21:53
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?
Re: Debian 9 Mod_rewrite
: 12 czerwca 2018, 13:46
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
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
Re: Debian 9 Mod_rewrite
: 12 czerwca 2018, 21:05
autor: Yampress
oznacz więc temat jako rozwiązany
viewtopic.php?f=15&t=34136