Difference between revisions of "Qnap"

From Dietrich Blog (Strato)
Jump to: navigation, search
(Organizing Addressbooks in LDAP)
(LDAP Editoren)
Line 70: Line 70:
 
       dn:
 
       dn:
 
       namingContexts: dc=example,dc=com
 
       namingContexts: dc=example,dc=com
 +
 +
==== Stop OpenLDAP ===
 +
Paul Lee writes:
 +
 +
I know to start openldap, the following command is used.
 +
  slapd -f slapd.conf
 +
but to shutdown openldap, what is the command used  ?
 +
Currently, I am using "pkill slapd" but I think it's not the proper way.
 +
 +
Yes, it is.
 +
 +
Though if you start slapd via some script in /etc/rc.d/, then you should
 +
presumably stop it the same way so rc can keep track of its own magic.
 +
 +
And of course if you have several slapd processes (e.g. while testing)
 +
you'll need to kill the right one.  You can make it write its pid to a
 +
file with the "pidfile" directive in slapd.conf.
 +
  
 
=== LDAP Editoren ===
 
=== LDAP Editoren ===

Revision as of 12:04, 7 January 2011

Siehe auch: Hardware, NAS, Festplatte

Qnap bietet eine große Reihe von Netzwerk-Speicherlösungen (NAS) an.

Bei Qnap ist die generelle Philosophie, ein offenes Linux-System anzubieten; d.h. im Lieferumfang sind enthalten:

  • SSH Server - damit kommt man an das gesamte Linux-System heran...
  • HTTP Server - Apache 2.0 (Konfigurierbar: /etc/config/apache/....)
  • PHP zum Apache (Konfigurierbar: /etc/config/php.ini)
  • MySQL Server
  • Twonky Server
  • OpenLDAP Server

....

Qnap TS-419P Turbo NAS

Im Dezember 2010 habe ich mir die Qnap TS-419P geleistet, weil fast alle miener Festplatten fast voll waren ("rot").

  • CPU:
    • Dies Modell hat als Prozessor einen Marvell 1.2 GHz
    • und 512MB DDRII RAM
  • Festplatten:
    • Geliefert wurde sie mit zwei Platten Seagate Baracuda LP a 2 TB (ST32000542AS).
    • Diese habe ich als RAID-1 konfiguriert und alle Daten von der Buffalo LinkStation übernommen.
    • Zwei weitere Platten des gleichen Typs habe ich gleich nachgeordert.
  • LAN-Ports:
    • Zwei Gigabit Ethernet Ports für Multi-IP-Einstellungen (Port Trunking...) --> Switch

Meiner Videos streame ich nun von dem Qnap-NAS mit Twonky 5. Das funktioniert ganz gut; immerhin funktioniert jetzt die Pause-Taste bei der Wiedergabe am Samsung LED-Fernseher.

  • Fast Forward funktioniert nachwievor nicht

Den Apache-Server auf der Qnap habe ich schon in Betrieb genommen.

OpenLDAP auf Qnap

OpenLDAP ist bei der Qnap als sog. QPKG-PLugin vorhanden.

1. Problem
Wenn man es über die Qnap-Administratoroberfläche herunterlädt bekommt man eine ZIP-Datei. Diese muss man dan erst manuell entpacken (in eine QPKG-Datei) bevor man auf "Installieren" drücken darf.

Nun kann man den LDAP-Server administrien mit dem PhpLdapAdmin: http://192.168.2.164:80/phpldapadmin/

2. Problem
Das Login ist nicnt wie beschrieben dn=[cn=Manager, dc=my-domain, dc=com], passwd=[admin] , sondern dn=[cn=Manager, dc=example, dc=com]

Das rootdn ist damit zwar definiert (in der Datei slapd.conf) als cn=Manager,dc=example,dc=com, aber noch nicht angelegt.

