פורסם: 25/04/2019 - 17:33
נושא ההודעה: שרת Apache הפסיק להתייחס לקובץ .htaccess
|
הי, שרת אפצ'י שרץ על דביאן, גרסאות אחרונות ועדכניות, הפסיק היום להתייחס לתוכן של קובץ ה-.htaccess
מה שמעניין אותי בקובץ הוא הפניה משם דומיין ללא www לאחד שכולל את הקידומת.
השינויים שביצעתי לפני שהתעוררה הבעיה הם עדכון של Tapatalk על השרת והתקנת open-vm-tools מתוך ה-repo של דביאן.
לא שיניתי את הקבצים htaccess וקובץ ההגדרות של אפצ'י, הוא כולל AllowOverride All
רעיונות?
_________________ איזי גולדנברג
|
|
חזרה לתוכן הדיון |
פורסם: 25/04/2019 - 17:54
נושא ההודעה:
|
ותוכן הקבצים הרלוונטיים:
קוד: | <VirtualHost *:80>
ServerName xyz.co.il
DocumentRoot /var/www/xyz/public_html
AddDefaultCharset UTF-8
<Location />
Allow from all
</Location>
<Directory /var/www/xyz/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
deny from 31.155.168.78
deny from 51.15.58.234
allow from all
</Directory>
</VirtualHost> |
קוד: | RewriteEngine On
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
# AddHandler php-stable .php
RewriteCond %{HTTPS} !=on [NC]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} |
לא נגעתי בהם לפני שהתחילה התופעה.
_________________ איזי גולדנברג
|
|
חזרה לתוכן הדיון |
פורסם: 27/04/2019 - 00:35
נושא ההודעה:
|
יכול להיות שהמודול הרלוונטי (mod_rewrite) לא פועל? ר’ הפלט של a2enmod .
האם יכול להיות שלשרת אין הרשאת קריאה לקובץ?
|
|
חזרה לתוכן הדיון |
פורסם: 27/04/2019 - 16:28
נושא ההודעה:
|
נראה שהמודול מופעל:
קוד: | ~# a2enmod
Your choices are: access_compat actions alias allowmethods asis auth_basic auth_digest auth_form authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authnz_fcgi authnz_ldap authz_core authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex buffer cache cache_disk cache_socache cern_meta cgi cgid charset_lite data dav dav_fs dav_lock dbd deflate dialup dir dump_io echo env expires ext_filter file_cache filter geoip headers heartbeat heartmonitor http2 ident imagemap include info lbmethod_bybusyness lbmethod_byrequests lbmethod_bytraffic lbmethod_heartbeat ldap log_debug log_forensic lua macro mime mime_magic mpm_event mpm_prefork mpm_worker negotiation php7.0 proxy proxy_ajp proxy_balancer proxy_connect proxy_express proxy_fcgi proxy_fdpass proxy_ftp proxy_hcheck proxy_html proxy_http proxy_http2 proxy_scgi proxy_wstunnel ratelimit reflector remoteip reqtimeout request rewrite sed session session_cookie session_crypto session_dbd setenvif slotmem_plain slotmem_shm socache_dbm socache_memcache socache_shmcb speling ssl status substitute suexec unique_id userdir usertrack vhost_alias xml2enc
Which module(s) do you want to enable (wildcards ok)?
|
והלינק אליו:
קוד: | :/etc/apache2/mods-enabled# ls -la ../mods-available/rewrite.load
-rw-r--r-- 1 root root 66 Nov 3 13:34 ../mods-available/rewrite.load
|
ועדיין לא פועל
_________________ איזי גולדנברג
|
|
חזרה לתוכן הדיון |
פורסם: 28/04/2019 - 11:01
נושא ההודעה:
|
האם אתה רואה משהו ב-error.log של אפאצ'י?
|
|
חזרה לתוכן הדיון |
פורסם: 28/04/2019 - 20:53
נושא ההודעה:
|
ה-error.log כמעט נקי לחלוטין, אם אני מסנן את ההודעות שקשורות בעיקר ל-tapatalk, לא נשאר כלום.
זה נראה כאילו שהשרת מתעלם מהקובץ למרות שההגדרה בקובץ ההגדרות של אפצ'י במקום:
קוד: | # grep htac /etc/apache2/apache2.conf
AccessFileName .htaccess
|
אני אנסה להגדיר virtual host חדש כדי לבדוק אם יש בעיה שקשורה למיקום הנוכחי.
_________________ איזי גולדנברג
|
|
חזרה לתוכן הדיון |
פורסם: 29/04/2019 - 13:27
נושא ההודעה:
|
אם זה עבד אצלך בגרסאות מאוד ישנות אבל לא עובד עכשיו: אני לא רואה בהגדרות אצלך:
Require all granted
כמוכן האם השרת יכול לקרוא את הקובץ .htaccess עצמו? (נסה לבדוק בעזרת su או sudo שמורץ כמשתמש של השרת)?
|
|
חזרה לתוכן הדיון |
פורסם: 30/04/2019 - 19:57
נושא ההודעה:
|
COM64 : | נראה שהמודול מופעל:
קוד: | ~# a2enmod
Your choices are: access_compat actions alias allowmethods asis auth_basic auth_digest auth_form authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authnz_fcgi authnz_ldap authz_core authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex buffer cache cache_disk cache_socache cern_meta cgi cgid charset_lite data dav dav_fs dav_lock dbd deflate dialup dir dump_io echo env expires ext_filter file_cache filter geoip headers heartbeat heartmonitor http2 ident imagemap include info lbmethod_bybusyness lbmethod_byrequests lbmethod_bytraffic lbmethod_heartbeat ldap log_debug log_forensic lua macro mime mime_magic mpm_event mpm_prefork mpm_worker negotiation php7.0 proxy proxy_ajp proxy_balancer proxy_connect proxy_express proxy_fcgi proxy_fdpass proxy_ftp proxy_hcheck proxy_html proxy_http proxy_http2 proxy_scgi proxy_wstunnel ratelimit reflector remoteip reqtimeout request rewrite sed session session_cookie session_crypto session_dbd setenvif slotmem_plain slotmem_shm socache_dbm socache_memcache socache_shmcb speling ssl status substitute suexec unique_id userdir usertrack vhost_alias xml2enc
Which module(s) do you want to enable (wildcards ok)?
|
והלינק אליו:
קוד: | :/etc/apache2/mods-enabled# ls -la ../mods-available/rewrite.load
-rw-r--r-- 1 root root 66 Nov 3 13:34 ../mods-available/rewrite.load
|
ועדיין לא פועל |
האם ה-Permissions של קובץ ה-.htaccess השתנו לאחרונה איכשהו?
שים לב כי כדי שזה ייקרא תקין, צריך umask 022 כלומר Permissions של 644.
|
|
חזרה לתוכן הדיון |
פורסם: 03/05/2019 - 13:26
נושא ההודעה:
|
התעכבתי עם התגובה בניסיונות להבין מה קורה כאן.
זה הקובץ המלא:
קוד: |
<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 admin@efly.co.il
# DocumentRoot /var/www/html
DocumentRoot /var/www/eflyco/public_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
<VirtualHost *:80>
ServerName www.efly.co.il
# ServerAlias *.efly.co.il
DocumentRoot /var/www/eflyco/public_html
AddDefaultCharset latin1
<Location />
Allow from all
</Location>
<Directory /var/www/eflyco/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
deny from 31.155.168.78
deny from 51.15.58.234
allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName efly.co.il
DocumentRoot /var/www/eflyco/public_html
AddDefaultCharset UTF-8
<Location />
Allow from all
</Location>
<Directory /var/www/eflyco/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
deny from 31.155.168.78
deny from 51.15.58.234
allow from all
</Directory>
</VirtualHost>
|
השרת בכלל לא מתייחס לVirtualHost האחרון. זה עבד ופשוט הפסיק, לכן נאלצתי להפנות את כל מי שניגש לדומיין ללא www כבר בתחילת הקובץ לתיקייה הרלוונטית.
כלומר יש שתי בעיות, הראשונה: השרת לא ממש מתייחס לקובץ הקונפיגורציה שלו. והשניה: השרת לא מתייחס לתוכן של htaccess.
_________________ איזי גולדנברג
|
|
חזרה לתוכן הדיון |
פורסם: 03/05/2019 - 13:28
נושא ההודעה:
|
וההרשאות על הקובץ נראות נכונות
_________________ איזי גולדנברג
|
|
חזרה לתוכן הדיון |
פורסם: 05/05/2019 - 11:34
נושא ההודעה:
|
לא התייחסת למה שכתבתי על Require.
מעבר לכך: בשביל מה Location? מה קורה אם אתה מסיר אותו?
|
|
חזרה לתוכן הדיון |
פורסם: 05/05/2019 - 11:48
נושא ההודעה:
|
יכול להיות שאחרי עדכון כלשהו נוסף משהו ל-sites-enabled שתופס עדיפות על מה שהיה לך? מה הפלט של:
קוד: | ls -l /etc/apache2/sites-enabled/ |
|
|
חזרה לתוכן הדיון |
פורסם: 15/06/2019 - 18:58
נושא ההודעה:
|
רק הקובץ המקורי:
קוד: | root@efly:~# ls -la /etc/apache2/sites-enabled/
total 8
drwxr-xr-x 2 root root 4096 May 1 06:56 .
drwxr-xr-x 8 root root 4096 May 9 07:51 ..
lrwxrwxrwx 1 root root 35 Mar 22 09:09 000-default.conf -> ../sites-available/000-default.conf
root@efly:~#
|
|
|
חזרה לתוכן הדיון |
|