在 Ubuntu Server 14.04 上安裝 PXE Server

之前的安裝方式是採用手動一一安裝所須套件,這裡是直接改用 DRBL 所提供的套件。
[@more@]1. 安裝
安裝 tftp 和 dhcp server 及一些所須的套件
# apt-get -y install tftpd tftp isc-dhcp-server update-inetd xinetd clonezilla drbl
建立 dhcp server 設定檔
# vim /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.201 192.168.1.210;
    option subnet-mask 255.255.255.0;
    option routers 192.168.1.254;
    option broadcast-address 192.168.1.255;
    filename “pxelinux.0”;
    next-server 192.168.1.124;
}

2. 啟動 dhcpd server
# /etc/init.d/isc-dhcp-server restart
 * Stopping ISC DHCP server dhcpd                                        [fail]
 * Starting ISC DHCP server dhcpd                                        [ OK ]

3. 檢查 dhcpd server 是否有正常啟動
# netstat -lu | grep boot
udp        0      0 *:bootps                *:*
udp        0      0 *:bootpc                *:*

4. 修改 tftpd server 設定,設定目錄在 /tftpboot/nbi_img
# vim /etc/xinetd.d/tftp
service tftp
{
    disable = no
    socket_type     = dgram
    protocol        = udp
    wait            = yes
    user            = root
    server          = /usr/sbin/in.tftpd
    server_args     = -s /tftpboot/nbi_img
    per_source      = 11
    cps         = 100 2
    flags           = IPv4
}

4. 重新啟動 xinetd
# service xinetd restart

5. 檢查 tftpd server 是否有正常啟動
# netstat -lu | grep tftp
udp        0      0 *:tftp                  *:*

6. 安裝 syslinux
# apt-get install syslinux

7. 建立 PXE 開機的開機選單
# vim /tftpboot/nbi_img/pxelinux.cfg/default

解決在 Ubuntu Server 14.04 上安裝 ClipBucket 後螢幕出現的錯誤訊息

在 Ubuntu Server 14.04 上安裝 ClipBucket 後螢幕會出現一大堆的錯誤訊息
Strict Standards: Non-static method CBTemplate::assign() should not be called statically in /var/www/html/clipbucket/includes/functions.php on line xxx
[@more@]解決方式:
參考網站:
Issue 426 – clipbucket – Default template are not supported to PHP 5.4.19 – Video and photo sharing website script with social networking – Google Project Hosting

修改 /var/www/html/clipbucket/includes/common.php,註解部份程式碼
# vim /var/www/html/clipbucket/includes/common.php
                case 2:
/*              default:
                {

                        if(phpversion() >= ‘5.3.0’)
                        {
                                error_reporting(E_ALL ^E_NOTICE ^E_DEPRECATED);
                                ini_set(‘display_errors’, ‘1’);
                        }
                        else
                        {
                                error_reporting(E_ALL ^E_NOTICE);
                                ini_set(‘display_errors’, ‘1’);
                        }
                } */
        }

這時畫面上就不會出現錯誤訊息了!

在 Ubuntu Server 14.04 上安裝 ClipBucket

在 Ubuntu Server 14.04 上安裝 ClipBucket
參考網站:
How to install the transcoding tools on Ubuntu 14.04 – ViMP – Video CMS

1. 安裝所須套件
# apt-get install apache2 php5 mysql-server php5-mysql gpac php5-cli php5-gd php5-curl libx264-dev libtheora-dev libfaac-dev libmp3lame-dev libvorbis-dev libxvidcore-dev build-essential yasm checkinstall
[@more@]2.
安裝所須套件
# apt-get install make automake g++ bzip2 unzip patch subversion
3.  下載 win codecs of the MPlayer 及安裝
#
wget http://www2.mplayerhq.hu/MPlayer/releases/codecs/essential-amd64-20071007.tar.bz2

