init_3rdparty oder Webeditor funktioniert nicht mehr?

Status
Für weitere Antworten geschlossen.

oldolson

Benutzer
Mitglied seit
29. Dez 2008
Beiträge
30
Punkte für Reaktionen
0
Punkte
6
Hallo,

ich habe init_3rdparty 1.4 installiert und ausgeführt, es wurde auch korrekt PHPInfo zu den Applikationen hinzugefügt.
Nun habe ich Webeditor (1.0) installiert, und erhalte beim Aufrufen immer:
Rich (BBCode):
<?php
function diff($a,$b){
$max_a = count($a);
$max_b = count($b);
$i = 0; $j = 0; $z = 1;
while ($i < $max_a) {
   if (trim($a[$i]) == trim($b[$j])) { $out[] = array(sprintf("% 6d",$z++), htmlspecialchars($a[$i++])); $j++; }
   else {
     $found=false;
     for ($j1=$j; $j1 <= $max_b; $j1++) 
       if (trim($a[$i]) == trim($b[$j1])) {
          for ($k=$j; $k < $j1; $k++) $out[] = array(sprintf("% 6d",$z),'<span class="red">'.htmlspecialchars($b[$k]).'</span>');
          $j=$j1+1; $j1 = $max_b+1;
          $out[] = array(sprintf("% 6d",$z++),htmlspecialchars($a[$i++])); 
          $found = true;
          }
     if (!$found) $out[] = array(sprintf("% 6d",$z++),'<span class="green">'.htmlspecialchars($a[$i++]).'</span>');
     }   
}
$z--;
while ($j < $max_b) $out[] = array(sprintf("% 6d",$z),'<span class="red">'.htmlspecialchars($b[$j++]).'</span>');
return $out;
}
if (isset($fname2) && $_REQUEST['filename2'] == '') $_REQUEST['filename2'] = $fname2;
if ($_REQUEST['filename'] == '' && $_REQUEST['action'] == '' && isset($fname)) {
  $_REQUEST['filename'] = $fname;
  $_REQUEST['action']   = 'load'; } 
if ($_REQUEST['filename'] <> '') {
  if ($_REQUEST['action'] == 'load') {
    $content=addslashes(@file_get_contents($_REQUEST['filename']));
    setcookie("fname",$_REQUEST['filename']); }
  elseif (substr($_REQUEST['action'],0,4) == 'save') {
    if ($_REQUEST['action'] == 'save_unix') $_REQUEST['content']=str_replace(chr(13).chr(10),chr(10),$_REQUEST['content']);
    if ($_REQUEST['action'] == 'save_mac') $_REQUEST['content']=str_replace(chr(13).chr(10),chr(13),$_REQUEST['content']);    
    @file_put_contents($_REQUEST['filename'], stripslashes($_REQUEST['content']));
    }
  elseif ($_REQUEST['action'] == 'remove')
    @unlink($_REQUEST['filename']);
  elseif ($_REQUEST['action'] == 'mkdir')
    @mkdir($_REQUEST['filename']); 
  elseif ($_REQUEST['action'] == 'rmdir')
    @rmdir($_REQUEST['filename']);
  elseif ($_REQUEST['action'] == 'diff' && $_REQUEST['filename2'] != '') {
    $content=addslashes(@file_get_contents($_REQUEST['filename']));  
    $work_file=@file($_REQUEST['filename']);
    $diff_file=@file($_REQUEST['filename2']);
    unset($item_number);unset($item_array);
    foreach(diff($work_file,$diff_file) as $item) {
      $item_number[]    = $item[0];
      $item_array[]     = str_replace('  ','  ',$item[1]); 
      }
    $diff_number      = @implode('<br/>',$item_number);
    $diff_file_string = @implode('<br/>',$item_array);
    setcookie("fname",$_REQUEST['filename']);      
    setcookie("fname2",$_REQUEST['filename2']);           
  }
  elseif ($_REQUEST['action'] == 'show' && $_REQUEST['filename2'] != '') {
    $diff_file=@file($_REQUEST['filename2']);
    if (!$diff_file) $diff_file=array('');
    unset($item_number);unset($item_array);$z=1;
    foreach($diff_file as $item) {
      $item_number[]     = sprintf("%6d",$z++); 
      $item_array[]      = str_replace(array('  ',chr(9)),
                           array('  ',str_repeat(' ',8)),htmlspecialchars($item));
      }
    $diff_number       = @implode('<br/>',$item_number);
    $diff_file_string  = @implode('<br/>',$item_array); 
    setcookie("fname",$_REQUEST['filename']);      
    setcookie("fname2",$_REQUEST['filename2']);    
  }
} else { $_REQUEST['filename']='/'; } 
if ($_REQUEST['filename2'] == '') $_REQUEST['filename2'] = '/';
$_REQUEST['action'] == '';
?>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Editor: <?php print basename($_REQUEST['filename']) ?></title>
	<script language="Javascript" type="text/javascript" src="edit_area/edit_area_full.js"></script>
	<script language="Javascript" type="text/javascript">
		editAreaLoader.init({
			id: "content"	// id of the textarea to transform	
			,start_highlight: false	
			,font_size: "8"
			,font_family: "Consolas, verdana, monospace"
			,allow_resize: "y"
			,allow_toggle: false
			,language: "en"
			,syntax: "html"	
			,toolbar: "new_document, save, load, |, charmap, |, search, go_to_line, |, undo, redo, select_font, syntax_selection, change_smooth_selection, highlight, reset_highlight, help"
			,syntax_selection_allow: "css,html,js,php,python,vb,xml,c,cpp,sql,basic,pas,brainfuck"
			,load_callback: "my_load"
			,save_callback: "my_save"		
			,plugins: "charmap"
			,charmap_default: "arrows"
				
		});	
		// callback functions
		function my_save(id, content){
      document.getElementById('action').value = 'save';			
		  document.getElementById('content').value=content;
		  init('<?php print $_REQUEST['filename'] ?>','filename'); 			
		}		
		function my_load(id){
      document.getElementById('action').value = 'load';		  
		  init('<?php print $_REQUEST['filename'] ?>','filename');
		}	
