DamageDMG | 2019-06-16 10:50:38 UTC | #1
Witam, zbugowało mi się apache lub php, nie mam pojęcia, nie siedzę w temacie stron już dawno, może ktoś miał podobny problem, lub wie jak mi pomóc.
A więc tak, przechodząc po domena.pl/
Lecz jeśli wejdziemy na
Konkretny przykład: https://github.com/Verlikylos/vMCShop - pierwszy lepszy sklep pod mc z gita, sama strona po skonfigurowaniu działa, lecz po wejściu w zakładkę /admin lub /panel pokazuje się błąd 404 od apache z nieodnalezieniem zakładki + na localhoscie dokładnie tak samo skonfigurowany sklep działa tak jak powinien.
Apache/2.4.25 (Debian)
PHP 7.0.33-0+deb9u3 (cli) (built: Mar 8 2019 10:01:24) ( NTS )
Debian 9 Stretch
Lumpiasty | 2019-06-15 21:01:27 UTC | #2
Jeśli nie wskażesz konkretnego pliku, a folder (/admin, nie /admin/index.php) to Apache domyślnie szuka pliku index.html. Nie ma go, wywala 404. Musisz przestawić Apache, aby szukał index.php.
Do .htaccess dodaj
DirectoryIndex index.php
DamageDMG | 2019-06-15 21:06:35 UTC | #3
Nic nie dało.
Aktualnie w .htaccess w tym przykładowym skrypcie który też nie działa mam
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L]
Generalnie tak jak pisałem wyżej, na localhoście wszystko działa, na vps już nie - konfiguracja samego skryptu też jest poprawna, bo nie ważne, czy jest to ten skrypt który wymieniłem wyżej, czy coś mojego, na tym vps tak czy siak nie działa.
DamageDMG | 2019-06-15 21:08:39 UTC | #4
W sumie i tak źle mnie zrozumiałeś, nie chodzi mi o wskazanie przez domenę folderu w którym mają się znajdować zakładki strony, lecz to skrypt ma generować odniesienie, pobierz ten skrypt i sprawdź to jeśli masz chwilkę ;)
Nieznajomy11 | 2019-06-16 10:39:09 UTC | #5
Dodaj do VirtualHost
a w bloku Directory
poniższą dyrektywę.
AllowOverride All
https://httpd.apache.org/docs/2.4/mod/core.html#allowoverride
DamageDMG | 2019-06-16 01:10:24 UTC | #6
Coś źle robię, lub nie pomaga, mógłbyś dokładniej opisać jak to wykonać?
Nieznajomy11 | 2019-06-16 02:34:31 UTC | #7
A jak obecne wygląda twoja konfiguracja virtualhosta?
kotyk | 2019-06-16 09:18:49 UTC | #8
Tu przypadkiem nie chodzi o mod_rewrite?
Może spróbuj z poleceniem
sudo a2enmod rewrite
DamageDMG | 2019-06-16 10:07:56 UTC | #9
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Jest to “000-default.conf”
Nieznajomy11 | 2019-06-16 10:39:02 UTC | #10
<VirtualHost *:80>
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory "/var/www/html">
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
DamageDMG | 2019-06-16 10:28:28 UTC | #11
# Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
[Sun Jun 16 06:25:05.974874 2019] [mpm_prefork:notice] [pid 18013] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Sun Jun 16 06:25:05.974933 2019] [core:notice] [pid 18013] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 16 12:03:01.736159 2019] [mpm_prefork:notice] [pid 18013] AH00169: caught SIGTERM, shutting down
[Sun Jun 16 12:03:01.846757 2019] [mpm_prefork:notice] [pid 22790] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Sun Jun 16 12:03:01.846865 2019] [core:notice] [pid 22790] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 16 12:21:03.229899 2019] [mpm_prefork:notice] [pid 22790] AH00169: caught SIGTERM, shutting down
[Sun Jun 16 12:21:03.334278 2019] [mpm_prefork:notice] [pid 23322] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Sun Jun 16 12:21:03.334373 2019] [core:notice] [pid 23322] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 16 12:21:06.464983 2019] [core:alert] [pid 23324] [client 141.x.77.x:12540] /var/www/html/basic/.htaccess: <Directory not allowed here
[Sun Jun 16 12:21:09.938410 2019] [core:alert] [pid 23326] [client 141.x.77.x:15844] /var/www/html/basic/.htaccess: <Directory not allowed here
[Sun Jun 16 12:22:12.355883 2019] [core:alert] [pid 23325] [client 141.x.77.x:16380] /var/www/html/basic/.htaccess: <Directory not allowed here
[Sun Jun 16 12:22:13.105392 2019] [core:alert] [pid 23327] [client 141.x.77.x:16980] /var/www/html/basic/.htaccess: <Directory not allowed here
[Sun Jun 16 12:22:13.496506 2019] [core:alert] [pid 23323] [client 141.x.77.x:17436] /var/www/html/basic/.htaccess: <Directory not allowed here
[Sun Jun 16 12:22:19.575926 2019] [core:alert] [pid 23326] [client 141.x.77.x:22922] /var/www/html/basic/.htaccess: <Directory not allowed here
[Sun Jun 16 12:22:47.740824 2019] [core:alert] [pid 23325] [client 141.x.77.x:48114] /var/www/html/basic/.htaccess: <Directory not allowed here
[Sun Jun 16 12:22:48.517644 2019] [core:alert] [pid 23327] [client 141.x.77.x:48828] /var/www/html/basic/.htaccess: <Directory not allowed here
[Sun Jun 16 12:22:48.798526 2019] [core:alert] [pid 23323] [client 141.x.77.x:49090] /var/www/html/basic/.htaccess: <Directory not allowed here
[Sun Jun 16 12:22:49.013743 2019] [core:alert] [pid 23373] [client 141.x.77.x:49328] /var/www/html/basic/.htaccess: <Directory not allowed here
DamageDMG | 2019-06-16 10:30:42 UTC | #12
Bez tego /basic
oczywiście też próbowałem - to samo.
Nieznajomy11 | 2019-06-16 10:34:42 UTC | #13
Te, ale to jest konfiguracja virtualhosta, a nie do .htaccess
? To ma zastąpić ten cały “000-default.conf”.
DamageDMG | 2019-06-16 10:35:21 UTC | #14
No tak, tam to wkleiłem, nawet pokusiłem się o restart apacha :sweat_smile:
Nieznajomy11 | 2019-06-16 10:36:03 UTC | #15
[quote=”DamageDMG, post:11, topic:11275”]
/var/www/html/basic/.htaccess: <Directory not allowed here
[/quote]
Brzmi jednak jakby było to w innym pliku.
DamageDMG | 2019-06-16 10:38:15 UTC | #16
O kurdę, dzięki, że mi to podciągnąłeś, wczoraj koło 3 w nocy to dodałem też do htaccessu, sam zapomniałem, poza tym działa, dzięki wielkie za zainteresowanie się i pomoc :grin:
system | 2019-07-18 10:49:34 UTC | #17
Ten temat został automatycznie zamknięty 32 dni po ostatnim wpisie. Tworzenie nowych odpowiedzi nie jest już możliwe.