3. Problem
Das Anlegen des rootdn-Objekts über PhpLdapAdmin funktioniert nicht; man kan es aber über eine kleine LDIF-Datei selber machen. Diese LDIF-Datei kann man dann im PhpLdapAdministrator importieren; d.h. ausführen...
      dn: dc=<MY-DOMAIN>,dc=<COM>
      objectclass: dcObject
      objectclass: organization
      o: <MY ORGANIZATION>
      dc: <MY-DOMAIN>

      dn: cn=Manager,dc=<MY-DOMAIN>,dc=<COM>
      objectclass: organizationalRole
      cn: Manager

Be sure to replace <MY-DOMAIN> and <COM> with the appropriate domain components of your domain name. <MY ORGANIZATION> should be replaced with the name of your organization. When you cut and paste, be sure to trim any leading and trailing whitespace from the example.

Installieren des LDAP Servers

s.oben als Qnap Package

Start and Stop the LDAP Server

You are now ready to start the stand-alone LDAP server, slapd(8), by running the command:

     su root -c /usr/sbin/slapd

To check to see if the server is running and configured correctly, you can run a search against it with ldapsearch(1). By default, ldapsearch is installed as /usr/local/bin/ldapsearch:

     ldapsearch -x -b  -s base '(objectclass=*)' namingContexts

Note the use of single quotes around command parameters to prevent special characters from being interpreted by the shell. This should return:

     dn:
     namingContexts: dc=example,dc=com

= Stop OpenLDAP

Paul Lee writes:

I know to start openldap, the following command is used.
 slapd -f slapd.conf
but to shutdown openldap, what is the command used  ?
Currently, I am using "pkill slapd" but I think it's not the proper way.

Yes, it is.

Though if you start slapd via some script in /etc/rc.d/, then you should presumably stop it the same way so rc can keep track of its own magic.

And of course if you have several slapd processes (e.g. while testing) you'll need to kill the right one. You can make it write its pid to a file with the "pidfile" directive in slapd.conf.


LDAP Editoren

Ein bisschen im LDAP herumschauen und auch neue Objekte anlegen etc. kann man mit:

The Configuration File

Use your favorite editor to edit the provided /etc/openldap/slapd.conf example to contain a BDB database definition of the form:

  database bdb
  suffix "dc=<MY-DOMAIN>,dc=<COM>"
  rootdn "cn=Manager,dc=<MY-DOMAIN>,dc=<COM>"
  rootpw secret
  directory /var/openldap-data

Da wir auch Thunderbird-Adressbücher im LDAP verwalten wollen, müssen wir wir das Mozilla-Adressbuch-Schema im slapd.conf mit einbinden:

  include  core.schema
  include  cosine.schema
  include  inetorgperson.schema
  include  mozillaAbPerson.schema

Initialize the LDAP database

Define a text file (say, init.ldif) starting with the following contents:

dn: dc=kr8,dc=de
objectClass: top
objectClass: organization
objectClass: dcObject
description: Description of your domain
o: Something else about your domain
dc: kr8

The argument to both the lefthand dc= and the dc: comes from the suffix entry defined in slapd.conf.

Organizing Addressbooks in LDAP

Source: http://www.sudleyplace.com/LDAP/index.en.html

To separate address books into their own hierarchy, append to the init.ldif file something like the following section:

dn: ou=AddressBooks,dc=kr8,dc=de
objectClass: top
objectClass: organizationalUnit
description: The address books
ou: AddressBooks

To define multiple address books (two in the example below), append the following sections:

dn: o=Home,ou=AddressBooks,dc=kr8,dc=de
objectClass: top
objectClass: organization
description: Home sweet home
o: Home
dn: o=Work,ou=AddressBooks,dc=kr8,dc=de
objectClass: top
objectClass: organization
description: Work sweet work
o: Work

The individual address book's Base DNs are

o=Home,ou=AddressBooks,dc=kr8,dc=de            and
o=Work,ou=AddressBooks,dc=kr8,dc=de

Execute the Initialization File

Die Initialisierungs-Datei init.ldif muss dann ausgeführt werden, z.B. mit einem LDAP-Tool wie:

  • ....



-- 03:50, 1 January 2011 (CET)