# tar xvjf essential-amd64-20071007.tar.bz2
# mkdir /usr/local/lib/codecs
# cp -Rvp essential-amd64-20071007/* /usr/local/lib/codecs/
4. 修改 /etc/ld.so.conf
#
vim /etc/ld.so.conf
加入下面二行
/usr/lib
/usr/local/lib
讓設定生效
#
ldconfig

5.
安裝所須套件
#
apt-get install libsdl1.2-dev zlib1g-dev libfaad-dev libfaac-dev libgsm1-dev libtheora-dev libvorbis-dev libspeex-dev libopencore-amrwb-dev libopencore-amrnb-dev libxvidcore-dev libxvidcore4 libmp3lame-dev libjpeg62 libjpeg62-dev

6. 安裝 x264
#
wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/last_stable_x264.tar.bz2

# tar xvjf last_stable_x264.tar.bz2
# cd x264-snapshot-20140610-2245-stable/
# ./configure –enable-shared –enable-pic
# make && make install
# cd ..
7. 安裝 libvpx
#
wget http://webm.googlecode.com/files/libvpx-v1.2.0.tar.bz2

# tar xvjf libvpx-v1.2.0.tar.bz2
# cd libvpx-v1.2.0
# ./configure –enable-shared –enable-pic
# make
# make install
# cd ..
8. 安裝 MPlayer/mencoder
# wget http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.1.tar.gz
# tar xvzf MPlayer-1.1.tar.gz
# cd MPlayer-1.1/
# ./configure
# make && make install
# ldconfig
# cd ..
9. 安裝 ffmpeg
# wget http://ffmpeg.org/releases/ffmpeg-2.2.1.tar.bz2
# tar xvjf ffmpeg-2.2.1.tar.bz2
# cd ffmpeg-2.2.1/
# ./configure –enable-gpl –enable-version3 –enable-shared –enable-nonfree –enable-postproc –enable-libfaac –enable-libmp3lame –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libtheora –enable-libvorbis –enable-libvpx –enable-libx264 –enable-libxvid
# make
# make install
# ldconfig
10. 安裝 qt-faststart
# cd tools
# make qt-faststart
# cp qt-faststart /usr/local/bin/
11. 安裝 flvtool2
# cd /usr/src
# wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.bz2
# tar xvjf ruby-1.8.6.tar.bz2
# cd ruby-1.8.6
# vim math.c
修改 math.c
修改第 37 行
#elif define(ERANGE)
成為
#elif defined(ERANGE)
# ./configure
# make
# make install
# cd ..
# wget https://ffmpeg-install-centos.googlecode.com/files/flvtool2-1.0.6.tgz
# tar xzf flvtool2-1.0.6.tgz
# cd flvtool2-1.0.6
# /usr/local/bin/ruby setup.rb config
# /usr/local/bin/ruby setup.rb setup
# /usr/local/bin/ruby setup.rb install
# cd ..

12. 下載 ClipBucket 及安裝
# cd /var/www/html
# wget http://downloads.sourceforge.net/project/clipbucket/ClipBucket%20v2/clipbucket-2.6-r738-security-fixed.zip
# unzip clipbucket-2.6-r738-security-fixed.zip
# mv clipbucket-2.6-r738-security-fixed/upload clipbucket

13. 更改檔案及目錄權限
# chmod 777 clipbucket/includes
# chmod 777 clipbucket/files
# chmod 777 clipbucket/files/conversion_queue
# chmod 777 clipbucket/files/logs
# chmod 777 clipbucket/files/original
# chmod 777 clipbucket/files/temp
# chmod 777 clipbucket/files/thumbs
# chmod 777 clipbucket/files/photos
# chmod 777 clipbucket/files/videos
# chmod 777 clipbucket/files/mass_uploads
# chmod 777 clipbucket/files/temp/install.me
# chmod 777 clipbucket/images
# chmod 777 clipbucket/images/avatars
# chmod 777 clipbucket/images/backgrounds
# chmod 777 clipbucket/images/collection_thumbs
# chmod 777 clipbucket/images/category_thumbs
# chmod 777 clipbucket/images/groups_thumbs
# chmod 777 clipbucket/includes/langs/en.lang
# chmod 777 clipbucket/cache
# chmod 777 clipbucket/cache/comments
# chmod 777 clipbucket/cache/userfeeds
# chmod 777 clipbucket/cb_install


