openldap安裝


手動打開openldap調式信息

===========================

os-weizb@ubuntu:/etc/samba$ which slapd
/usr/sbin/slapd
os-weizb@ubuntu:/etc/samba$ sudo /usr/sbin/slapd -d 256
@(#) $OpenLDAP: slapd 2.4.21 (Dec 19 2011 15:40:04) $
        buildd@allspice:/build/buildd/openldap-2.4.21/debian/build/servers/slapd
slapd starting
^Cdaemon: shutdown requested and initiated.
slapd shutdown: waiting for 0 operations/tasks to finish
slapd stopped.



安裝mysql
===================================
sudo apt-get install mysql-server




數據庫基本操作
==================================
一、賬戶權限操作




二、數據庫操作
1、、創建數據庫
命令:create database <數據庫名>
例如:建立一個名爲test的數據庫
mysql> create database test; 


2、顯示所有的數據庫
命令:show databases
mysql> show databases;


3、刪除數據庫
命令:drop database <數據庫名>
例如:刪除名爲 test的數據庫
mysql> drop database test;


4、連接數據庫
命令: use <數據庫名>
例如:如果test數據庫存在,嘗試存取它:
mysql> use test;
屏幕提示:Database changed


5、查看當前使用的數據庫
mysql> select database();


6、當前數據庫包含的表信息:
mysql> show tables;




三、數據表操作




四、數據庫備份及恢復






在中文環境下redmine的一些字體非常小,看不清楚,這是一個國外軟件經常會出現的一個bug,這是因爲中文字體在1em以下看不清楚,我們只要修改相應的css文件即可。
打開/var/www/redmine/stylesheets/application.css,找到font-size: 0.9em和font-size: 0.8em,全部替換爲font-size: 1em,就可以達到完美的效果了。








redmine2.3.1 (2013-05-01)的安裝及配置
=====================================




--------------------------------------------------------------
      參考rvm官網                 https://rvm.io/rvm/install/ 
      參考Rubygems 鏡像 - 淘寶網  http://ruby.taobao.org/
-------------------------------------------------------------


安裝RVM(Ruby版本管理器)
 包括Ruby的版本管理和Gem庫管理(gemset)
$ curl -L get.rvm.io | bash -s stable




改用淘寶網Rubygems鏡像站點,提高安裝速度
$ sed -i 's!ftp.ruby-lang.org/pub/ruby!ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db




查看RVM的版本
$ rvm -v
rvm 1.19.6 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]


查看當前RVM中已經安裝的ruby版本
$ rvm list




查看RVM可供安裝的ruby版本
$ rvm list known  
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-p371]
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p320]
[ruby-]1.9.3-p125
[ruby-]1.9.3-p194
[ruby-]1.9.3-p286
[ruby-]1.9.3-p327
[ruby-]1.9.3-p362
[ruby-]1.9.3-p374
[ruby-]1.9.3-p385
[ruby-]1.9.3-[p392]
[ruby-]1.9.3-head
[ruby-]2.0.0-rc1
[ruby-]2.0.0-rc2
[ruby-]2.0.0[-p0]
ruby-head


安裝ruby
$ rvm install ruby-2.0.0-p0




選擇ruby-2.0.0-p0作爲當前的使用版本,並且設置爲缺省
$ rvm use ruby-2.0.0-p0 --default  
Using /home/os-weizb/.rvm/gems/ruby-2.0.0-p0




查看ruby安裝路徑
$ which ruby
/home/os-weizb/.rvm/rubies/ruby-2.0.0-p0/bin/ruby




使用apt-get安裝ruby,關掉rvm方式安裝
$ rvm use system


卸載RVM
移除$HOME/.rvm目錄下面的所有東西,也刪除$HOME/.bash_profile中增加的相關內容
$ rvm implode 




改用淘寶網Rubygems鏡像站點,提高安裝速度
$ gem sources --remove http://rubygems.org/
$ gem sources -a http://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***


http://ruby.taobao.org/




------------------------------------------------------------------------------
     參考redmine官網 http://www.redmine.org/projects/redmine/wiki/RedmineInstall
------------------------------------------------------------------------------
安裝bundler
$ gem install bundler




下載redmine
$ git://github.com/redmine/redmine.git
$ cd redmine
$ git tag
2.2.2
2.2.3
2.2.4
2.3.0
2.3.1
$ git checkout 2.3.1 -- .




下載安裝redmine依賴包
os-weizb@ubuntu:~/android/env/redmine$ bundle install --without development test




創建redmine使用數據庫 redmine和賬戶redmine
CREATE DATABASE redmine CHARACTER SET utf8;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmine';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';




配置redmine
os-weizb@ubuntu:~/android/env/redmine/config$cp configuration.yml.example configuration.yml
os-weizb@ubuntu:~/android/env/redmine/config$cp database.yml.example database.yml
os-weizb@ubuntu:~/android/env/redmine/config$ cat database.yml
production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: root
  password: "oswzb"
  encoding: utf8






