FreeBSD 9.0 install Nagios 3.4.1

更新 package-tree :
//如果是第一次更新取得 package-tree
# portsnap fetch ; portsnap extract ; portsnap update ;
//之後僅需要 fetch 和 update
# portsnap fetch ; portsnap update ;

安裝 nagios :
# cd /usr/ports/net-mgmt/nagios
# make ; make install ; // 首次安裝 nagios
# make ; make deinstall ; make reinstall //先前已安裝過 nagios

設定 nagios :

//切換至 nagios 設定檔目錄下
# cd /usr/local/etc/nagios
# cp cgi.cfg-sample cgi.cfg ; cp nagios.cfg-sample nagios.cfg ; cp resource.cfg-sample resource.cfg

//切換至 nagios/objects 物件設定檔放置的目錄下
# cd /usr/local/etc/nagios/objects
# cp commands.cfg-sample commands.cfg ; cp contacts.cfg-sample contacts.cfg ; cp printer.cfg-sample printer.cfg ; cp templates.cfg-sample templates.cfg ; cp localhost.cfg-sample localhost.cfg ; cp switch.cfg-sample switch.cfg ; cp timeperiods.cfg-sample timeperiods.cfg

允許 Freebsd 可以啟動 nagios:
//編輯 /etc/rc.conf 加入 「nagios_enable="yes"」 字串於檔案中
# echo nagios_enable="YES" >> /etc/rc.conf

啟動 nagios 服務:
# /usr/local/etc/rc.d/nagios start

安裝 LAMP :
//MySQL 安裝
# cd /usr/ports/databases/mysql50-server
# make WITH_CHARSET=utf8 WITH_XCHARSET=all WITH_COLLATION=utf8_unicode_ci BUILD_OPTIMIZED=yes install clean

安裝好之後,我們要產生 MySQL 一開始所要用的 Database,預設會裝在 /var/db/mysql 裡 ( 若不想裝在預設的地方,安裝時下參數 –localstatedir=/path/to/your/location )
# rehash
# mysql_install_db

複製 MySQL 的系統設定檔到 /etc 下
# cp /usr/local/share/mysql/my-xxx.cnf /etc/my.cnf

設定 MySQL 資料庫權限,並且啟動它
# chown -R mysql:mysql /var/db/mysql
# echo “mysql_enable=yes” >> /etc/rc.conf
# /usr/local/etc/rc.d/mysql-server start

設定 MySQL Root 的密碼
# mysqladmin -u root password 新密碼

Remember to run mysql_upgrade (with the optional –datadir=<dbdir> flag) the first time you start the MySQL server after an upgrade from an earlier version.

最後我們可以測試登入一下 MySQL,有出現以下畫面就 OK
# mysql -u root -p
Enter password: (請輸入密碼)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.60-log FreeBSD port: mysql-server-5.1.60
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.


安裝 Apache :
# cd /usr/ports/www/apache22
# make install clean

安裝 php
# cd /usr/ports/lang/php5
# make config install clean

記得要勾選此選項喔,不然 Apache 會不認得 PHP
APACHE Build Apache module

再安裝 PHP Extensions
# cd /usr/ports/lang/php5-extensions
# make config install clean


首先設定 PHP 的設定檔,以後就是設定 php.ini 這檔
# cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini

修改 Apache 的設定
# vi /usr/local/etc/apache22/httpd.conf

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

DirectoryIndex index.html
DirectoryIndex index.php index.html index.htm

設定一開機啟動 Apache & MySQL
# vi /etc/rc.conf



Howto Installing FreeBSD 9 source

Howto Installing FreeBSD 9 source

1. Download the tar file that matches the version you installed.

Unpack the archive to /usr/src:
# tar -C / -xvzf src.txz

Be aware that this will only get you the code for FreeBSD-9.0-RELEASE, not anything that has been added since then.

2. svn(1)
SVN (Subversion) is a newer source control system. It is not part of the base system, so install devel/subversion. Then check out the source:
# svn checkout svn:// /usr/src
Other versions will have different URLs, like svn:// for 9-STABLE. svn includes a larger history and can take up to twice the amount of disk space as a CVS checkout.

See the Handbook SVN mirror list for alternate servers which may be faster for you.

Install LAMP Server in Ubuntu Server 12.04 LTS

Install LAMP Server in Ubuntu Server 12.04 LTS

Log in on your ubuntu server remotly with ssh

Install LAMP Stack (Linux,Apache, Mysql, PHP) with command below:

sudo apt-get install lamp-server^

Install PHP5 (Some applications require other PHP5 mods) with command:

sudo apt-get install php5 php5-gd php5-mysql php5-curl php5-cli php5-cgi php5-dev

Install phpmyadmin

sudo apt-get install phpmyadmin

How to install Wordpress in Ubuntu Server 12.04 LTS Precise Pangolin

How to install WordPress in Ubuntu Server 12.04 LTS Precise Pangolin

Step 1. Install LAMP server on ubuntu server, to install LAMP Server in Ubuntu server 12.04 you can follow instructions @LAMP Ubuntu Server 12.04 LTS

Install LAMP Stack (Linux,Apache, Mysql, PHP) with command below:
sudo apt-get install lamp-server^
Install PHP5 (Some applications require other PHP5 mods) with command:
sudo apt-get install php5 php5-gd php5-mysql php5-curl php5-cli php5-cgi php5-dev
Install phpmyadmin
sudo apt-get install phpmyadmin

Step 2. If you do not have a problem when installing lamp server in ubuntu server 12.04, we proceed to install wordpress

sudo apt-get install wordpress

Step 3. Make a symbolic link to the Apache2 directory /var/www/ , The wordpress installation placed in directory /usr/share/wordpress folder

sudo ln -s /usr/share/wordpress /var/www/wordpress

Step 4. install WordPress with the supplied script, the script placed in directory /usr/share/doc/wordpress/examples/.

sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost

After execute this script, it will creates the MySQL database and user wordpress for the new MySQL database named localhost. If you have installed virtual host on server and/or already know your URL, it is best to name your database the same as your URL. Also if you plan on hosting multiple blogs with different virtual hosts, each needs a differently named database.

sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress_preciseserver

Step 5. For automatic updates to occur, the folder and all its files and subfolders wordpress must be owned by www-data:

chown -R www-data /usr/share/wordpress

Now, open your web browser to install wordpress, type on address bar http://localhost/wordpress

How to install wordpress on windows XP

如何在windows XP 上安裝wordpress, 按照wordpress官方的說法:主機必需要安裝php和mysql。


其實安裝wordpress很簡單只要參照wordpress安裝說明來做應該都可以很快就安裝完成了,安裝說明頁面 WordPress安裝|WordPress中文指南