Advertisement
Guest User

Untitled

a guest
May 14th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.98 KB | None | 0 0
  1.  
  2. install slapd, php, php-fpm, php-ldap and php-xml
  3. ==========================================
  4. sudo apt-get install slapd
  5. sudo dpkg-reconfigure slapd
  6. sudo apt-get install php
  7. sudo apt-get install php-fpm
  8. sudo apt-get install php-ldap
  9. sudo apt-get install php-xml
  10.  
  11. a2enconf php7.0-fpm
  12. a2enmod proxy_fcgi
  13. a2enmod ssl
  14. a2enmod python
  15. a2enmod authnz_ldap
  16.  
  17. generate SSL/TLS key
  18. ====================
  19.  
  20. mkdir /etc/apache2/ssl
  21. openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt
  22. Enter 127.0.0.1 as FQDN name.
  23.  
  24. install and configure phpldapadmin
  25. ==================================
  26.  
  27. cd /var/local
  28. wget https://github.com/leenooks/phpLDAPadmin/archive/master.zip
  29. unzip master.zip
  30. mv phpLDAPadmin-master phpldapadmin
  31. mv phpldapadmin/config/config.php.example phpldapadmin/config/config.php
  32.  
  33.  
  34. Open the file phpldapadmin/config/config.php,
  35. look for the line and uncomment
  36.  
  37. $servers->setValue('server','host','127.0.0.1');
  38.  
  39.  
  40. ============================================
  41. Modify trac wiki configuration
  42. ============================================
  43.  
  44.  
  45. nano /etc/apache2/sites-enabled/trac.conf
  46.  
  47. <VirtualHost *:443>
  48. ServerName 127.0.0.1
  49. SSLEngine on
  50.  
  51. SSLProtocol all -SSLv2 -SSLv3
  52. SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA2$
  53. SSLHonorCipherOrder on
  54. SSLCompression off
  55.  
  56. SSLOptions +StrictRequire
  57. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_$
  58. LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common
  59.  
  60. SSLCertificateFile /etc/apache2/ssl/apache.crt
  61. SSLCertificateKeyFile /etc/apache2/ssl/apache.key
  62.  
  63. Alias "/phpldapadmin" "/var/local/phpldapadmin"
  64.  
  65.  
  66. <Location /trac>
  67. SetHandler mod_python
  68. PythonInterpreter main_interpreter
  69. PythonHandler trac.web.modpython_frontend
  70. PythonOption TracEnv /var/local/trac
  71. PythonOption TracEnvParentDir /var/local/trac
  72. PythonOption TracUriRoot /trac
  73. PythonOption TracEnv /var/local/trac
  74. PythonOption TracLocale en_US.UTF8
  75. PythonOption PYTHON_EGG_CACHE /tmp
  76. SSLOptions +StdEnvVars
  77. Require all granted
  78. #Require valid-user
  79. Require ssl-verify-client
  80. </Location>
  81.  
  82. <Location /trac/login>
  83. AuthType Basic
  84. AuthName "BlackDeepDive"
  85. AuthBasicProvider "ldap"
  86. AuthLDAPURL "ldap://:389/dc=company,dc=com?uid"
  87. AuthLDAPBindDN "cn=admin,dc=company,dc=com"
  88. AuthLDAPBindPassword abdul
  89. Require valid-user
  90. Require ssl-verify-client
  91. </Location>
  92.  
  93. <Directory "/var/local/phpldapadmin">
  94. SSLOptions +StdEnvVars
  95.  
  96. Require all granted
  97. Require ssl-verify-client
  98. Options Indexes
  99. </Directory>
  100.  
  101.  
  102. </VirtualHost>
  103.  
  104.  
  105.  
  106. disable all HTTP (non-encrypted websites
  107. =========================
  108. open /etc/apache2/ports.conf
  109. comment out the line
  110. #Listen 80
  111.  
  112. service php7.0-fpm restart
  113. service apache2 restart
  114. service slapd restart
  115.  
  116. Enter the following commands so that apache2, php-fpm and slapd services are started automatically every boot:
  117. update-rc.d php7.0-fpm defaults
  118. update-rc.d apache2 defaults
  119. update-rc.d slapd defaults
  120.  
  121.  
  122. Open browser and enter the URL https://127.0.0.1/phpldapadmin
  123. You may need to add a browser exception to this domain (trac.local). This is because
  124. the SSL certificate was signed by an unverified authority (self-signed).
  125.  
  126. login with
  127. user: cn=admin,DC=company,DC=com
  128. password: abdul (as set previously)
  129.  
  130. If the server has been setup correctly, login should be successful.
  131.  
  132. Now create a Generic:POSIX group named Trac Users
  133.  
  134. Then create a Generic:User Account with the following details:
  135.  
  136. First Name: Abdullah
  137. Last Name: Albeladi
  138. userid: albe0032
  139. password: abdul
  140. gid/group: Trac Users (500)
  141.  
  142.  
  143. Open browser and enter the URL https://127.0.0.1/trac
  144. Click login in trac to login. The browser will ask for login details. Enter
  145. user: albe0032
  146. password: abdul
  147.  
  148. This detail from the Generic:User Account.
  149. The login should be successful.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement