2009年8月5日 星期三

centos install useful software

yum install ftp.i386 telnet.i386 unzip.i386 vsftpd.i386 ksh.i386

 

vsftpd.i386
chkconfig --level vsftpd
vi /etc/vsftpd/vsftpd.conf
chkconfig --level 235 vsftpd on
service vsftpd start

centos install nslookup

yum install bind-utils -y

Wordpress 佈景主題

Evidens - Wordpress theme
http://designdisease.com/

image

Wordpress 支援 Windows Live Writer 設定

 

image

Install WordPress 2.8.2 練習

WordPress
http://wordpress.org/
http://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install
http://wptw.org/

環境:
CentOS release 5.3 (Final)

WordPress 最低要求:
PHP 4.3 或更新版本
MySQL 4.0 或更新版本
Apache模組: mod_rewrite

/phpinfo.php">/phpinfo.php">http://<web server>/phpinfo.php

<?php
// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);
?>

cd var/www
gzip -d -c wordpress-2.8.2.tar.gz | tar xvf - 

mkdir -p wordpress/wp-content/languages
mv  WordPress_zh_TW_2.8.zip wordpress/wp-content/languages
cd  wordpress/wp-content/languages
unzip WordPress_zh_TW_2.8.zip
rm –rf WordPress_zh_TW_2.8.zip

mysql> create database wordpress ;
mysql> grant select,insert,update,delete,create,drop,index  on wordpress.* to  wp@localhost identified by 'wp123' ;
mysql> quit ;
shell> mysql wordpress -uwp -p

. Rename the wp-config-sample.php file to wp-config.phps
. Open wp-config.php in your favorite text editor and fill in your database details as explained in Editing wp-config.php to generate and use your secret key password.

正體中文語系檔安裝簡易說明
在 /wp-content 或 /wp-includes 目錄內建立一個名為 languages 的目錄。
將 zh_TW.mo 檔案置於該目錄內。
在文字編輯器內開啟你的 wp-config.php 檔案設定正體中文語系:
define ('WPLANG', 'zh_TW');
資料庫格式請使用 utf-8,另於 wp-config.php 檔案內設定資料庫連線資訊如下:
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', 'utf8_unicode_ci');


. Place the WordPress files in the desired location on your web server:
. Run the WordPress installation script by accessing wp-admin/install.php in your favorite web browser.

 

image

image s

admin/D^^BiukC4%S4

Connect Mysql via PHP smaple code

 

refer : How to use PHP to connect MySQL Database?
https://forum.website-solution.net/viewtopic.php?t=65

<?php
# ######################################################################
# ######## MySQL Database Username, Password, and Database Name ########
# ######################################################################
$mySQLUsername = "root";   # Change to your MySQL username
$mySQLPassword = "123";      # Change to your MySQL password
$mySQLDBname = "mysql";      # Change to your MySQL database name
$mySQLDBHost = "localhost";      # Normally is localhost

# ###########################################
# ######## Initialize the Connection ########
# ###########################################
$mysqlLink = mysql_connect( $mySQLDBHost , $mySQLUsername, $mySQLPassword )
          or die("Could not connect to MySQL database - $mySQLDBname");

# #################################
# ######## Select Database ########
# #################################
mysql_select_db( $mySQLDBname ) or die("Could not select database - $mySQLDBname");

# ###################################################################
# ######## Prepare SQL, Fetch Data, and display it onto HTML ########
# ###################################################################
$strSQL = "select host,user from user";
$result = mysql_query($strSQL) or die("Query failed - $strSQL");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
   $strHost = $row[ 'host' ];
   $strUser = $row[ 'user' ];
   echo "\n<p>Host: $strHost , User: $strUser  </p>";
}

# ###########################################
# ######## Close the MySQL connecton ########
# ###########################################
mysql_close( $mysqlLink );

?>

PremiumSoft Navicat Lite 8.2 connect to mysql

 

Setup connection

image

1st connect fail cause error 1130

image

Allow root user can remote connect

Local connect to MySQL via command line and add new user@remote hosts

mysql mysql -uroot –p
mysql>insert into user values
('%','root',password('123'),
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'
,'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'
,'Y','Y','Y','Y','Y','Y'
,'','','',''
,0,0,0,0);
mysql>flush privileges;
mysql> select host, user from user ;

2nd connect ok

 image