djimno
Anmeldungsdatum: 11. März 2008
Beiträge: 387
Wohnort: Pulheim-Brauweiler
|
Hallo zusammen, ich könnte Kinder kriegen. Folgendes Problem habe ich. Ich möchte auf meinem Home-Server Friendica (http://friendica.com/) zum laufen bekommen. Das kuriose ist, dass ich es schon mal geschafft habe. Seinerzeit aber nicht weiter genutzt habe. Jetzt habe ich nun einen neuen Server und möchte das nun nutzen. Das Problem hatte ich bereits gelöst –> http://forum.ubuntuusers.de/topic/url-rewrite-funtioniert-nicht/. Ich habe auch diesmal, so meine ich, alles nach Beschreibung gemacht. 1. Apache/mod rewrite befolgt
2. Die 000-default in /etc/apache2/sites-enable/ angepasst:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride FileInfo
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo
Order allow,deny
allow from all
</Directory>
... 3. auch die entsprechende Virtual Host Seite angepasst: <VirtualHost *:80>
ServerName friendica.tsv-g.de
ServerAdmin admin@tsv-g.de
DocumentRoot /var/www/friendica
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/friendica/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
... Trotzdem funktioniert das nicht: Umschreiben der URLs in der .htaccess funktioniert nicht. Überprüfe die Konfiguration des Servers. Könnte jemand helfen?
|
thomsen
Anmeldungsdatum: 9. Juni 2010
Beiträge: Zähle...
Wohnort: Hamburg
|
Hallo djimno, wo liegt die .htaccess Datei im Filesystem? Kannst du selbige nochmal hier posten? Ansonsten auch in der sites-enabled die 000-default mal abändern und alle "AllowOverride" auf "All" stellen.
|
djimno
(Themenstarter)
Anmeldungsdatum: 11. März 2008
Beiträge: 387
Wohnort: Pulheim-Brauweiler
|
thomsen schrieb: Hallo djimno, wo liegt die .htaccess Datei im Filesystem? Kannst du selbige nochmal hier posten?
Die .htaccess liegt in: /var/www/friendica/.htaccess
|
djimno
(Themenstarter)
Anmeldungsdatum: 11. März 2008
Beiträge: 387
Wohnort: Pulheim-Brauweiler
|
thomsen schrieb:
Ansonsten auch in der sites-enabled die 000-default mal abändern und alle "AllowOverride" auf "All" stellen.
Habe ich gemacht, leider nichts gebracht Edit: die error.log und access.log geben auch keine weiteren Hinweise.
|
djimno
(Themenstarter)
Anmeldungsdatum: 11. März 2008
Beiträge: 387
Wohnort: Pulheim-Brauweiler
|
Ich habe etwas in der INSTALL.txt gelesen: http://friendica.tsv-g.de/INSTALL.txt Ensure that mod-rewite is installed and working, and that your
.htaccess file is being used. To verify the latter, create a file test.out
containing the word "test" in the top directory of Friendica, make it world
readable and point your web browser to
http://yoursitenamehere.com/test.out
This file should be blocked. You should get a permission denied message.
If you see the word "test" your Apache configuration is not allowing
your .htaccess file to be used (there are rules in this file to block access
to any file with .out at the end, as these are typically used for system logs).
Make certain the .htaccess file exists and is readable by everybody, then
look for the existence of "AllowOverride None" in the Apache server
configuration for your site. This will need to be changed to
"AllowOverride All".
.
If you do not see the word "test", your .htaccess is working, but it is
likely that mod-rewrite is not installed in your web server or is not working.
On most flavour of Linux,
% a2enmod rewrite
% /etc/init.d/apache2 restart
Wenn ich friendica.tsv-g.de/test.out aufrufe, dann bekomme ich die "403 Forbidden" Meldung. Das bedeutet, es kann auf die .htaccess zugegriffen werden. Jetzt verstehe ich die Sache gar nicht mehr, denn dann bedeutet das, dass es irgendwie mit dem Mod_rewrite zusammenhängt, oder? Edit: Habe folgendes gefunden: "The problem is the "E=REMOTE_USER:%{HTTP:Authorization}" section in your rewrite rules. This doesn't work because the php-cgi environment runs on Apache with suExec, and suExec does not allow environment variables set like this." Könnte das Problem durch diesen Umstand kommen?
|
djimno
(Themenstarter)
Anmeldungsdatum: 11. März 2008
Beiträge: 387
Wohnort: Pulheim-Brauweiler
|
Hier die .htaccess: Options -Indexes
AddType application/x-java-archive .jar
AddType audio/ogg .oga
<FilesMatch "\.(out|log)$">
Deny from all
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine on
# Protect repository directory from browsing
RewriteRule "(^|/)\.git" - [F]
# Rewrite current-style URLs of the form 'index.php?q=x'.
# Also place auth information into REMOTE_USER for sites running
# in CGI mode.
# If you have troubles or use VirtualDocumentRoot
# uncomment this and set it to the path where your friendica installation is
# i.e.:
# Friendica url: http://some.example.com
# RewriteBase /
# Friendica url: http://some.example.com/friendica
# RewriteBase /friendica/
#
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
</IfModule>
|
thomsen
Anmeldungsdatum: 9. Juni 2010
Beiträge: 188
Wohnort: Hamburg
|
Das du nicht auf die test.out Datei zugreifen kannst, heißt noch nicht, dass Mod-Rewrite funktioniert bzw. überhaupt aktiviert ist. Denn den ZUgriff verbietest du hier:
| <FilesMatch "\.(out|log)$">
Deny from all
</FilesMatch>
|
Die Rewrite Regel setzen sind jedoch hier:
| <IfModule mod_rewrite.c>
RewriteEngine on
# Protect repository directory from browsing
RewriteRule "(^|/)\.git" - [F]
[...]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
</IfModule>
|
Du bist dir auch 100%ig sicher, das mod_rewrite installiert UND aktiviert ist?
|
djimno
(Themenstarter)
Anmeldungsdatum: 11. März 2008
Beiträge: 387
Wohnort: Pulheim-Brauweiler
|
Hier der Nachweis: djimno@server:~$ sudo a2enmod rewrite
[sudo] password for djimno:
Module rewrite already enabled djimno@server:/etc/apache2/mods-enabled$ ls
alias.conf autoindex.conf mime.conf rewrite.load
alias.load autoindex.load mime.load setenvif.conf
auth_basic.load cgi.load negotiation.conf setenvif.load
authn_file.load deflate.conf negotiation.load ssl.conf
authz_default.load deflate.load php5.conf ssl.load
authz_groupfile.load dir.conf php5.load status.conf
authz_host.load dir.load reqtimeout.conf status.load
authz_user.load env.load reqtimeout.load
|
gnudot
Anmeldungsdatum: 22. April 2008
Beiträge: Zähle...
Wohnort: Hamburg
|
Hallo, die Lösung deines Problemes steht in der .htaccess als kommentar: | # If you have troubles or use VirtualDocumentRoot
# uncomment this and set it to the path where your friendica installation is
# i.e.:
# Friendica url: http://some.example.com
# RewriteBase /
# Friendica url: http://some.example.com/friendica
# RewriteBase /friendica/
#
#RewriteBase /
|
Entferne die Raute vor RewriteBase und es sollte funktionieren.
|
djimno
(Themenstarter)
Anmeldungsdatum: 11. März 2008
Beiträge: 387
Wohnort: Pulheim-Brauweiler
|
Keine Änderung eingetreten.
|
pm3003
Anmeldungsdatum: 27. August 2013
Beiträge: Zähle...
|
Hallo, ich habe auch dieses Problem (PHP 5.2.17). URL rewrite hat auf meiner privaten Webseite funktioniert, aber bei friendica nicht. Der .htaccess von friendca war wirksam (nachdem ich "RewriteBase /" unkommentiert hatte), aber nicht erkannt. Kann es vielleicht an friendica liegen ? Ich habe nicht viele Erfahrung mit PHP, aber die Testfunktion für URL rewrite (fetch_url in network.php, wenn ich mich nicht irre) scheint mir fast zu kompliziert, sie soll die Zeichenkette "ok" oder false zurückgeben, ich habe "ok" in "true" geändert in der Prüfbedingung, und es "funktioniert" unter php 5.3, es ist aber nur ein bypass. Die originale check_htaccess Funktion (mod/install.php Linie 464) 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 | function check_htaccess(&$checks) {
$a = get_app();
$status = true;
$help = "";
if (function_exists('curl_init')){
$test = fetch_url($a->get_baseurl()."/install/testrewrite");
//Hier habe ich "ok" durch true ersetzt
if ($test!="ok") {
$status = false;
$help = t('Url rewrite in .htaccess is not working. Check your server configuration.');
}
check_add($checks, t('Url rewrite is working'), $status, true, $help);
} else {
// cannot check modrewrite if libcurl is not installed
}
}
|
Und hier die originale fetch_url , ich verstehe aber nicht viel 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111 | if(! function_exists('fetch_url')) {
function fetch_url($url,$binary = false, &$redirects = 0, $timeout = 0, $accept_content=Null, $cookiejar = 0) {
$stamp1 = microtime(true);
$a = get_app();
$ch = @curl_init($url);
if(($redirects > 8) || (! $ch))
return false;
@curl_setopt($ch, CURLOPT_HEADER, true);
if($cookiejar) {
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);
}
// These settings aren't needed. We're following the location already.
// @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
// @curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
if (!is_null($accept_content)){
curl_setopt($ch,CURLOPT_HTTPHEADER, array (
"Accept: " . $accept_content
));
}
@curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
//@curl_setopt($ch, CURLOPT_USERAGENT, "Friendica");
@curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Friendica)");
if(intval($timeout)) {
@curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
}
else {
$curl_time = intval(get_config('system','curl_timeout'));
@curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
}
// by default we will allow self-signed certs
// but you can override this
$check_cert = get_config('system','verifyssl');
@curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
$prx = get_config('system','proxy');
if(strlen($prx)) {
@curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
@curl_setopt($ch, CURLOPT_PROXY, $prx);
$prxusr = @get_config('system','proxyuser');
if(strlen($prxusr))
@curl_setopt($ch, CURLOPT_PROXYUSERPWD, $prxusr);
}
if($binary)
@curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
$a->set_curl_code(0);
// don't let curl abort the entire application
// if it throws any errors.
$s = @curl_exec($ch);
$base = $s;
$curl_info = @curl_getinfo($ch);
$http_code = $curl_info['http_code'];
// logger('fetch_url:' . $http_code . ' data: ' . $s);
$header = '';
// Pull out multiple headers, e.g. proxy and continuation headers
// allow for HTTP/2.x without fixing code
while(preg_match('/^HTTP\/[1-2].+? [1-5][0-9][0-9]/',$base)) {
$chunk = substr($base,0,strpos($base,"\r\n\r\n")+4);
$header .= $chunk;
$base = substr($base,strlen($chunk));
}
if($http_code == 301 || $http_code == 302 || $http_code == 303 || $http_code == 307) {
$new_location_info = @parse_url($curl_info["redirect_url"]);
$old_location_info = @parse_url($curl_info["url"]);
$newurl = $curl_info["redirect_url"];
if (($new_location_info["path"] == "") AND ($new_location_info["host"] != ""))
$newurl = $new_location_info["scheme"]."://".$new_location_info["host"].$old_location_info["path"];
$matches = array();
if (preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches)) {
$newurl = trim(array_pop($matches));
}
if(strpos($newurl,'/') === 0)
$newurl = $old_location_info["scheme"]."://".$old_location_info["host"].$newurl;
if (filter_var($newurl, FILTER_VALIDATE_URL)) {
$redirects++;
return fetch_url($newurl,$binary,$redirects,$timeout,$accept_content,$cookiejar);
}
}
$a->set_curl_code($http_code);
$a->set_curl_content_type($curl_info['content_type']);
$body = substr($s,strlen($header));
$a->set_curl_headers($header);
@curl_close($ch);
$a->save_timestamp($stamp1, "network");
return($body);
}}
|
Ich habe es noch nicht versucht, "E=REMOTE_USER:%{HTTP:Authorization}" zu ändern. Hat es etwas gebracht ? Ich bekomme ausserdem mehrere Header-fehler. Vielleicht würde eine frühere Version von friendica helfen, aber ich kann keine archive finden ? ausserdem https://github.com/friendica/friendica/issues/722
|
EffeX7
Anmeldungsdatum: 9. Mai 2009
Beiträge: 83
Wohnort: Berlin
|
Hallo,
ich hatte noch das Problem, dass mein selbst-signiertes Zertifikat irgendwie seit neuestem nicht mehr aktzeptiert wurde. Das hat dazu geführt, dass ich keine neuen Verbindungsanfragen mehr schicken konnte und auf dem Profil von bereits vorhandnen Kontakten nicht als verbunden erkannt wurde. Die Lösung hierzu siehe: https://github.com/friendica/friendica/issues/736#issuecomment-30766624 Was hat das nun mit Deinem Problem zu tun?
Im Zuge meiner Fehleranalyse hatte ich ebenfalls versucht eine neue Friendica Installation auf meinem Server durchzuführen und bin dabei auf das selbe Problem gestoßen wie Du. Soll heißen: URL rewrite wurde immer rot markiert und ich kam bei der (erneuten) Installation nicht weiter. Hier war die Lösung, die Einrichtung nicht über https, sondern über http laufen zu lassen. Das hat funktioniert (mit entsprechenden Einstellung "AllowOverwrite All" und "RedirectBase /friendica"). Vielleicht ist das auch bei Dir das Problem und die Lösung? Viel Erfolg!
|