2015-07-31 2 views
-1

Я пытаюсь изменить порт по умолчанию openldap (не так опытный с openldap, чтобы я мог что-то делать неправильно).Изменение порта OpenLdap на Centos, установленном с yum

В настоящее время я установить его через менеджер пакетов ня на CentOS 7.1.1503 следующим образом:

ня установить OpenLDAP-сервера

После установки «OpenLDAP-серверов» Я могу запустить сервер OpenLDAP путем вызова службы Slapd начать

однако, когда я пытаюсь изменить порт, отредактировав/и т.д./sysconfig/Slapd например, путем изменения SLAPD_URLS к следующему: # конфигурации сервера OpenLDAP # см «человек Slapd» для получения дополнительной информации

# Where the server will run (-h option) 
# - ldapi:/// is required for on-the-fly configuration using client tools 
# (use SASL with EXTERNAL mechanism for authentication) 
# - default: ldapi:/// ldap:/// 
# - example: ldapi:/// ldap://127.0.0.1/ ldap://10.0.0.1:1389/ ldaps:/// 
SLAPD_URLS="ldapi:/// ldap://127.0.0.1:3421/" 

# Any custom options 
#SLAPD_OPTIONS="" 

# Keytab location for GSSAPI Kerberos authentication 
#KRB5_KTNAME="FILE:/etc/openldap/ldap.keytab" 

(см SLAPD_URLS = "ldapi: /// LDAP: //127.0.0.1: 3421 /") ..

это не удается запустить

service slapd start 
Redirecting to /bin/systemctl start slapd.service 
Job for slapd.service failed. See 'systemctl status slapd.service' and 'journalctl -xn' for details. 



service slapd status 
Redirecting to /bin/systemctl status slapd.service 
slapd.service - OpenLDAP Server Daemon 
    Loaded: loaded (/usr/lib/systemd/system/slapd.service; disabled) 
    Active: failed (Result: exit-code) since Fri 2015-07-31 07:49:06 EDT; 10s ago 
    Docs: man:slapd 
      man:slapd-config 
      man:slapd-hdb 
      man:slapd-mdb 
      file:///usr/share/doc/openldap-servers/guide.html 
    Process: 41704 ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS (code=exited, status=1/FAILURE) 
    Process: 41675 ExecStartPre=/usr/libexec/openldap/check-config.sh (code=exited, status=0/SUCCESS) 
Main PID: 34363 (code=exited, status=0/SUCCESS) 

Jul 31 07:49:06 osboxes runuser[41691]: pam_unix(runuser:session): session opened for user ldap by (uid=0) 
Jul 31 07:49:06 osboxes runuser[41693]: pam_unix(runuser:session): session opened for user ldap by (uid=0) 
Jul 31 07:49:06 osboxes runuser[41695]: pam_unix(runuser:session): session opened for user ldap by (uid=0) 
Jul 31 07:49:06 osboxes runuser[41697]: pam_unix(runuser:session): session opened for user ldap by (uid=0) 
Jul 31 07:49:06 osboxes runuser[41699]: pam_unix(runuser:session): session opened for user ldap by (uid=0) 
Jul 31 07:49:06 osboxes runuser[41701]: pam_unix(runuser:session): session opened for user ldap by (uid=0) 
Jul 31 07:49:06 osboxes slapd[41704]: @(#) $OpenLDAP: slapd 2.4.39 (Mar 6 2015 04:35:49) $ 
               [email protected]:/builddir/build/BUILD/openldap-2.4.39/openldap-2.4.39/servers/slapd 
Jul 31 07:49:06 osboxes systemd[1]: slapd.service: control process exited, code=exited status=1 
Jul 31 07:49:06 osboxes systemd[1]: Failed to start OpenLDAP Server Daemon. 
Jul 31 07:49:06 osboxes systemd[1]: Unit slapd.service entered failed state. 

пс Я также инвалидов firewalld

ответ

0

решение было получено, когда я побежал journalctl -xn, который в основном говорит:

SELinux препятствует/USR/SBIN/Slapd из name_bind доступ к порту tcp_socket 9312.

        ***** Plugin bind_ports (92.2 confidence) suggests ************************ 

            If you want to allow /usr/sbin/slapd to bind to network port 9312 
            Then you need to modify the port type. 
            Do 
            # semanage port -a -t ldap_port_t -p tcp 9312 

            ***** Plugin catchall_boolean (7.83 confidence) suggests ****************** 

            If you want to allow nis to enabled 
            Then you must tell SELinux about this by enabling the 'nis_enabled' boolean. 
            You can read 'None' man page for more details. 
            Do 
            setsebool -P nis_enabled 1 

            ***** Plugin catchall (1.41 confidence) suggests ************************** 

            If you believe that slapd should be allowed name_bind access on the port 9312 tcp_socket by default. 
            Then you should report this as a bug. 
            You can generate a local policy module to allow this access. 
            Do 
            allow this access for now by executing: 
            # grep slapd /var/log/audit/audit.log | audit2allow -M mypol 
            # semodule -i mypol.pp