Calendar

2007年十一月
« 十   十二 »
 1234
567891011
12131415161718
19202122232425
2627282930  

Translator

MySQL 5新特性及安装

MySQL AB 公司正式发布 MySQL 5.0 这一公司成立十年来最重大的产品升级版本。

MySQL 5.0的新的特性、功能包括:
存储过程与 SQL 函数 — 内嵌商业逻辑到数据库中并提升性能;
触发器 — 在数据库层执行复杂的商业规则;
视图 — 确保敏感信息安全;
游标 — 更容易的数据库开发及大数据集的引用;
信息模式 — 提供对元数据的便利访问;
XA 分布式事务处理 — 支持异构环境中跨多个数据库的复杂事务;
SQL 模式 — 提供服务器强制执行的数据完整性检查;
新的 Federated 和 Archive 存储引擎 — MySQL 独一的可插式存储引擎架构使得用户可基于需求,轻松地切换数据库引擎以获得更大的灵活性、更多的功能及更好的性能;
新的移植工具 — 新的图形化工具箱可从 Oracle, Microsoft SQL Server, Microsoft Access 及其它数据库平台完全移植所有数据和对象到 MySQL 中;
实例管理器 — 新的管理助手允许远程启动/停止任一 MySQL 服务器,以及配置文件的远程编辑,错误与查询日志的远程查看等功能;
升级的连接器与可视化工具 — 提供更高性能的新版 MySQL 的 ODBC, Java 与 .NET 数据库驱动程序, 以及升级了的 MySQL 查询浏览器和 MySQL 管理器。

MySQL Installation:

wget -P tar/ http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.17.tar.gz/from/http://www.greatlinux.com/mysql/
tar zxvf tar/mysql-5.0.17.tar.gz
cd mysql-5.0.17
groupadd mysql
useradd -g mysql mysql
CFLAGS=”-O3″ CXX=gcc CXXFLAGS=”-O3 -felide-constructors -fno-exceptions -fno-rtti” \
./configure –prefix=/usr/local/mysql \
–enable-assembler –with-mysqld-ldflags=-all-static –with-charset=gbk
make -j 10
make install
cp support-files/my-medium.cnf /etc/my.cnf

Click to continue reading

phpMyAdmin安装、配置、使用(for linux and FreeBSD)

1. Installation  

wget -P tar/ http://easynews.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.7.0-pl2.tar.bz2
tar jxvf tar/phpMyAdmin-2.7.0-pl2.tar.bz2
mv phpMyAdmin-2.7.0-pl2 mysqladmin    #(可选地址)
cp -R mysqladmin /usr/local/apache/htdocs/  

2. configuration  

vi /usr/local/apache/htdocs/mysqladmin/config.default.php
#修改你将上传到空间的phpMyAdmin的网址
#如:$cfg['PmaAbsoluteUri'] = ‘http://your.domain.com/phpmyadmin/’;
$cfg['Servers'][$i]['host'] = ‘localhost’;(通常用默认,也有例外)
$cfg['Servers'][$i]['auth_type'] = ‘config’; // Authentication method (config, http or cookie based)?
在自己的机子里调试用config,如果在网上用cookie。
$cfg['Servers'][$i]['user'] = ‘root’; // MySQL user(用户名,自己机里用root,在网上设你的ftp用户名)
$cfg['Servers'][$i]['password'] = ”; // MySQL password (only needed
自己机里不用设 $cfg['Servers'][$i]['only_db'] = ”; // If set to a db-name, only(你只有一个数据就设置一下)还有设$cfg['DefaultLang'] = ‘zh’;  

3. security

#增加用户认证 http://www.ericbess.com/ericblog/2007/12/29/apache-linuxfreebsd-setup/
section
2  

FreeBSD Ports install 

cd /usr/ports/databases/phpmyadmin
echo “WITHOUT_X11=YES” >> /etc/make.conf
make install clean
cp /usr/local/www/phpMyAdmin/config.sample.inc.php /usr/local/www/phpMyAdmin/config.inc.php
ee /usr/local/www/phpMyAdmin/config.inc.php
$cfg['blowfish_secret'] = ‘e2311′; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
edit httpd.conf
Alias /phpmyadmin/ “/usr/local/www/phpMyAdmin/”    
    <Directory “/usr/local/www/phpMyAdmin/”>
        Options none
        AllowOverride Limit
        Order Deny,Allow
        Allow from all
    </Directory>  

Click to continue reading

PHP 整理(Linux,Freebsd)

1. Installation php

Installing PHP 4.4.1 (Linux)

1
2
3
4
5
6
7
wget -P tar/ http://cn.php.net/get/php-4.4.1.tar.bz2/from/this/mirror
tar jxvf tar/php-4.4.1.tar.bz2
cd php-4.4.1
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs
make -j 10
make install
cp php.ini-dist /usr/local/php/lib/php.ini

Configuring PHP (Linux)

vi /usr/local/php/lib/php.ini
#;default_charset = “iso-8859-1″
#在这行下面加一行
#default_charset = “gbk”

vi /usr/local/apache/conf/httpd.conf
#找到#AddType application/x-tar .tgz 这行,在下面加两行

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

#找到下面一行在后面加上index.php,这表示网站的默认页也能够为index.php

1
DirectoryIndex index.html index.html.var index.php

#注意:改变了http.conf后,要重启apache服务
#确认安装成功了解配制信息: echo “<? phpinfo(); ?>” >/usr/local/apache/htdocs/phpinfo.php
#访问http://yourserver/phpinfo.php  

Installing  PHP(FreeBSD port)

# cd /usr/ports/lang/php5
# make install clean

Adding the PHP 5 module to Apache(22) >>/usr/local/etc/apache22/httpd.conf

1
2
3
DirectoryIndex index.php index.html index.htm
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps  

Configuring PHP (freeBSD)

# cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini

Click to continue reading

客户公司SOX关于LINUX帐号的审计要求及本人与redh­at工程师的解决之道。

SOX demand  for linux OS password 

      1. A unique user ID is required in combination with a password to access the system. 
      2. Automatic password changing after 60 days where technically feasible.  If not technically feasible, a compensating control is in place. 
      3. Password minimum length of 8 characters or maximum length allowed by system when the allowable length is less than 8 characters. 
      4. User IDs/Accounts suspended after 6 invalid logins if technically feasible.  If not technically feasible, a compensating control is in place. 
      5. Accounts inactive for 60 days are disabled if technically possible.  If not technically possible, a compensating control is in place. 
      6. Password history of 12 is enabled which prohibits the reuse of the last 12 passwords 
      7. Following a new user’s initial logon to the application, the user is prompted to change password.

>From Me

For 2. Expired Setting
[root@localhost]# passwd -x 60 -w 10

For 1.Complexity Setting
Add the following lines to /etc/pam.d/passwd
password requisite       pam_cracklib.so type
=”Retype-3-At-least-8-letters-1-capital-1- character” retry=3
minlen=10 ucredit=1 ocredit=1
password required        pam_unix.so use_authtok

Reference Documents
passwd manual
The Linux-PAM System Administrators’ Guide
http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/pam.html#toc6

Click to continue reading