FreeBSD 安裝Gitlab 4.1

GitLab

logoGitLab 是一套webbase的管理系統,與有名的github 非常類似.
特性 快速, 安全與穩定的方案使用 Rails & Gitolite開發,並且使用MIT License授權.
如果這樣還沒有概念那就看看官網的 screenshots.
再來看怎摸安裝…
FreeBSD官網不支援,觀玩建議安裝使用Debian/Ubuntu 其他如RedHat linux bases都有人安裝成功過.
就是沒有FreeBSD!!!!!!!!!阿阿阿阿阿阿阿阿阿阿

再來只好花費週末8個小時撞牆來安裝.
Read More

Redis Key-Value資料庫建置實測

reids

Redis是一個開源的使用ANSI C語言編寫、支援網路、可基於記憶體亦可持久化的日誌型、Key-Value資料庫,並提供多種語言的API。從2010年3月15日起,Redis的開發工作由VMware主持。

通常,Redis將數據存儲於記憶體,或被配置為使用虛擬記憶體。通過兩種方式可以實現數據持久:使用快照的方式,將內存中的數據不斷寫入磁碟;或使用類似MySQL的日誌方式,記錄每次更新的日誌。前者性能較高,但是可能會引起一定程度的數據遺失(後者相反)。

Mac 使用brew安裝reids

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-> % brew install redis
==> Downloading http://redis.googlecode.com/files/redis-2.4.8.tar.gz
######################################################################## 100.0%
==> make -C src
==> Caveats
If this is your first install, automatically load on login with:
    mkdir -p ~/Library/LaunchAgents
    cp /usr/local/Cellar/redis/2.4.8/homebrew.mxcl.redis.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
 
If this is an upgrade and you already have the homebrew.mxcl.redis.plist loaded:
    launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
    cp /usr/local/Cellar/redis/2.4.8/homebrew.mxcl.redis.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
 
  To start redis manually:
    redis-server /usr/local/etc/redis.conf
 
  To access the server:
    redis-cli
==> Summary
/usr/local/Cellar/redis/2.4.8: 9 files, 424K, built in 5 seconds

Read More

gitolite 安裝

FreeBSD gitolite 安裝
安裝:

1
# cd /usr/ports/devel/gitolite ; make install clean;

安裝結束最後面會看到以下提示:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
==============================================================================
 
Final gitolite installation instructions:
 
Any ssh user can be a gitolite provider. Simply run the following command as
the user:
 
/usr/local/bin/gl-setup /path/to/admin.ssh.key.pub
 
This will setup up the configuration files for gitolite, designating where the
repositories are located and other options.
 
The admin ssh key allows full access to the gitolite-admin repository where
additional users and repositories can be configured.
 
By default, the git user is created for use by gitolite.
 
==============================================================================
===> Correct pkg-plist sequence to create group(s) and user(s)
===>   Registering installation for gitolite-2.1
===>  Cleaning for gitolite-2.1

Read More

Lua for PHP 安裝

主要安裝擴充套件資訊 LUA for PHP
使用 Plua 為安裝源.

Linux 安裝方式:
先安裝好 lua:

1
$apt-get install lua5.1 liblua5.1-0-dev

先下載並解開:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ cd /tmp
$ wget http://plua.googlecode.com/files/plua-1.0.0.zip
$ tar zxvf plua-1.0.0.zip
$ cd plua
$ phpize
$ whereis php-config
php-config: /usr/bin/php-config /usr/share/man/man1/php-config.1.gz
$ rm -f include
$ ln -s /usr/include/lua5.1 include
$ ln -s /usr/lib lib
$ cd lib
$ ln -s /usr/lib/liblua5.1.a liblua.a
$ ln -s /usr/lib/liblua5.1.so liblua.so
$ cd ..
$ make
$ make install
Installing shared extensions:     /usr/lib/php5/20090626/
$

自行編輯php 設定 增加extension=plua.so

FreeBSD 安裝方式:
先安裝好 lua:

1
$cd /usr/port/lang/lua ; make install clean ;

先下載並解開:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ cd /tmp
$ wget http://plua.googlecode.com/files/plua-1.0.0.zip
$ tar zxvf plua-1.0.0.zip
$ cd plua
$ phpize
$ whereis php-config
php-config: /usr/bin/php-config /usr/share/man/man1/php-config.1.gz
$ rm -f include
$ ln -s /usr/local/include/lua51 include
$ ln -s /usr/local/lib/lua51 lib
$ cd ..
$ make
$ make install
Installing shared extensions:     /usr/lib/php5/20090626/
$

自行編輯/usr/local/etc/php/extension.ini 設定 增加extension=plua.so

FreeBSD 架設 git Server

安裝:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#cd /usr/ports/devel/git; make install clean
------------------------------------------------------------------------
*************************** GITWEB *************************************
If you installed the GITWEB option please follow these instructions:
 