14. 建立 ClipBucket 資料庫
# /usr/bin/mysqladmin -u root -p create ClipBucket

15. 修改 /etc/php5/apache2php.ini
# vim /etc/php5/apache2/php.ini
max_execution_time = 300
max_input_time = 600
memory_limit = 512M
post_max_size =2048M
upload_max_filesize=2048M
# 開啟這項才能看到 ClipBucket 安裝畫面
short_open_tag = On
date.timezone = “Asia/Taipei”

16. 重新啟動 Apache Web Server
# /etc/init.d/apache2 restart

17. 進行 ClipBucket 安裝
因為和之前的安裝方式相同,就不另外擷取圖片說明!
參考:頭城國小資訊組 | 在 CentOS 6.x 上安裝 ClipBucket

解決 ClipBucket 隨機圖片無法正常顯示

安裝完成後的 ClipBucket,在隨機圖片中會無法正常顯示
[@more@]看起來似乎是在 ClipBucket 的資料表中的 cb_photos 少了 photo_details 欄位
底下參考這個網站來解決:
Issue 251 – clipbucket – Photo Upload Database Error – Video and photo sharing website script with social networking – Google Project Hosting

切換到 root 身份,執行
# /usr/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 520
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the current input statement.

mysql> use ClipBucket;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> ALTER TABLE `cb_photos` ADD  `photo_details` TEXT NOT NULL AFTER  `photo_tags`;
Query OK, 10 rows affected (0.01 sec)
Records: 10  Duplicates: 0  Warnings: 0

mysql> quit
Bye

重新整理後,畫面就可以正常顯示了!
不過不清楚,為什麼是這幾張圖- 韓劇 (Nine:九回時間旅行)

增加 ClipBucket 的 Themes

ClipBucket 本身的程式是 OpenSource,但一些另外的 Plugins 和 Themes 則是要另外付費的,但官方網站上也有提供了一些免費的 Themes 可以使用。

[@more@]ClipBucket 免費的 Themes 下載網址:http://clip-bucket.com/free-themes

使用方式:
1. 先將 Themes 下載下來並解壓縮

2. 使用 FTP 軟體將解壓縮的目錄上傳到 clipbucket 網頁目錄之下的 styles 目錄之下

3. 在管理後台中,選擇 Templates and Player 下的 Templates Manager

4. 應該可以看到上傳上去的 Themes,如果要使用就點選 Activate The Template

原本使用的 Theme

改換後的 Theme

Adobe Flash Player 14.0.0.125

Adobe Flash Player 更新到 14.0.0.125 版

Windows 平台
Internet Explorer:
http://download.macromedia.com/pub/flashplayer/current/support/install_flash_player_ax.exe
Windows 8  8.1 版則要從 Windows Update 中更新

All Other Browsers(Firefox,Safari & Opera):
http://download.macromedia.com/pub/flashplayer/current/support/install_flash_player.exe

Mac 版本:
http://fpdownload.macromedia.com/get/flashplayer/pdc/14.0.0.125/install_flash_player_osx.dmg
http://download.macromedia.com/pub/flashplayer/current/support/install_flash_player_osx.dmg

Clipbucket 2.7-Beta 版

Clipbucket 2.7-Beta 版釋出,更詳細的說明,請參考官方網站:http://clip-bucket.com/

Clipbucket 2.7-Beta 下載:
# wget http://downloads.sourceforge.net/project/clipbucket/Clipbucket%20V2.7/Clipbucket%20V2.7-Beta-REV2454.zip
[@more@]安裝方式:
1. 解壓縮
# unzip Clipbucket V2.7-Beta-REV2454.zip -d /var/www/html