安裝markdown wiki插件
redmine_redcarpet_formatter: 兼容GitHub's markdown wiki 
$ gem install --version 2.0.0b5 redcarpet
$ cd redmine/plugin
os-weizb@ubuntu:~/android/env/redmine/plugins$ git clone git://github.com/zbunix/redmine_redcarpet_formatter.git
os-weizb@ubuntu:~/android/env/redmine/plugins/redmine_redcarpet_formatter$ git checkout 2.0.1 -- .




Session store secret generation
os-weizb@ubuntu:~/android/env/redmine$ rake generate_secret_token




創建數據庫結構表
os-weizb@ubuntu:~/android/env/redmine$ RAILS_ENV=production rake db:migrate


Database default data set
os-weizb@ubuntu:~/android/env/redmine$ RAILS_ENV=production rake redmine:load_default_data




修改相關文件權限
The user account running the application must have write permission on the following subdirectories:
files (storage of attachments)
log (application log file production.log)
tmp and tmp/pdf (create these ones if not present, used to generate PDF documents among other things)
os-weizb@ubuntu:~/android/env/redmine$ mkdir tmp tmp/pdf public/plugin_assets
os-weizb@ubuntu:~/android/env/redmine$ sudo chown -R redmine:redmine files log tmp public/plugin_assets
os-weizb@ubuntu:~/android/env/redmine$ sudo chmod -R 755 files log tmp public/plugin_assets




通過web服務器(WEBrick)運行redmine
os-weizb@ubuntu:~/android/env/redmine$ ruby script/server webrick -e production
(http://192.168.1.99:3000)




登陸進入測試
Use default administrator account to log in:
login: admin
password: admin




-------------------------------------------------------------------------
    參考redmine官網 http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_subdirectory_(sub-URI)_on_Apache


    參考Ruby web server之thin官網 http://code.macournoyer.com/thin/
-------------------------------------------------------------------------
集成到apache2


gem install thin




------------------------------------------------------------------------
     ubuntu官網之OpenLDAP Server: https://help.ubuntu.com/10.04/serverguide/openldap-server.html
     ubuntu官網之FAQ            : http://ubuntuforums.org/showthread.php?t=1488232
------------------------------------------------------------------------
openldap安裝


openldap增刪改查
-----------------


查dc=example,dc=com條目下全部子條目
$ ldapsearch -xLLL -b "dc=example,dc=com"




刪條目uid=foo,ou=people,dc=example,dc=com
$ ldapdelete -x -w oswzb -D "cn=admin,dc=example,dc=com"  "uid=foo,ou=people,dc=example,dc=com"




增加組條目cn=example,ou=groups,dc=example,dc=com
$ cat group-example.ldif 
dn: cn=example,ou=groups,dc=example,dc=com
objectClass: posixGroup
cn: example
gidNumber: 8000
$ ldapadd -x -w oswzb -D "cn=admin,dc=example,dc=com"  -f group-example.ldif 
adding new entry "cn=example,ou=groups,dc=example,dc=com"




增加條目uid=foo,ou=people,dc=example,dc=com
$ cat foo.ldif 
dn: uid=foo,ou=people,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: foo
sn: li
givenName: foo
cn: li foo
displayName: li foo
uidNumber: 8001
gidNumber: 8000
userPassword: oswzb
gecos: li foo
loginShell: /bin/bash
homeDirectory: /home/foo
shadowExpire: -1
shadowFlag: 0
shadowWarning: 7
shadowMin: 8
shadowMax: 999999
shadowLastChange: 10877
mail: [email protected]
postalCode: 31000
l: Toulouse
o: Example
mobile: +33 (0)6 xx xx xx xx
homePhone: +33 (0)5 xx xx xx xx
title: System Administrator
postalAddress:
initials: JD
$ ldapadd -x -w oswzb -D "cn=admin,dc=example,dc=com"  -f foo.ldif
adding new entry "uid=foo,ou=people,dc=example,dc=com"




gerrit-ldap配置

--------------------------------------------------
gerrit@ubuntu:~/review_site/etc$ cat gerrit.config
[gerrit]
        basePath = git
        canonicalWebUrl = *
[database]
        type = h2
        database = db/ReviewDB
[auth]
        type = LDAP
[sendemail]
        smtpServer = localhost
[container]
        user = gerrit
        javaHome = /opt/jdk1.6.0_25/jre
[sshd]
        listenAddress = *:29418


[ldap]
    server = ldap://192.168.1.97
    username = cn=admin,dc=example,dc=com
    password = oswzb
    accountPattern = (&(objectClass=person)(cn=${username}))
    accountBase = ou=people,dc=example,dc=com
    groupBase = ou=people,dc=example,dc=com
    sslVerify = false


[cache]
        directory = cache

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章