var myXMLHTTPRequest = (window.XMLHttpRequest)?
                        new XMLHttpRequest():
                        new ActiveXObject("Microsoft.XMLHTTP");
function LoadHTML(htmlfile){
  myXMLHTTPRequest.open("GET", htmlfile, false); myXMLHTTPRequest.send(null);
  return myXMLHTTPRequest.responseText;
}
function init(p,fn) {
  var d = LoadHTML('dir.php?dir='+p+'&fn='+fn);
	document.getElementById('fileselect').style.display='block';  
  co=document.getElementById('fileselect');
  co.innerHTML=d;
  }		
</script>
<style>
td{font:11px Verdana;text-align:right;padding-right:6px}
tr{cursor:pointer}
#fileselect{position:absolute;top:50px;left:300px;width:480px;height:400px;
background-color:#bbf;overflow:auto;padding:5px;border:1px solid #666;display:none;}
#filename,#filename2{font:10px verdana;width:300px}
input{font:10px verdana;}
#cancel{font:11px Verdana;position:absolute;top:5px;right:5px;width:9px;hight:10px;
color:#fff;padding:3px;cursor:pointer;background-color:#222}
.l{text-align:left}
.view              { width:613px;height:387px;font:11px Consolas;
                     border:1px solid #888;overflow:auto;background-color:#fff }
.viewnumber        { width:36px;float:left;text-align:right;padding-right:3px;
                     border-right:1px solid #444;color:#999; }
.viewcontent       { width:1200px;padding-left:42px; }
.red               { background:#edd; }
.green             { background:#ded; }
</style>
</head>
<body style="margin-top:0px">
<form id="f" name="f" method="post" action="editor.php">
<input type="hidden" name="action" id="action" value="">
<div style="font:11px verdana;margin-bottom:2px;"><input type="text" ondblclick="init(this.value,this.name)"
name="filename" id="filename" style="width:270px" value="<?php print $_REQUEST['filename'] ?>">
<input type="button" value="load" onclick="document.getElementById('action').value='load';f.submit();">
<input type="button" value="save DOS [CR+LF]" onclick="document.getElementById('action').value='save_dos';
document.getElementById('content').value=editAreaLoader.getValue('content');f.submit();">
<input type="button" value="save UNIX [LF]" onclick="document.getElementById('action').value='save_unix';
document.getElementById('content').value=editAreaLoader.getValue('content');f.submit();">
<input type="button" value="save MAC [CR]" onclick="document.getElementById('action').value='save_mac';
document.getElementById('content').value=editAreaLoader.getValue('content');f.submit();">
<input type="button" value="remove" onclick="document.getElementById('action').value='remove';f.submit();">
<input type="button" value="mkdir" onclick="document.getElementById('action').value='mkdir';f.submit();">
<input type="button" value="rmdir" onclick="document.getElementById('action').value='rmdir';f.submit();"><br/>
<input type="text" ondblclick="init(this.value,this.name)" style="width:278px;margin-left:50.2%"
name="filename2" id="filename2" value="<?php print $_REQUEST['filename2'] ?>">
<input type="button" value="diff" onclick="document.getElementById('action').value='diff';f.submit();">
<input type="button" value="show" onclick="document.getElementById('action').value='show';f.submit();">
</div>
<div style="margin-top:-21px"> 
<textarea id="content" style="height:500px;width:50%;float:left;" name="content">
<?php print htmlspecialchars(stripslashes($content)) ?></textarea>
<div class="view" style="position:absolute;top:44px;left:50.1%;height:475px;width:49.6%;" id="diff">
<div class="viewnumber"><?php print $diff_number ?></div>
<div class="viewcontent"><?php print $diff_file_string ?></div></div>
</div>
</form>
<div id="fileselect"><div>
</body>
</html>

Woran kann das liegen? Ich hatte die diskstation erst vor kurzem resettet, der Webeditor hatte im Anschluss auch kurzzeitig funktioniert, warum es jetzt auf einmal nicht mehr geht, weiß ich nicht. :)

Grüße,
Olli
 

itari

Benutzer
Mitglied seit
15. Mai 2008
Beiträge
21.900
Punkte für Reaktionen
14
Punkte
0
Im Paketmanagement noch mal das Skript init_3rdparty 'Ausführen'. Nach jedem neuen Installieren sind ja die Einstellungen in der httpd.conf und der php.ini wieder zurückgesetzt und man muss sie durchs 'Ausführen' neu setzen. Falls 'Ausführen' ausgegraut ist, einfach 'Stopp' und dann wieder starten. Falls das auch nicht geht, deinstallieren und nochmal neu installieren.

Itari
 

oldolson

Benutzer
Mitglied seit
29. Dez 2008
Beiträge
30
Punkte für Reaktionen
0
Punkte
6
Hallo itari,

das habe ich beides mehrfach gemacht, nach dem Ausführen ist das Interface auch kurz nicht erreichbar und anschließend kann ich auch diese Oberfläche unter http://diskstation:5002/ aufrufen. Ich verstehe es daher beim besten Willen nicht, warum beim Webeditor der PHP-Code angezeigt wird.

Noch eine Idee?

Grüße,
Olli
 

itari

Benutzer
Mitglied seit
15. Mai 2008
Beiträge
21.900
Punkte für Reaktionen
14
Punkte
0
Weil in der httpd.conf-sys die Dateiendung .php und das Zusammenarbeiten mit PHP noch nicht eingetragen ist ... das ist der Grund, warum du die PHP-Datei so siehst. Warum bei dir das 3rd-party-init nicht geht ... kann ich so auch nicht sagen. Aber es produziert ja ein kleines Protokoll ... vielleicht kannst das ja noch mal posten.

Itari
 

oldolson

Benutzer
Mitglied seit
29. Dez 2008
Beiträge
30
Punkte für Reaktionen
0
Punkte
6
Hier das Protokoll

Rich (BBCode):
Mon Mar 23 20:39:09 2009 installed
step1.conf added
/usr/syno/etc/rc.d/S97apache-sys.sh: system httpd stopped
Start System Apache Server .....  -f /usr/syno/apache/conf/httpd.conf-sys
/usr/syno/etc/rc.d/S97apache-sys.sh: system httpd started
Mon Mar 23 20:39:24 2009 started

Hier mal meine httpd.conf-sys:
Rich (BBCode):
#
#
ServerRoot "/usr/syno/apache"

#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 5000

#
# Dynamic Shared Object (DSO) Support
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule ssl_module modules/mod_ssl.so

<IfModule !mpm_netware_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.  

#
User root
Group root
</IfModule>

# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'

# virtual host being defined.
#

#
ServerAdmin admin

# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName *:5000

#
# DocumentRoot: The directory out of which you will serve your

# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/usr/syno/synoman"

#
# Each directory to which Apache has access can be configured with respect

# features.  
#
<Directory />
    Options ExecCGI FollowSymLinks MultiViews
    AllowOverride All
</Directory>



#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/usr/syno/synoman">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options ExecCGI FollowSymLinks MultiViews

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.htm index.cgi
</IfModule>

#

#
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

#

# container, that host's errors will be logged there and not here.
#
#ErrorLog /var/log/httpd-error-sys.log
ErrorLog /dev/null
TraceEnable off

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel debug

<IfModule log_config_module>
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    #

    #
    #CustomLog /var/log/httpd-access-sys.log combined
    CustomLog /dev/null combined

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    #CustomLog /usr/syno/apache/logs/access_log combined
</IfModule>

<IfModule alias_module>
    #

    #ScriptAlias /cgi-bin/ "/usr/syno/apache/cgi-bin/"

    #
    # Synology Web File Station direct download URL alias
	ScriptAliasMatch ^/wfmdownload/(.*) "/usr/syno/synoman/webfm/webUI/file_download.cgi/$1"
	ScriptAliasMatch ^/wfmdirectlogin(.*) "/usr/syno/synoman/webfm/webUI/directlogin.cgi$1"
	Alias /wfmlogindialog.js  /usr/syno/synoman/webfm/webUI/directlogin.js
</IfModule>

<IfModule cgid_module>
    #
    # ScriptSock: On threaded servers, designate the path to the UNIX
    # socket used to communicate with the CGI daemon of mod_cgid.
    #
    #Scriptsock logs/cgisock
</IfModule>

#
# "/usr/syno/apache/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
#<Directory "/usr/syno/apache/cgi-bin">
#    AllowOverride None
#    Options None
#    Order allow,deny
#    Allow from all
#</Directory>


DefaultType text/plain

<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig /usr/syno/apache/conf/mime.types

    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #
    AddEncoding x-compress Z
    AddEncoding x-gzip gz tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType image/x-icon .ico


    AddHandler cgi-script .cgi

    # For type maps (negotiated resources):
    #AddHandler type-map var


</IfModule>


MIMEMagicFile /usr/syno/apache/conf/magic

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
ErrorDocument 500 /error.cgi?status=500
ErrorDocument 404 /error.cgi?status=404
ErrorDocument 403 /error.cgi?status=403
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
#EnableMMAP off
#EnableSendfile off


# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf-sys

# Multi-language error messages
#Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
Include conf/extra/httpd-autoindex.conf-sys

# Language settings
Include conf/extra/httpd-languages.conf-sys

# User home directories
#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
#Include conf/extra/httpd-info.conf

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
#Include conf/extra/httpd-dav.conf

# Various default settings
Include conf/extra/httpd-default.conf-sys

<IfDefine SSL>
# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf-sys
#
# Note: The following must must be present to support
#       starting without SSL on platforms with no /dev/random equivalent
#       but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
</IfDefine>

LoadModule deflate_module modules/mod_deflate.so

<IfModule mod_deflate.c>
        DeflateCompressionLevel 2
        AddOutputFilterByType DEFLATE text/html text/plain text/xml
        AddOutputFilter DEFLATE js css
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.[0678] no-gzip
        BrowserMatch \bMSIE\s7  !no-gzip !gzip-only-text/html
</IfModule>

LoadModule headers_module modules/mod_headers.so

<Files *.js>
Header unset Etag
</Files>

<Files *.css>
Header unset Etag
</Files>

Include /usr/syno/etc/httpd-filestation.conf-sys
#step1
# ------------------------------------------------------------------------------------
# Integration of Init_3rdparty
#
Listen 5002
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php5_module /lib/libphp5.so
AddType application/x-httpd-php .php

RewriteEngine On
RewriteCond %{SERVER_PORT} =5002
RewriteRule ^/$ http://%{SERVER_NAME}:5000/webman/3rdparty/Init_3rdparty/index.php [R]

Include /usr/syno/synoman/webman/3rdparty/Init_3rdparty/php.conf
# ------------------------------------------------------------------------------------
#step1
PS: Ich habe hier für den Post ein paar der #Comment-Zeilen gelöscht, da ein Post auf 10000 Zeichen begrenzt ist

Was müsste ich manuell ändern, damit es funktioniert?
Grüße,
Olli
 

Trolli

Benutzer
Mitglied seit
12. Jul 2007
Beiträge
9.848
Punkte für Reaktionen
1
Punkte
0
Nix. Das müsste so funktionieren. Starte doch einfach mal die ganze Kiste neu. Mal sehen was dann passiert...
 

oldolson

Benutzer
Mitglied seit
29. Dez 2008
Beiträge
30
Punkte für Reaktionen
0
Punkte
6
Nix. Das müsste so funktionieren. Starte doch einfach mal die ganze Kiste neu. Mal sehen was dann passiert...

Habe ich schon mehrfach gemacht, gleiches Ergebnis :(
 

oldolson

Benutzer
Mitglied seit
29. Dez 2008
Beiträge
30
Punkte für Reaktionen
0
Punkte
6
Das gibts doch nicht! Hab's grad im Internet Explorer aufgerufen, hier funktioniert alles, bei Firefox klappte es nach wie vor nicht. Habe jetzt den Cache vom Firefox geleert und jetzt läufts auch hier. *freu* Sowas.. :)
Danke trotzdem nochmal für die Hilfe!
 

itari

Benutzer
Mitglied seit
15. Mai 2008
Beiträge
21.900
Punkte für Reaktionen
14
Punkte
0
Laufen eigentlich andere PHP-Skripte? phpinfo()????

Itari
 

jahlives

Benutzer
Mitglied seit
19. Aug 2008
Beiträge
18.275
Punkte für Reaktionen
4
Punkte
0
Mal ne Frage:
Kann diese RewriteCond überhaupt greifen? imho müsste sich der Apache darüber beschweren. Ich meine diesen Teil
Code:
RewriteCond %{SERVER_PORT} =5002
 

itari

Benutzer
Mitglied seit
15. Mai 2008
Beiträge
21.900
Punkte für Reaktionen
14
Punkte
0
Warum sollte das nicht gehen? Es funzt zumindest bei mir und ich hab darüber keine Beschwerden hier gelesen.

Du weißt sicherlich, warum ich das mache? Weil der Paket-Manager leider keine Pfade zulässt für den Aufruf von Admin-Seiten. Das Höchste ist die Zurodnung eines Ports. Also hab ich kurzerhand den Port 5002 noch mit LISTEN 5002 aufgemacht und rewrite den dann nach Port 5000 mit nem schönen Pfad. Einfach mal die httpd.conf-Direktiven genau anschauen, dann wirds klar.

Itari
 

jahlives

Benutzer
Mitglied seit
19. Aug 2008
Beiträge
18.275
Punkte für Reaktionen
4
Punkte
0
Ich bin bis heute davon ausgegangen, dass RewriteCond's reguläre Ausdrücke prüfen und keine "Vergleiche" mit =
Upps gerade mal beim modrewrite.de vorbeigeschaut und gesehen, dass = auch gehen müsste (tschuldigung und Asche auf mein Haupt)
Ich habe solche Conds bis anhin so geschrieben
Code:
RewriteCond %{SERVER_PORT} ^5002$
Gruss

tobi
 

itari

Benutzer
Mitglied seit
15. Mai 2008
Beiträge
21.900
Punkte für Reaktionen
14
Punkte
0
Ich bin bis heute davon ausgegangen, dass RewriteCond's reguläre Ausdrücke prüfen und keine "Vergleiche" mit =
Upps gerade mal beim modrewrite.de vorbeigeschaut und gesehen, dass = auch gehen müsste (tschuldigung und Asche auf mein Haupt)

Jaja ... die kleinen Vorurteile ... machen einem das Leben schwer. Tipp: Geh immer davon aus, dass nichts wirklich unmöglich ist. :D

Itari
 
Status
Für weitere Antworten geschlossen.
 

Kaffeautomat

Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.

Als Dankeschön schalten wir deinen Account werbefrei.

:coffee:

Hier gehts zum Kaffeeautomat