Categories
- FFMpeg (5)
- Libav (1)
- Google (3)
- iBeacon (1)
- LDAP (3)
- Me (2)
- Network (11)
- OS (149)
- RTMP (4)
- SIP (1)
- Kamailio (1)
- SNMP (1)
- VMware (20)
- VCP考試 (1)
- 伺服器 網站服務 (105)
- 名詞解釋 (4)
- 專案管理 (1)
- 工具軟體 (50)
- Adobe (1)
- FMS (1)
- Cloudera (1)
- Docker (1)
- Eclipse (4)
- Intellij (2)
- OBS (2)
- Office (10)
- Excel (4)
- PowerPoint (5)
- Postman (1)
- Splunk (13)
- Virtualbox (2)
- Visual Studio (2)
- 文字編輯器 (10)
- Sublime Text 2 (6)
- Sublime Text 3 (3)
- Vim (3)
- 連線工具 (1)
- Xshell (1)
- Adobe (1)
- 程式語言 (79)
- CSS (2)
- HTML (2)
- iOS (1)
- Java (30)
- JavaScript (5)
- jQuery (4)
- jsTree (2)
- JSP (3)
- PHP (16)
- Python (7)
- Ruby (1)
- sed (1)
- Shell Script (8)
- Windows Bash Script (1)
- XML (1)
- 資料庫 (37)
- FFMpeg (5)
Category Archives: etherpad
Nginx Proxy Setting…
因為 wisemapping 預設使用 8080 port etherpad 預設使用 9001 port 都很麻煩~~所以就使用 nginx proxy 幫忙轉址了 以下是測試很久的設定檔
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
location /pad { rewrite ^/pad(/.*)$ $1 break; proxy_pass http://localhost:9001/; proxy_set_header Host $host; proxy_buffering off; access_log /var/log/nginx/etherpad.log; error_log /var/log/nginx/etherpad.log; } location /map { #rewrite ^/map(/.*)$ $1 break; proxy_pass http://localhost:8080/map; proxy_set_header Host $host; proxy_buffering off; access_log /var/log/nginx/wisemapping.log; error_log /var/log/nginx/wisemapping.log; } |
配合這個設定 etherpad 需要設定 {etherpad home directory}/settings.json
1 2 3 4 5 6 7 |
//略 //IP and port which etherpad should bind at "ip": "127.0.0.1", "port" : 9001, /*when you use NginX or another proxy/ load-balancer set this to true*/ "trustProxy": true, //略 |
wisemapping 要設定的地方比較多…. {wisemapping home directory}/webapps/wisemapping/WEB-INF/app.properties
1 2 3 4 5 |
<略> site.baseurl = http://{伺服器IP}/map <略> documentation.services.basePath=http://{伺服器IP}/map/service <略> |
{wisemapping home directory}/contexts/wisemapping.xml
1 2 3 4 5 |
<略> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <略> <Set name="contextPath">/map</Set> <略> |
Posted in etherpad, Nginx, Wisemapping
Leave a comment
Javascript的月份是從0開始…
受教了~修正 etherpad 的日期顯示以 “yyyy-mm-mm hh-mm” 顯示的過程中發現月份總是少一個月 可是看 code 又沒有什麼問題 所以用 google 搜尋 “jquery + 少1個月” 及 “javascript + 少1個月” 發現了是 javascript 對於月份是少一個月 Orz… 所以 etherpad 的原本的寫法還不錯,貼上來註記一下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
var converterPad = function (UNIX_timestamp) { var a = new Date(UNIX_timestamp); //原本的寫法是用英文顯示 //var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; //後來改以數字顯示 var months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']; var year = a.getFullYear(); var month = months[a.getMonth()]; //這邊是原本想直接用function直接抓值,結果發現都少一個月,只好自己加1 //var temp = a.getMonth() + 1; //var month = (( temp + 1 < 10) ? "0" : "") + temp; var date = (( a.getDate() < 10) ? "0" : "") + a.getDate(); var hour = (( a.getHours() < 10) ? "0" : "") + a.getHours(); var min = ((a.getMinutes() < 10) ? "0" : "") + a.getMinutes(); //return date + '. ' + month + ' ' + year + ' ' + hour + ':' + min + ' '; return year + '-' + month + '-' + date + ' ' + hour + ':' + min; }; |
Posted in etherpad, JavaScript
Leave a comment
Etherpad-lite in Ubuntu 14.04 x64 server
etherpad 安裝基本套件需求
1 |
sudo apt-get install gzip git-core curl python libssl-dev pkg-config build-essential |
更新安裝nodejs的來源
1 |
sudo curl -sL https://deb.nodesource.com/setup | sudo bash - |
安裝nodejs
1 |
sudo apt-get install nodejs |
新增etherpad的使用者
1 2 |
sudo useradd etherpad -m -s /bin/bash -r sudo passwd etherpad |
將etherpad使用者加入sudoers中
1 |
sudo usermod -a -G sudo etherpad |
切換到etherpad使用者
1 |
su - etherpad |
下載etherpad檔案
1 |
wget https://github.com/ether/etherpad-lite/zipball/master |
安裝unzip
1 |
sudo apt-get install unzip |
解壓縮etherpad壓縮檔
1 |
unzip master |
將目錄名稱變好看一點
1 |
mv ether-etherpad-lite-3ebcaad etherpad-lite |
切換到etherpad-lite目錄
1 |
cd etherpad-lite |
複製設定檔範本
1 |
cp settings.json.template setting.json |
設定etherpad基本環境
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
vim setting.json # 找到以下的設定加以替換 "requireSession" : false, "sessionNoPassword" : false, "requireAuthentication": false, "requireAuthorization": true, "users": { "admin": { "password": "password", "is_admin": true }, "user": { "password": "password", "is_admin": false } }, |
試執行,可看 http://ip:9001 是否正常
1 |
./bin/run.sh |
安裝mysql、nginx
1 |
sudo apt-get install mysql-server nginx |
建立etherpad資料庫、設定使用者權限
1 2 3 4 |
mysql -uroot -p > create database etherpad; > grant all privileges on etherpad.* to 'etherpad'@'localhost' identified by 'password'; > exit |
設定etherpad資料存放使用mysql
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
vim setting.json # 註解使用dirty的部分 //"dbType" : "dirty", //"dbSettings" : { // "filename" : "var/dirty.db" // }, # 加入使用mysql的部分 "dbType" : "mysql", "dbSettings" : { "user" : "etherpad", "host" : "localhost", "password": "password", "database": "etherpad" }, |
試執行,並請連至 http://ip:9001 增加幾筆資料 … Continue reading
Posted in etherpad, MySQL, Nagios, Ubuntu
Leave a comment