2012年9月18日 星期二

www ipv6


iface eth0 inet6 static
address 2001:288:732D::2
netmask 64
gateway 2001:288:732D::fffe

auto eth0

2012年9月9日 星期日

安裝完xoops後需修改之處


安裝完xoops後需修改之處
xoops/mainfile.php
<?php
/**
 * XOOPS main configuration file
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright   The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license     GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
 * @version     $Id: mainfile.dist.php 8066 2011-11-06 05:09:33Z beckmi $
 */

if (!defined("XOOPS_MAINFILE_INCLUDED")) {
    define("XOOPS_MAINFILE_INCLUDED", 1);

    // XOOPS Physical Paths

    // Physical path to the XOOPS documents (served) directory WITHOUT trailing slash
    define('XOOPS_ROOT_PATH', '/var/www/xoops');

    // For forward compatibility
    // Physical path to the XOOPS library directory WITHOUT trailing slash
    define('XOOPS_PATH', '/var/www/xoops/xoops_lib');
    // Physical path to the XOOPS datafiles (writable) directory WITHOUT trailing slash
    define('XOOPS_VAR_PATH', '/var/www/xoops/xoops_data');
    // Alias of XOOPS_PATH, for compatibility, temporary solution
    define("XOOPS_TRUST_PATH", XOOPS_PATH);

    // URL Association for SSL and Protocol Compatibility
    $http = 'http://';
    if (!empty($_SERVER['HTTPS'])) {
        $http = ($_SERVER['HTTPS']=='on') ? 'https://' : 'http://';
    }
    define('XOOPS_PROT', $http);

    // XOOPS Virtual Path (URL)
    // Virtual path to your main XOOPS directory WITHOUT trailing slash
    // Example: define('XOOPS_URL', 'http://163.26.37.123/xoops');
    define('XOOPS_URL', 'http://163.26.37.124/xoops');
--More--(55%)

2012年9月2日 星期日

ubuntu下修改mysql默认字符编码出现的Job failed to start解决办法


 前几天卸掉了用了好多年的Windows,安装了Ubuntu12.04,就开始各种搭环境。今天装好了MySQL5.5.22,正用着爽呢,突然发现里面的中文全部变成了乱码,于是便试着去修改配置,经查询
        可以通过以下步骤修改:
$sudo gedit /etc/mysql/my.cnf
        在里面
[client]下添加:
default-character-set=utf8
[mysqld]下添加:
default-character-set=utf8
        然后就保存退出跟着大部队开始
$sudo service mysql restart
        结果意外的发现跟大部队不一样,居然出现了Job failed to start

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

        后来去看同学的配置,发现跟我的一模一样,但是他的能够正常运行,之后看到他的MySQL是5.2的,才发现可能是因为版本升级的原因,对于配置文件内的数据更改的方式不一样。于是果断上网查5.5以后的版本对字符编码方式修改的办法,才发现原来在[mysqld]下的修改已经发生了变化,正确方式如下:
[mysqld]下添加的应该为:
character-set-server=utf8
collation-server=utf8_general_ci
        保存退出
$sudo service mysql restart
        果然成功重启
$mysql
         之后出现
mysql>
         输入show variables like 'character%';
         输出如下:

+-----------------------------------+-----------------------------------+
| Variable_name                    | Value                                    |
+-----------------------------------+-----------------------------------+
| character_set_client           | utf8                                         |
| character_set_connection | utf8                                         |
| character_set_database    | utf8                                         |
| character_set_filesystem   | binary                                    |
| character_set_results         | utf8                                         |
| character_set_server          | utf8                                         |
| character_set_system         | utf8                                         |
| character_sets_dir               | /usr/share/mysql/charsets/ |
+------------------------------------+-----------------------------------+
8 rows in set (0.00 sec)


          成功!
          个人记性差,写博记下免得下次改配置耽误时间。同时供碰到同样问题的同学们参考,如果高手发现其中纰漏,还请指出并轻拍。

          转载请注明:http://waynehu16.iteye.com/blog/1557777

2012年9月1日 星期六

修改ip


vi /etc/network/interfaces
iface eth0 inet static
address 163.26.37.18
netmask 255.255.255.0
gateway 163.26.37.254

/etc/init.d/networking restart