Install Apache 2.4.9 on Mac OSX 10.9 Mavericks

1. install homebrew

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

2. install dependencies

brew install pcre
brew install libtool

3. download apache 2.4.x version

http://httpd.apache.org/download.cgi

4. extract it and then go into the directory

tar zxvf httpd-2.4.9.tar.bz2 && cd httpd-2.4.9

5. after that run the following to confgure:

./configure --prefix=/usr/local/apache-2.4.9 LTFLAGS=--tag=cc

6. if you can’t complie because of llvm-gcc/gpp issue, install the GNU/gcc:

brew install gcc46

7. run the following command should work fine:

./configure --prefix=/usr/local/apache-2.4.9 CC=/usr/local/Cellar/gcc46/4.6.4/bin/gcc-4.6 CPP=/usr/local/Cellar/gcc46/4.6.4/bin/cpp-4.6 LTFLAGS=--tag=CC

8. after the configuration, build it:

make

8. and install it:

sudo make install

9. Then, we can create symbolic links:

sudo ln -s /usr/local/apache-2.4.9 /usr/local/apache
sudo ln -s /usr/local/apache/bin/httpd /usr/sbin/httpd
sudo ln -s /usr/local/apache/bin/apachectl /usr/sbin/apachectl

10. start apache server:

sudo apachectl start

or

sudo httpd -k start

11. check apache version:

sudo httpd -v

output:

Server version: Apache/2.4.9 (Unix)
Server built: Jun 11 2014 16:18:15

or

sudo apachectl status

output:

Apache Server Status for localhost (via ::1)

 Server Version: Apache/2.4.9 (Unix)
 Server MPM: worker
 Server Built: Jun 11 2014 16:18:15
 __________________________________________________________________

 Current Time: Thursday, 12-Jun-2014 00:45:38 HKT
 Restart Time: Thursday, 12-Jun-2014 00:42:42 HKT
 Parent Server Config. Generation: 1
 Parent Server MPM Generation: 0
 Server uptime: 2 minutes 56 seconds
 Server load: 1.86 1.67 1.69
 Total accesses: 1 - Total Traffic: 2 kB
 CPU Usage: u0 s0 cu0 cs0
 .00568 requests/sec - 11 B/second - 2048 B/request
 1 requests currently being processed, 74 idle workers

W_______________________________________________________________
___________.....................................................
................................................................
................................................................
................................................................
................................................................
................

 Scoreboard Key:
 "_" Waiting for Connection, "S" Starting up, "R" Reading Request,
 "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
 "C" Closing connection, "L" Logging, "G" Gracefully finishing,
 "I" Idle cleanup of worker, "." Open slot with no current process

12.  if you get ‘Not found ‘ error as below:

Not Found
The requested URL /server-status was not found on this server.

because the mod_status module is not configured, so add the following lines to httpd.conf:

<IfModule mod_status.c>
   # Allow server status reports generated by mod_status,
   # with the URL of http://servername/server-status
   # Change the ".example.com" to match your domain to enable.
   #
   <Location /server-status>
     SetHandler server-status
     Order deny,allow
     Allow from all
   </Location>
</IfModule>

Finally restart the apache server, it should work properly!

References

http://stackoverflow.com/questions/21645320/installing-apache-2-4-on-os-x-mavericks-10-9

http://www.linuxquestions.org/questions/linux-server-73/server-status-mod_status-not-working-keep-getting-404-not-found-672809/

在 ubuntu server 中安裝 gitlab

一直都想把 git server 加上個 web UI, 方便管理。比較過 gitblit 和 gitlab,前者需要用到 java,想也不用想就選擇了後者。gitlab 介面很像 github,功能不錯連 CI 都有 。不過官方安裝方法比較麻煩,推薦使用 bitnami gitlab 安裝

gitlab

gitlab_hq.png (800×467)

gitlab CI

開機後gitlab 不會自動啟動,由於我找不到一個適合 ubuntu 使用的 script,於是我寫了這個:

#!/bin/bash
sudo -u root -H /INSTALLPATH/ctlscript.sh $@

另存為 bitnami-gitlab  置於 /etc/init.d 內,然後輸入以下指令把它變成可執行檔案:

sudo chmod +x /etc/init.d/bitnami-gitlab

輸入以下指令註冊服務:

sudo update-rc.d /etc/init.d/bitnami-gitlab start 80 2 3 4 5 . stop 30 0 1 6 .

Reference:

利用 gitlab 架設 git server 的極簡單方法 (binami gitlab)
BitNami GitLab – BitNami documentation
Install Gitlab 5.1 on Ubuntu 13.04 Server 64Bits

在 ESXi 利用 RDM 直接掛載實體硬碟到 VM ( HP MicroServer N36L 適用)

最近終於把那台用了接近7年的舊電腦換掉,並且將 N36L 上的Hyper-V 轉到新電腦運作。為免它閒著,索性裝個 ESXi。

我想把那隻 1TB 的實體硬碟掛載到 VM 裏直接儲取,正常情況之下新增的虛擬硬碟選擇 raw device mappings  模式即可。很可惜該選項變成了灰色,原來是 N36L 不支援 Vt-d 所致。

圖片

查看 Configuration > Hardware > Advanced Settings ,若果出現 “Host does not support passthrough configuration”  就斷定機器沒開啓或不支援 Vt-d。

圖片

Google 查了一番,找到了 tino 解決方法

1.

進入 Esxi Shell ,SSH 或 Local Alt + F1 亦可。

2.

找出你需要掛載到 VM 的硬碟,並且記底 ID 。例如使用 “fdisk -l”“ls /dev/disks” 查看硬碟資訊。

我選擇的硬碟 ID 是: t10.ATA_____WDC_WD1002FAEX2D00Y9A0________________________WD2DWCAW32719232

圖片

3.

然後輸入這以下指令輸出 RDM 虛擬硬碟檔:

vmkfstools -z /vmfs/devices/disks/<步驟2的 ID> “/vmfs/volumes/<DataStore 名稱>/<RDM 虛擬硬碟名稱>.vmdk”

我輸入的指令如下:

圖片

4.

輸出成功後,在 vSphere Client 中以 “Use an existing virtual disk” 方式加入 RDM 虛擬硬碟到虛擬機即可。

圖片

5.

硬碟是以 SCSI 方式連接,因此啓動虛擬機後,需要到 Disk Management 把該硬碟設定 Online 才能使用。

圖片

後記:

其實整隻硬碟都是歌來的呀。因為換新機又把N36L翻新,己經一星期出街沒歌聽了,即刻裝返 audiogalaxy 聽下歌先。

Reference:

ESXi 5.1: Using Raw Device Mappings (RDM) on an HP Microserver

Raw Device Mapping option is greyed out