vi app/config/app.php
'debug' => false,
改成
'debug' => true,
即可
helloworld
目前分類:系統管理 (418)
- Feb 06 Mon 2017 16:27
enable laravel debug mode
- Feb 03 Fri 2017 12:14
freebsd 10.x + apache 2.4 + php 7.0
更新ports-tree
portsnap fetch extract
portsnap fetch update
安裝 Apache 2.4
cd /usr/ports/www/apache24
make install
選擇event 模式
(x) MPM_EVENT MPM worker variant with the goal of consuming threx
(x) MPM_SHARED all MPMs as loadable module
安裝php7.0
cd /usr/ports/lang/php70
make install
[x] ZTS Force Zend Thread Safety (ZTS) build
安裝需要的php extensions
cd /usr/ports/lang/php70-extensions
make install
設定apache 支援php
/usr/local/etc/apache24/Includes/php-fpm.conf
<FilesMatch "\.php$">
SetHandler "proxy:unix:/tmp/php-fpm.sock|fcgi://localhost"
</FilesMatch>
編輯 /etc/rc.conf
php_fpm_enable="YES"
apache24_enable="YES"
啟動 apache && php-fpm
/usr/local/etc/rc.d/php-fpm start
/usr/local/etc/rc.d/apache24 start
測試網頁是否正常
<?php
phpinfo();
?>
- Nov 16 Wed 2016 12:47
停用 openssl sslv2 sslv4 rc4
download source and
./config --prefix=xxxx no-ssl2 no-ssl3 no-weak-ssl-ciphers
make
make install
HTTPS權威指南:在服務器和Web應用上部署SSL/TLS和PKI
- Oct 24 Mon 2016 14:19
ssh遠端登入免密碼
測試環境: CentOS 6.x
假設我們想要不需輸入密碼就可以從 user@server-a 遠端登入 userb@server-b
首先使用 usera 登入 server-a
1. ssh-keygen
2. ssh-copy-id userb@server-b
3. 測試
ssh userb@server-b hostname
- Oct 07 Fri 2016 15:34
備份 fortigate 防火牆設定檔
1. 登入防火牆web 管理介面
2. System -> Dashboard -> Status -> System Information -> System Configuration -> Backup
3. 選擇要儲存的地方
可以選擇 Local PC 或是 USB Disk
另外也可以選擇是否要加密壓縮
UTM Security With Fortinet: Mastering FortiOs
- Sep 12 Mon 2016 16:35
vmware esx/esxi 的 crontab
vmware esx/esxi 的 crontab
路徑
/var/spool/cron/crontabs/root
#min hour day mon dow command
1 1 * * * /sbin/tmpwatch.py
1 * * * * /sbin/auto-backup.sh
0 * * * * /usr/lib/vmware/vmksummary/log-heartbeat.py
*/5 * * * * /sbin/hostd-probe ++group=host/vim/vmvisor/hostd-probe
重啟crontab
kill `cat /var/run/crond.pid`
/usr/lib/vmware/busybox/bin/busybox crond
- Sep 02 Fri 2016 15:52
使用 vmware vcenter converter standalone 實現p2v , v2v
至vmware 官網下載vmware vcenter converter standalone 這套免費的工具
簡單介紹幾個方便的功能
點選 "converter machine" 後會出現以下畫面
如果要做P2V (Physical to Virtual ,實體轉換至虛擬)
可以選擇 powered on
接下來選擇
Remote Windows machine
Remote Linux machine
This local machine
選擇完後,輸入來源端的ip及 足夠權限的帳號密碼進行下一步
此時程式會嘗試登入來源端機器收集一些資訊
下個畫面輸入目的端vm host的資訊,接著下一步
輸入guestos 名稱,預設是來源主機的hostname
選擇要放在哪個resource pool , datastore 以及 virtual machine version
接下來確認guestos 的配置,需要注意的是 Helper VM network
後續轉換過程中需要用到,如果你的環境中有 dhcp server 的話,就用預設自動抓取即可
如果沒有的話就給他一個暫時的ip,沒錯,暫時的,轉換完成後就不需要了
最後就開開心心的放下去跑,泡個咖啡,大個便再回來看看結果囉
如果要做虛擬機之間的複製或轉換(V2V)可以選擇 powered off
有以下幾個host 來源可以選擇
VMware Infrastructure virtual machine
VMware Workstation or other VMware virtual machine
Hyper-V Server
這個就方便多了,只要是選擇來源的host機和目的端的host
之後也是一樣開開心心的開始轉換了
實戰VMware vSphere 6.x企業私有雲建置:異地備援x軟體定義儲存x高可用性
- Aug 25 Thu 2016 16:25
config pptp vpn client on CentOS Linux
vpn server : vpn.mybox.tw
username: user001
password: p@ssw0rd
1. yum -y install pptp
2. edit /etc/ppp/chap-secrets
user001 PPTP p@ssw0rd *
3. vi /etc/ppp/peers/vpn.mybox.tw
pty "pptp vpn.mybox.tw --nolaunchpppd"
name user001
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam vpn.myserver.org
4. modprobe ppp_mppe
5. review /etc/ppp/options.pptp
lock
noauth
refuse-pap
refuse-eap
refuse-chap
nobsdcomp
nodeflate
require-mppe-128
6. connect to vpn server
pppd call vpn.mybox.tw
7. check logs , /var/log/messages
8. check ifconfig and route
9. disconnect
killall pppd
- Aug 19 Fri 2016 16:21
使用 RICOH THETA S 在 youtube 360 度直播教學
首先至theta360 官網下載即時串流應用程式
找到適合的應用程式並下載安裝
https://theta360.com/ct/support/download/
- Jun 21 Tue 2016 16:09
nginx-rmpt + ffmpeg + jwplaer 進行直播測試
RTMP 是 Real Time Messaging Protocol 的縮寫
該協定是Adobe Systems公司為Flash播放機和伺服器之間音訊、視頻和資料傳輸 開發的開放協定
本次測試環境主要分為三大部分
1. rtmp server: 安裝nginx-rtmp
2. push to rtmp: Adobe Flash Media Live Encoder 或是 ffmpeg
3. rtmp player: jwplayer
[安裝server]
nginx 是戰鬥民族出品的強大web server,我們必須要再加裝nginx-rtmp 模組才可以支援rtmp 串流
以CentOS 為例
wget https://copr.fedorainfracloud.org/coprs/lkiesow/nginx-rtmp/repo/epel-6/lkiesow-nginx-rtmp-epel-6.repo
yum install nginx-rtmp
以FreeBSD 為例
cd /usr/ports/www/nginx (勾選rtmp)
make install
設定檔範例
vi nginx.conf
#user nobody;
worker_processes 1;
error_log /var/log/rtmp_error.log debug;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
chunk_size 8192;
application rtmp {
#### 設定 access control
allow publish 192.168.2.13;
allow publish 10.0.0.0/24;
allow play all;
deny all;
live on;
#### 如果要複製一份影像到其他 rtmp server
meta copy;
push rtmp://rtmp02-server/rtmp/live;
push rtmp://rtmp03-server/rtmp/live;
}
}
}
[push to rtmp]
Adobe Flash Media Live Encoder 好處是跨平台、免費、GUI、方便外接攝影機訊號
ffmpeg 好處是方便在文字介面下透過指令推送
範例
ffmpeg -i video-file.mp4 -vcodec h264 -acodec aac -strict -2 -r 60.0 -s 1280x720 -b:a 100k -f flv rtmp://rtmp01-server/rtmp/live
[rmpt player]
至官網下載jwplayer
https://www.jwplayer.com/products/jwplayer/
範例
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>stream playing~~</title>
<script src="jwplayer.js"></script>
<script>jwplayer.key = "Your Key ~~";</script>
</head>
<body>
<div id="player"></div>
<script>
jwplayer("player").setup({
sources: [{
file: "rtmp://rtmp01-server/rtmp/live"
}],
height: 360,
width: 640
});
</script>
</body>
</html>
一手掌握短小精悍的Nginx
作者: 高群凱
出版社:佳魁資訊
出版日期:2016/11/25
語言:繁體中文
定價:490元
- Jun 06 Mon 2016 16:10
[drupal] 從文章中的作者關連到使用者頁面
首頁 » 管理 » 使用者 » 檢視使用者個人資訊 » 註冊使用者打勾 » 存檔
- Jun 06 Mon 2016 14:21
[drupal] 支援email登入
安裝 logintoboggan 模組並啟用
https://www.drupal.org/project/logintoboggan
設定 logintoboggan
Allow users to login using their e-mail address
選擇啟用並存檔
接下來打開登入頁面
即可看到提示訊息變成
使用者名稱或電子郵件地址 *
You may login with either your assigned username or your e-mail address.
- Jun 03 Fri 2016 11:31
[drupal] 列出某個 user 貼過的文章
啟用 drupal core 的 tracker 模組後
即可在個人頁看到多一個追蹤的選單
底下即是個人張貼過文章
- May 03 Tue 2016 09:40
FreeBSD + Drupal7
安裝 apache + php + mysql 就不再多說了
首先安裝 drush , drush 是文字模式下一個好用的工具
cd /usr/ports/www/drush
make install
接下來透過drush 安裝drupal 核心程式
先切換到 apache 的 DocumentRoot 或是其他可以access 到網頁的路徑
cd /home/www
drush dl drupal
Project drupal (7.43) downloaded to /home/web/www2/drupal-7.43. [success]
Project drupal contains: [success]
- 3 profiles: minimal, standard, testing
- 4 themes: bartik, seven, garland, stark
- 47 modules: drupal_system_listing_incompatible_test, drupal_system_listing_compatible_test, book, php, translation, shortcut, contact, image, profile,
field_ui, dashboard, blog, dblog, search, help, file, forum, locale, block, syslog, node, update, statistics, contextual, overlay, system, field_sql_storage,
text, list, number, options, field, rdf, path, user, toolbar, menu, color, poll, comment, aggregator, taxonomy, filter, openid, tracker, simpletest, trigger
這時候drupal 已經幫你在當下的目錄下載好目前最新release 的D drupal 7.x
下載正體中文語系
https://localize.drupal.org/download
找到Chinese, Traditional , 7.x
複製連結網址
回到drupal 目錄
cd profiles/standard/translations/
wget http://ftp.drupal.org/files/translations/7.x/drupal/drupal-7.43.zh-hant.po
開啟網頁
http://server/
Choose profile -> Standard > save and continue
Choose language -> Chinese, Traditional (繁體中文) -> save and continue
檢查系統需求 -> 依照指示完成系統需求
cd sites/default
mkdir files && chown www:www files
cp default.settings.php settings.php && chown www:www settings.php
設定資料庫 -> 安裝設定檔 -> 設定翻譯語言 -> 設定網站 -> 介面翻譯完成 -> 已完成
- Mar 11 Fri 2016 17:51
cisco switch 使用非原廠 gbic module
以下網路上看到的文章,改天找機會試試
service unsupported-transceiver
no errdisable detect cause gbic-invalid
speed nonegotiate
end
插上 光纖模組
硬體: dell R320
作業系統: CentOS release 6.7
重開機按F2 進入BIOS
找到CPU power managments 的地方
修改成 OS DBPM存檔後重開機即可
- Sep 09 Wed 2015 14:32
netapp disk zero spares
查看目前spare硬碟有以下幾種方式
aggr status -s
vol status -s
sysconfig -A
將spare硬碟做zero處理
disk zero spares
查看目前硬碟是否真的有在狂跑
sysstat -x 1
CPU NFS CIFS HTTP Total Net kB/s Disk kB/s Tape kB/s Cache Cache CP CP Disk DAFS FCP iSCSI FCP kB/s
in out read write read write age hit time ty util in out
10% 0 0 0 0 0 0 21418 21418 0 0 >60 100% 0% - 100% 0 0 0 0 0
7% 0 0 0 0 1 0 14052 14231 0 0 >60 99% 42% T 39% 0 0 0 0 0
9% 0 0 0 0 0 0 19968 19456 0 0 >60 100% 0% - 100% 0 0 0 0 0
10% 0 0 0 0 0 0 21248 21248 0 0 >60 100% 0% - 56% 0 0 0 0 0
10% 0 0 0 0 1 0 20358 20612 0 0 >60 100% 0% - 100% 0 0 0 0 0
10% 0 0 0 0 0 0 20736 20736 0 0 >60 100% 0% - 55% 0 0 0 0 0
10% 0 0 0 0 1 0 20846 20592 0 0 >60 100% 0% - 100% 0 0 0 0 0
等等等,最後會出現這樣的訊息
Wed Sep 9 16:16:19 CST [raid.disk.zero.done:notice]: Disk 8b.15 Shelf 0 Bay 11 [NETAPP X261_MTOMC250P05 R5VV] S/N [XXXXXXXX] : disk zeroing complete
Wed Sep 9 16:16:41 CST [raid.disk.zero.done:notice]: Disk 8b.8 Shelf 0 Bay 4 [NETAPP X261_MTOMC250P05 R5VV] S/N [XXXXXXXX] : disk zeroing complete
Wed Sep 9 16:16:52 CST [raid.disk.zero.done:notice]: Disk 6a.15 Shelf 0 Bay 11 [NETAPP X261_MTOMC250P05 R5VV] S/N [XXXXXXXX] : disk zeroing complete
Wed Sep 9 16:16:54 CST [raid.disk.zero.done:notice]: Disk 6a.14 Shelf 0 Bay 10 [NETAPP X261_MTOMC250P05 R5VV] S/N [XXXXXXXX] : disk zeroing complete
Wed Sep 9 16:16:59 CST [raid.disk.zero.done:notice]: Disk 8b.10 Shelf 0 Bay 6 [NETAPP X261_MTOMC250P05 R5VV] S/N [XXXXXXXX] : disk zeroing complete
Wed Sep 9 16:17:21 CST [raid.disk.zero.done:notice]: Disk 6a.2 Shelf 0 Bay 2 [NETAPP X261_MTOMC250P05 R5VV] S/N [XXXXXXXX] : disk zeroing complete
- Sep 04 Fri 2015 16:48
firefox + flash 會當機的解決方式
在網址列輸入 about:config 叫出偏好設定
找到以下的設定
dom.ipc.plugins.flash.disable-protected-mode
從原來的 false 改成 true 就可以了
- Sep 01 Tue 2015 16:03
phpmyadmin 出現 您應升級到 MySQL 5.5.0 或更新版本。
安裝完 phpmyadmin 後,出現 "您應升級到 MySQL 5.5.0 或更新版本。" 的錯誤訊息
如果不想更新mysql版本的話,可以到一下網址找適合的版本安裝
https://www.phpmyadmin.net/downloads/
如 phpMyAdmin 4.0.10.10
MySQL完全攻略:資料庫開發與效能調校
- Jul 30 Thu 2015 16:54
檢視cisco router上的source ip & destination ip
針對要檢視的介面做以下的設定
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int s0/0/0
Router(config-if)#ip accounting
Router(config-if)#end
便可以用sh ip accounting檢視目前來源和目的位置
Router#sh ip accounting
Source Destination Packets Bytes
192.168.50.123 10.30.10.3 14 836
192.168.50.124 10.30.10.4 40 2480
....
....
但是無法按照數字做排序,須自己人工貼到自己熟悉的工具做排序