熱門文章

2014年9月19日 星期五

FREEBSD10中pkg套件安裝

安裝pkg套件
#cd /usr/ports/ports-mgmt/pkg

#make install clean

#pkg install bash 安裝bash套件

#pkg install cvsup

1.安裝MySQL5.6
#pkg install mysql56-server
#ee /etc/rc.conf
加入一行
mysql_enable="YES"
啟動MySQL服務
#/usr/local/etc/rc.d/mysql-server start
設定 MySQL Root 的密碼 請自行修改為自己想要的密碼
#mysqladmin -u root password 新密碼
測試登入一下 MySQL,有出現以下畫面就 OK
#mysql -u root -p
Enter password: (請輸入密碼)
離開MySQL請輸入exit



2.安裝Apache2.4
#pkg install apache24
#ee /etc/rc.conf
加入這行
apache24_enable="YES"
啟動Apache2.4
#/usr/local/etc/rc.d/apache24 start

3.安裝php5.5 於Apache2

#pkg install mod_php55

修改設定檔
#ee /usr/local/etc/apache24/httpd.conf
找看看有沒有這行
LoadModule php5_module libexec/apache24/libphp5.so
如果沒有就到ports裡面的php55重新下make config後,找到Apache選項勾選並make reinstall clean重裝php5
在來回到httpd.conf找到
AddType text/html .shtml
底下加入這兩行
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
再來找到
<IfModule dir_module>
DirectoryIndex index.html
< /IfModule>
在index.htm之前或之後加上index.php,變成這樣
<IfModule dir_module>
DirectoryIndex index.php index.html
< /IfModule>
存檔離開

4.安裝php5.5擴充模組
# pkg install mod_php5

# pkg install php55-extensions

5.安裝phpMyAdmin
# pkg install phpmyadmin
安裝過程請取消勾選APC套件,因為它不支援php5.5
將phpmyadmin移動到網路伺服器根目錄
#mv /usr/local/www/phpMyAdmin /usr/local/www/apache24/data/phpmyadmin
修改設定文件
#cd /usr/local/www/apache24/data/phpmyadmin/
#cp config.sample.inc.php config.inc.php
#ee config.inc.php
存檔離開
#chmod 755 config.inc.php
再次重新啟動Apache
#/usr/local/etc/rc.d/apache24 restart
完成

登入方式
http://你的ip/phpmyadmin
網頁根目錄是在
/usr/local/www/apache24/data/

#pkg install pear
#pkg install php5-bcmath
#pkg install php5-ftp
#pkg install php5-curl
#pkg install php5-gettext
#pkg install php5-mysql
#pkg install php5-ldap
#pkg install php5-hash
#pkg install php5-json
#pkg install php5-imap
#pkg install php5-iconv
#pkg install php5-posix
#pkg install php5-tokenizer
# pkg help install 說明參數install用法
-----------------------------------------------------------------------------
pkg用法參數
add            Registers a package and installs it on the system
annotate       Add, modify or delete tag-value style annotations on packages
audit          Reports vulnerable packages
autoremove     Removes orphan packages
backup         Backs-up and restores the local package database
check          Checks for missing dependencies and database consistency
clean          Cleans old packages from the cache
convert        Convert database from/to pkgng
create         Creates software package distributions
delete         Deletes packages from the database and the system
fetch          Fetches packages from a remote repository
help           Displays help information
info           Displays information about installed packages
install        Installs packages from remote package repositories
lock           Locks package against modifications or deletion
plugins        Manages plugins and displays information about plugins
query          Queries information about installed packages
register       Registers a package into the local database
remove         Deletes packages from the database and the system
repo           Creates a package repository catalog
rquery         Queries information in repository catalogs
search         Performs a search of package repository catalogs
set            Modifies information about packages in the local database
ssh            ssh packages to be used via ssh
shell          Opens a debug shell
shlib          Displays which packages link against a specific shared library
stats          Displays package database statistics
unlock         Unlocks a package, allowing modification or deletion
update         Updates package repository catalogs
updating       Displays UPDATING information for a package
upgrade        Performs upgrades of packaged software distributions
version        Displays the versions of installed packages
which          Displays which package installed a specific file
-------------------------------------------------------------------------------

# pkg remove tmux 移除套件
# pkg autoremove
# pkg info 系統已經安裝的套件
# pkg upgrade -y 套件升級
# pkg search vim 尋找套件