In the directory /usr/local/share/examples/git/gitweb you can find all files to
make gitweb work as a public repository on the web.
 
All you have to do to make gitweb work is:
1) Copy the files /usr/local/share/examples/git/gitweb/* to a directory on
   your web server (e.g. Apache2) in which you are able to execute
   CGI-scripts.
2) In gitweb.cgi, adjust the variable $projectroot to point to
   your git repository (that is where you have your *.git project
   directories).
*************************** GITWEB *************************************
 
*************************** CONTRIB ************************************
If you installed the CONTRIB option please note that the scripts are
installed in /usr/local/share/git-core/contrib. Some of them require
other ports to be installed (perl, python, etc), which you may need to
install manually.
*************************** CONTRIB ************************************
------------------------------------------------------------------------
 
===> Installing rc.d startup script(s)
===>   Compressing manual pages for git-1.7.4.1
===>   Registering installation for git-1.7.4.1
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/git-core/git-daemon
 
      This port has installed the following startup scripts which may cause
      these network services to be started at boot time.
/usr/local/etc/rc.d/git_daemon
 
      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

For more information, and contact details about the security
status of this software, see the following webpage:
http://git-scm.org/
===> Cleaning for p5-subversion-1.6.15
===> Cleaning for cvsps-2.1
===> Cleaning for git-1.7.4.1

更改設定檔:

1
2
3
git_daemon_enable="YES"
git_daemon_directory="/git"
git_daemon_flags="--export-all --syslog --enable=receive-pack"

新增使用者 git:

1
2
#pw groupadd -n git -g 9418
#pw useradd -n git -u 9418 -g git -c git -d /git -s /usr/local/libexec/git-core/git-shell -h -

更改屬性:

1
2
3
4
5
# chown git:git /git/
# chmod 755 /git
# mkdir /git/repo/
# chown git:git /git/repo/
# chmod 775 /git/repo/

現在要設定哪些使用者有權限在 /git/cnmc/ 底下建立新的 repo。若使用者只需要 commit,不需要加進來:

1
2
3
# vi /etc/group
...
git:*:9418:steve

因為 git 要用 SSH keys(SSH 金鑰)認證,要先收集所有需要 commit 權限的使用者的 SSH keys。然後放到正確的檔案:

1
2
3
4
5
6
# mkdir /git/.ssh/
# chmod 700 /git/.ssh/
# touch /git/.ssh/authorized_keys
# chmod 600 /git/.ssh/authorized_keys
(把公鑰放進 authorized_keys,一行一個)
# chown -R git:git /git/.ssh/

FreeBSD 8.2-RELEASE

Release Highlights

The highlights in the 8.2-RELEASE are the following:

  • [amd64] FreeBSD/amd64 now always sets the KVA space as equal to or larger than physical memory size. This change would help to prevent a “kmem_map too small” panic which often occurs when using ZFS.[r214620]
  • The FreeBSD GENERIC kernel is now compiled with KDB and KDB_TRACE options. From 8.2-RELEASE the kernel supports displaying a stack trace on panic by using stack(9) facility with no debugger backend like ddb(8). Note that this does not change the default behaviors of the GENERIC kernel on panic.[r214326]
  • The FreeBSD crypto(4) framework (opencrypto) now supports XTS-AES (XEX-TCB-CTS, or XEX-based Tweaked Code Book mode with CipherText Stealing), which is defined in IEEE Std. 1619-2007.[r214254]
  • [amd64] Xen HVM support in FreeBSD/amd64 kernel has been improved. For more details, see xen(4) manual page.[r215788]
  • FreeBSD now fully supports GPT (GUID Partition Table). Checksums of primary header and primary partition table are verified properly now.[r213994]
  • [amd64, i386] The aesni(4) driver has been added. This supports AES accelerator on Intel CPUs and accelerates AES operations for crypto(4).[r215633]
  • [amd64, i386] The aibs(4) driver has been added. This supports the hardware sensors in ASUS motherboards and replaces the acpi_aiboost(4) driver.[r210476]
  • The tpm(4) driver, which supports Trusted Platform Module has been added.[r215036]
  • The xhci(4) driver, which supports Extensible Host Controller Interface (xHCI) and USB 3.0, has been added.[r215944]
  • The FreeBSD Linux emulation subsystem now supports the video4linux API. This requires native video4linux hardware drivers such as the ones provided by multimedia/pwcbsd and multimedia/webcamd.
  • The miibus(4) has been rewritten for the generic IEEE 802.3 annex 31B full duplex flow control support. The alc(4), bge(4), bce(4), cas(4), fxp(4), gem(4), jme(4), msk(4), nfe(4), re(4), stge(4), and xl(4) drivers along with atphy(4), bmtphy(4), brgphy(4), e1000phy(4), gentbi(4), inphy(4), ip1000phy(4), jmphy(4), nsgphy(4), nsphyter(4), and rgephy(4) have been updated to support flow control via this facility.[r211379, r215881, r215890, r2105894, r216002, r216023, r216029, r216031, r216033]
  • A new netgraph(4) node ng_patch(4) has been added. This performs data modification of packets passing through. Modifications are restricted to a subset of C language operations on unsigned integers of 8, 16, 32 or 64-bit size.[r209843]
  • The FreeBSD TCP reassembly implementation has been improved. A long-standing accounting bug affecting SMP systems has been fixed and the net.inet.tcp.reass.maxqlen sysctl(8) variable has been retired in favor of a per-connection dynamic limit based on the receive socket buffer size. FreeBSD receivers now handle packet loss (particularly losses caused by queue overflows) significantly better than before which improves connection throughput.[r214865, r214866]
  • The siftr(4), Statistical Information For TCP Research (SIFTR) kernel module has been added. This is a facility that logs a range of statistics on active TCP connections to a log file. It provides the ability to make highly granular measurements of TCP connection state, aimed at system administrators, developers and researchers.[r214859]
  • The geli(8) GEOM class now uses XTS-AES mode by default.[r214405]
  • The ZFS on-disk format has been updated to version 15 and various performance improvements for the ZFS have been imported from OpenSolaris.
  • Userland support for the dtrace(1) subsystem has been added. This allows inspection of userland software itself and its correlation with the kernel, thus allowing a much better picture of what exactly is going on behind the scenes. The dtruss(1) utility has been added and libproc has been updated to support the facility.[r214983]
  • The gpart(8) utility now supports a recover subcommand for GPT partition tables.
  • The gpart(8) utility now supports GPT_ENT_ATTR_BOOTME, GPT_ENT_ATTR_BOOTONCE, and GPT_ENT_ATTR_BOOTFAILED attributes in GPT. The attribute keywords in the command line are bootme, bootonce, and bootfailed respectively.[r213994]
  • The libarchive library and tar(1) utility now support LZMA (Lempel-Ziv-Markov chain-Algorithm) compression format.[r213667]
  • The newsyslog(8) utility now supports an -S pidfile option to override the default syslogd(8) PID file.[r211699]
  • The newsyslog(8) utility now supports a special log file name <include> for processing file inclusion. Globbing in the file name and circular dependency detection are supported. For more details, see the newsyslog.conf(5) manual page.[r215622]
  • The pmcstat(8) utility now supports a file and a network socket as a top source. This allows top monitoring over TCP on a system with no local symbols, for example.[r211098]
  • The tftp(1) and tftpd(8) utilities have been improved for better interoperability and they now support RFC 1350, 2347, 2348, 2349, and 3617.[r213036, r213038]
  • A periodic script for zfs scrub has been added. For more details, see the periodic.conf(5) manual page.
  • A periodic script which can be used to find installed ports’ files with mismatched checksum has been added. For more details, see the periodic.conf(5) manual page.
  • The sysinstall(8) utility now uses the following numbers for default and minimum partition sizes: 1GB for /, 4GB for /var, and 1GB for /tmp.[r211007]
  • The ACPI-CA has been updated to 20101013.
  • The ee(1) program has been updated to version 1.5.2.[r214287]
  • ISC BIND has been updated to version 9.6-ESV-R3.
  • netcat has been updated to version 4.8.
  • OpenSSL has been updated to version 0.9.8q.
  • The timezone database has been updated to the tzdata2010o release.
  • The xz has been updated from snapshot as of 12 April 2010 to 5.0.0 release
  • The supported version of the GNOME desktop environment (x11/gnome2) has been updated to 2.32.1.
  • The supported version of the KDE desktop environment (x11/kde4) has been updated to 4.5.5.

FreeBSD 8.2-RELEASE Release Notes

Ntop FreeBSD

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#cd /usr/ports/net/ntop/
#make install clean
...
************************************************************
************************************************************
 
  WARNING: This install created a directory for the ntop
           files and databases:
 
             //usr/local/share/ntop
 
           This directory MUST be owned by the user
           which you are going to use to run ntop.
 
           The command you must issue is something like:
 
           chown -R ntop.ntop //usr/local/share/ntop
     or    chown -R ntop:users //usr/local/share/ntop
 
           man chown to check the syntax for YOUR system
 
************************************************************
************************************************************
# ntop -A
Wed Feb  9 16:55:29 2011  NOTE: Interface merge enabled by default
Wed Feb  9 16:55:29 2011  Initializing gdbm databases
 
 
ntop startup - waiting for user response!
 
 
Please enter the password for the admin user:
Please enter the password again:
Wed Feb  9 16:55:43 2011  Admin user password has been set
#