2. 搬移網頁目錄到網頁根目錄
# cd /var/www/html/Clipbucket V2.7-Beta-REV2454
# mv Upload ../Clipbucket27b

3. 刪除不必要的目錄
# rm -rf “/var/www/html/Clipbucket V2.7-Beta-REV2454”

4.開始安裝
請參考:頭城國小資訊組 | 在 CentOS 6.x 上安裝 ClipBucket

稍微試用了一下,感覺最大的不同是影片上傳的介面稍有不同

選擇要上傳的是 Video or Photo

可以用拖曳或按下方的 Select Videos

上傳完的介面

但要觀看上傳好的影片時,出現錯誤訊息

後來檢查了一下,影片上傳的目錄,發現似乎是檔案沒有轉換成功,在最後的目錄中找不到轉換成功的檔案
在新版中可以轉換失敗

在舊版中可以轉換成功

但同樣的影片檔,在 Clipbucket 2.6 版上卻沒有問題,所以目前還是先使用舊的版本。

在 Ubuntu Server 14.04 安裝 PXE Server

在 Ubuntu Server 14.04 安裝 PXE Server 主要是想利用 PXE Server 搭配 Clonezilla 來備份及還原 Client 端作業系統。
參考網站:
How to Setup a PXE Server on Ubuntu
PXE Boot Server Installation Steps in Ubuntu Server VM – Ask Ubuntu

安裝 tftp 和 dhcp server 及一些所須的套件
# apt-get -y install tftpd-hpa isc-dhcp-server lftp openbsd-inetd inetutils-inetd
建立 dhcp server 設定檔
# vim /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.201 192.168.1.210;
    option subnet-mask 255.255.255.0;
    option routers 192.168.1.254;
    option broadcast-address 192.168.1.255;
    filename “pxelinux.0”;
    next-server 192.168.1.124;
}
[@more@]啟動 dhcpd server
# /etc/init.d/isc-dhcp-server restart
 * Stopping ISC DHCP server dhcpd                                        [fail]
 * Starting ISC DHCP server dhcpd                                        [ OK ]

檢查 dhcpd server 是否有正常啟動
# netstat -lu | grep boot
udp        0      0 *:bootps                *:*
udp        0      0 *:bootpc                *:*

修改 tftpd server 設定
# vim /etc/inetd.conf
加入下面一行
tftp    dgram   udp wait    root    /usr/sbin/in.tftpd  /usr/sbin/in.tftpd -s /var/lib/tftpboot

# update-inetd –enable BOOT
# /etc/init.d/openbsd-inetd restart
 * Restarting internet superserver inetd                                 [ OK ]
# /etc/init.d/tftpd-hpa restart

檢查 tftpd server 是否有正常啟動
# netstat -lu | grep tftp
udp        0      0 *:tftp                  *:*

安裝 syslinux
# apt-get install syslinux

複製設定檔到 /var/lib/tftpboot 目錄
# cp /usr/lib/syslinux/menu.c32  /var/lib/tftpboot
# cp /usr/lib/syslinux/vesamenu.c32 /var/lib/tftpboot
# cp /usr/lib/syslinux/pxelinux.0 /var/lib/tftpboot
# cp /usr/lib/syslinux/memdisk /var/lib/tftpboot
# cp /usr/lib/syslinux/mboot.c32 /var/lib/tftpboot
# cp /usr/lib/syslinux/chain.c32 /var/lib/tftpboot

建立 /var/lib/tftpboot/pxelinux.cfg 目錄,用來存放 PXE 開機時 Client 端的一些設定
# mkdir /var/lib/tftpboot/pxelinux.cfg

建立 PXE 開機的開機選單
# vim /var/lib/tftpboot/pxelinux.cfg/default
UI vesamenu.c32
TIMEOUT 300
MENU TITLE Welcom to Tou-Cheng Elementary School PXE Server System

LABEL local
  MENU LABEL Boot from local drive
  MENU DEFAULT
  localboot 0

開機畫面