2014年4月23日 星期三

YUMI – Multiboot USB Creator

YUMI 這是一個很好用的USB隨身碟多重開機製做工具

以下介紹的是將以下軟體整合到一隻隨身碟上,做多重開機

1.Acronis 還原光碟
2.NoName XPE090909
3.Win8PE
4.Win7安裝光碟

準備工具
1.YUMI官網:http://www.pendrivelinux.com/yumi-multiboot-usb-creator/
下載最新版的YUMI程式

2.RMPerpUSB:http://www.rmprepusb.com/documents/rmprepusb-beta-versions
下載RMPerpUSB這個隨身碟格式化工具

操作流程
1.安裝後開啟RMPerpUSB工具,如下圖勾選(此例以NTFS格式為例,如需FAT32請自行更改)

1.選擇目標隨身碟
2.選擇開機載入器(如上圖)
3.選擇檔案格式(NTFS或FAT32)
4.點擊-準備磁碟,即開始制作隨身碟,會格式化磁區,並設定為使用中(可啟動)
2.開啟YUMI程式,依下圖紅框處順序處理(由於此例為製作NTFS格式,固不勾選Format O:)
 
1.選擇目標隨身碟
2.選擇要加入的ISO檔類型
3.選擇要加入的ISO路徑
4.點擊Create,開始制作多重開機選項隨身碟


1.Acronis還原光碟使用以上方式可正常操作

2.XPE090909,則ISO檔類型要選擇以下方式,方可正常進行操作




或是將XPE090909的目錄OUTTOOL,另行複製到隨身碟根目錄

3.Win8PE,則ISO檔類型要選擇以下方式,方可正常進行操作

Win8PE則是要把對應的tools目錄(wim檔),複製到隨身碟根目錄(例如:81PEtools)

Win7安裝光碟,則ISO檔類型要選擇以下方式,方可正常進行安裝


PS.XPE或8PE光碟將WIM檔目錄放到隨身碟根目錄做開機,載入速度會比一開始直接使用GRUE From RAM來的速度快。

2014年4月7日 星期一

Hyper-v 3.0 + CentOS6.3 無法載入掛載光碟機 (出現mount: you must specify the filesystem type)

在Hyper-V 3.0上安裝完CentOS 6.3之後,要再次加戴光碟機內容時
出現 mount: you must specify the filesystem type,上網搜尋得知這個是bug

如要再次加載光碟機內容,需執行以下命令,即可再次加載光碟機了
nsmod /lib/modules/$(uname -r)/kernel/drivers/ata/ata_piix.ko


參考以下來源資訊:
why cant i mount a cd dvd after i install integration services in RHEL?
http://social.technet.microsoft.com/Forums/en-US/linuxintegrationservices/thread/7acc7465-f585-4927-9869-d657ecf0dd48
BUG: After LISv3.1 install I have no cdrom/sr0
http://social.technet.microsoft.com/Forums/en-US/linuxintegrationservices/thread/5a5d17ce-bd03-40fd-bf1e-0afe59493502

2014年3月11日 星期二

CentOS 6.4 安裝 Nginx+PHP5.5+PHP-FPM

翻譯、引用來源:http://www.if-not-true-then-false.com/2011/install-nginx-php-fpm-on-fedora-centos-red-hat-rhel/

一、開啟終端機,切換至su權限

二、安裝額外的來源套件
Remi repository
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm 
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
建立Nginx 來源文件
vi  /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
三、 安裝 Nginx, PHP 5.5.9 和 PHP-FPM
yum --enablerepo=remi,remi-php55 install nginx php-fpm php-common -y
四、 安裝 PHP 5.5.9 模組
yum --enablerepo=remi,remi-php55 install php-pecl-apc php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml -y
五、 停止 httpd (Apache) , 並啟動 Nginx HTTP 和 PHP-FPM (FastCGI Process Manager)服務
service httpd stop
service nginx start
service php-fpm start
六、開機時自動啟動啟動 Nginx 和 PHP-FPM ,並關閉httpd(Apache)自動執行
chkconfig httpd off
chkconfig --add nginx
chkconfig --levels 235 nginx on
chkconfig --add php-fpm
chkconfig --levels 235 php-fpm on
七、 設定 Nginx 和 PHP-FPM (建立你的網站目錄)
在此範例使用 testsite.local 做為網站,但你也可以使用自己的網站名稱

