»

Use ownCloud to build your own network drive

Log — Tags: , , — Posted by Starck on June 12, 2013


Install linux packages

apt-get update and some libraries:
Ubuntu 13.04:


Download web installer


Server Web-DAV Installation

Open your browser, run the web installer script, ex: http://{domain.name}/setup-owncloud.php

follow the steps in installer, finish it.


Sync-Client Installation

for MacOS:

download

Reference

How to setup owncloud 5 on ubuntu 12.10

mobile01 – OwnCloud, 一套適合自建的網路同步硬碟

MySQL error

Log — Tags: , — Posted by Starck on April 11, 2013

今天 Mac mini 工作機的 MySQL 又出問題了, 所以想把它重新安裝一下…

到官網下載 mysql-5.5.16-osx10.6-x86_64.dmg

安裝前先備份 databases:

安裝 MySQL

安裝後 MySQL 會把程式分別放在以下三個地方:

  • /usr/local/mysql-5.5.16-osx10.6-x86_64 (主程式)
  • /Library/StartupItems/MySQLCOM (用來放置系統啟動時自動執行的 plist 配置檔)
  • /Users/Zmax/Library/PreferencePanes/MySQL.prefPane (系統偏好設定的界面)

因為我的 sql 資料有點大, 所以到 /etc/my.cnf:

max_allowed_packet 設大一點避免資料過大而斷線

把舊的 sql 還原:

完工!

Upgrading PHP on MacOS

Log — Tags: , , , — Posted by Starck on March 29, 2013

所需工具

使用 Brew 讓在 MacOS 安裝管理套件變得容易許多, 而 HomeBrew-PHP 則是讓你在 MacOS 上安裝 PHP 和管理 extensions 的 Brew 套件.

Brew

安裝 Brew:

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

如果之前已經安裝過 Brew, 依據習慣, 我會將 Brew 更新到最後的版本:

brew update

brew upgrade

Installation

Tap the homebrew/dupes repository into your brew installation:

brew tap homebrew/dupes

Tap the repository into your brew installation:

brew tap josegonzalez/homebrew-php

安裝參數說明

brew options php54

安裝 php 5.4

brew install php54

安裝時可能會出現的問題

jpeg8-d:

jpeg8-d is already installed, it's just not linked
    Could not symlink file: /usr/local/Cellar/jpeg/8d/bin/wrjpgcom
    Target /usr/local/bin/wrjpgcom already exists. You may need to delete it.
    To force the link and delete this file, do:
    brew link --overwrite formula_name

解法: brew link --overwrite jpeg

reference

Apache httpd.conf 設定

先檢查 /usr/local/Cellar/php54/ 下的 php 版本號是多少, 例如: 5.4.12

** Update 2013-08-07 **

在 Moutain Lion Server 下, 修改 php module 讀取路徑要到 /Library/Server/Web/Config/apache2/httpd_server_app.conf

** Update 2013-10-26 **

After updating Mavericks Server, please also upgrade to the latest Xcode and make sure you re-install Command-line Tools: xcode-select --install

Edit /Library/Server/Web/Config/apache2/httpd_server_app.conf:

如果使用 FPM, 請在 Terminal 下達:

Command-line

If you would like to swap the PHP you use on the command line, you should update the $PATH variable in either your .bashrc or .bash_profile:

[MacOS] mysql.sock error

Log — Tags: , — Posted by Starck on March 28, 2013

今天在使用 Terminal 連線到本機 MySQL 時發生錯誤:

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

因為平常使用 phpMyAdmin 都是正常的, 所以不確定這個情況是什麼時候開始和什麼原因造成的. 查看 /etc/my.cnf, 確認 mysql.sock 是設在 /var/mysql/mysql.sock(不知道為什麼用 mysql 指令時它會跑去透過 /tmp/mysql.sock) , 沒時間處理這個問題, 所以先用 symbolic link 的方式解決.

$ ln -s /var/mysql/mysql.sock /tmp/mysql.sock

(c) 2024 Starck Lin | powered by WordPress