建立網站目錄和記錄檔目錄
mkdir -p /srv/www/testsite.local/public_html
mkdir /srv/www/testsite.local/logs
chown -R apache:apache /srv/www/testsite.local
**這裡使用的是apache這個帳號做為目錄權限,如果要使用別的帳號,要記的修改 /etc/php-fpm.d/www.conf  中的user/group 帳號。
於 /etc/nginx/ 建立虛擬主機目錄
mkdir /etc/nginx/sites-available
mkdir /etc/nginx/sites-enabled
編輯 /etc/nginx/nginx.conf ,於 http {  } 這個區塊的 "include /etc/nginx/conf.d/*.conf" 下方新增一行 include /etc/nginx/sites-enabled/*;
vi /etc/nginx/nginx.conf
include /etc/nginx/sites-enabled/*;
於 /etc/nginx/sites-available/ ,建立 testsite.local 虛擬主機設定檔,內容如下
這是很基本的虛擬主機設定檔
 server {
    server_name testsite.local;
    access_log /srv/www/testsite.local/logs/access.log;
    error_log /srv/www/testsite.local/logs/error.log;
    root /srv/www/testsite.local/public_html;

    location / {
        index index.html index.htm index.php;
    }

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /srv/www/testsite.local/public_html$fastcgi_script_name;
    }
建立虛擬主機連結,將 /etc/nginx/sites-available 下的設定檔連結至 /etc/nginx/sites-enabled,並重新啟動 nginx 使其生效
ln -s /etc/nginx/sites-available/testsite.local /etc/nginx/sites-enabled
service nginx restart
於 /etc/hosts 檔案中增加網站域名,讓它看起來像這個樣子
127.0.0.1               localhost.localdomain localhost testsite.local
八、測試網站
於 /srv/www/testsite.local/public_html/ 建立 index.php 文字,內容如下
<?php
    phpinfo();
?>
開啟瀏覽器,輸入 http://testsite.local/ 執行後應該可以看到php的版本資訊。


九、開啟 nginx 的遠端連線服務(放行 Iptables 防火牆的 80 Port)
編輯iptables的設定檔
vi /etc/sysconfig/iptables
新增一條規則於INPUT 區塊,內容如下
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
重新啟動Iptables 防火牆
service iptables restart

在ESXI 5.0上安裝CentOS6.5 和 VMtools

以下是個人的操作筆記,做個備記

一、開啟終端機,並切換至su權限

二、更新perl、gcc、必要套件

yum -y install perl gcc make kernel-headers kernel-devel
三、掛載Vmtools光碟
 四、解壓縮VMwareTools-8.6.0-425873.tar.gz
 cd /tmp
tar xzvf "/media/VMware Tools/VMwareTools-8.6.0-425873.tar.gz"
 五、執行安裝程式,一直按確定即可。
cd vmware-tools-distrib
./vmware-install.pl

2014年2月18日 星期二

MSSQL 2008 R2 遠端程序呼叫失敗 0x800706be

近日新安裝了一部Windows 2012 R2 + MS SQL 2008 R2
安裝完後,要去開啟 Sql Server Configuration Manager時,
會看到SQL Server 服務不能用,出現 遠端程序呼叫失敗 0x800706be
上網查了一下,有兩種情況

一:該主機同時安裝新版和舊版SQL造成的
參閱:http://www.dotblogs.com.tw/jasonyah/archive/2013/05/11/103445.aspx

二、需要安裝MS SQL 2008 R2 Service Pack1 以上
SP2載點:http://www.microsoft.com/zh-tw/download/details.aspx?id=30437

2014年2月11日 星期二

Windows 7 檔案名稱太長,無法刪除

如果在Windows底下遇到檔案名稱太長無法刪除
可用以下幾種方式解決

一、使用linux live cd開機後,再用內建的檔案管理器刪除
二、如果該pc有安裝7-ZIP,可先使用管理者開啟7-zip程式,再瀏覽至該目錄,然後重新命名檔案,即可刪除。

2014年2月10日 星期一

設定XAMPP虛擬主機

當使用XAMPP做為網站測試平台,有時可能會設定不同的網站
而預設XAMPP的根目錄是/xampp/htdocs/,如果將網站放到此目錄下
例如/xampp/htdocs/web,那打開該網站時,路徑會變成htpp://website/web
會多出/web這個目錄名稱,如果不想多出這個名稱,可以用以下方法達成

修改/xampp/apache/conf/extra/httpd-vhosts.conf

於最下方先新增兩個規則localhost和127.0.01
NameVirtualHost *:80
##增加localhost規則,否則localhost不用使用
<VirtualHost *:80>
    ServerAdmin webmaster@localhost.com
    DocumentRoot "/xampp/htdocs/"
    ServerName localhost
    ServerAlias www.localhost.com
    ErrorLog "logs/localhost.com-error.log"
    CustomLog "logs/localhost.com-access.log" common
</VirtualHost>

##增加127.0.0.1規則,否則127.0.0.1不用使用
<VirtualHost *:80>
    ServerAdmin webmaster@127.0.0.1
    DocumentRoot "/xampp/htdocs/"
    ServerName 127.0.0.1
    ErrorLog "logs/127.0.0.1-error.log"
    CustomLog "logs/127.0.0.1-access.log" common
</VirtualHost>

再針對要測試的網站做設定,例如網站為www.example.com,存放路徑為/xampp/htdocs/example/,則新增規則如下
<VirtualHost *:80>
    ServerAdmin webmaster@example.com
    DocumentRoot "/xampp/htdocs/example/"
    ServerName example.com
    ServerAlias www.example.com
    ErrorLog "logs/example.com-error.log"
    CustomLog "logs/example.com-access.log" common
</VirtualHost>
完成後再去執行www.example.com,應該會直接顯示為www.example.com,而不是www.example.com/example了。