Solf


  • Home

  • Categories

  • About

  • Tags

  • Search

Install Fiber Channel in Openfiler 2.99

Posted on 21-04-2013 | In System |

Due to high demand of IO, we have to upgrade the hardware of iSCSI server. This time, Fiber Channel is our option. This post will show how to enable FC in Openfiler 2.99 and map a volume to FC card.

1. Unmap the volume, this can be done via the web interface Openfiler provided.

2. Enable Fiber Channel via service sectionopenfiler-services

3. run the following command to enable vdisk_fileio and vdisk_blockio handlers

1
2
3
4
5
6
7
8
9
10
11
12
modprobe scst_disk
modprobe scst_vdisk
modprobe qla2x00tgt
modprobe scst_vdisk
modprobe scst_user
modprobe scst_modisk
modprobe scst_processor
modprobe scst_raid
modprobe scst_tape
modprobe scst_cdrom
modprobe scst_changer
modprobe ib_srpt

4. Create a scst device

1
scstadmin -open_dev <device-name > -handler <vdisk_fileio or vdisk_blockio > -attributes filename=<path of logical volume >

Read more »

Cookie, Session, Data Transfer and SQL Injection

Posted on 29-05-2012 | In Sharing |

You may misunderstand what is a cookie and what is a session. Because my knowledge is very limited in the PHP world, I’d like to share my experience in other world.

Generally speaking, cookie is cookie, session is session, they are totally different topics. So hijacking cookie has nothing to do with hijacking session.

What are session, cookie and data transfer?

“A session is defined as the period of time that a unique user interacts with a Web application.” - from MSDN

It looks like that it is a cookie, isn’t it? No, it’s not. It only defines a behaviour or an event. So many kinds of technologies could be used for SESSION.

Cookie is just one of them, which is proved to be unsafe already. From many years ago, we’ve stopped using cookie to store any confidential information in the production environment. I think even a rookie programmer will know this basic rule.

If cookie is not safe, what we use to store information more safely? From .Net 1.1, we use two kinds of Cookieless session consisting of .Net Session and SQL Server Session. Both of them use the different technology from Cookie.

.Net Session is HTTP only and stored at server side so that it cannot be read from javascript. Although it could be changed by javascript, it is nearly impossible for a hacker to guess an unique session id. ASP.NET is designed with the XSS weakness in mind - the session ID is suitably long and hard to predict.

.Net Session is an in-memory session, which is not very stable. For a more reliable requirement, a SQL Server session could be used instead.

Read more »

Install Nginx 1.0.15 + PHP 5.3.12 + MySQL 5.1.62 on CentOS 6.2

Posted on 20-05-2012 | In Sharing |

Since I’ve chose to run a low-memory VPS for my blog, I decide to install the ‘lnmp’ manually. Here I will show how to do it (install Nginx 1.0.15 + PHP 5.3.12 + MySQL 5.1.62 + eAccelerator 0.9.6.1).

Prepare

1. Of course a pc with Internet connection, virtual machine is the best option if this is the first time.

2. Flush ‘iptables’ if necessary, and shut down SELINUX

3. Download directory is /usr/local/src

Installation

First, download all source code

1
2
3
4
5
6
7
8
9
10
cd /usr/local/src
wget http://nginx.org/download/nginx-1.0.15.tar.gz
wget http://au.php.net/get/php-5.3.12.tar.gz/from/us.php.net/mirror
wget http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.1/mysql-5.1.62.tar.gz
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
wget http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?modtime=1171868460&big_mirror=0
wget http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz?modtime=1194463373&big_mirror=0
wget http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz?modtime=1175740843&big_mirror=0
wget http://downloads.sourceforge.net/project/pcre/pcre/8.30/pcre-8.30.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.30%2F&ts=1335184494&use_mirror=aarnet
wget http://downloads.sourceforge.net/project/eaccelerator/eaccelerator/eAccelerator%200.9.6.1/eaccelerator-0.9.6.1.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Feaccelerator%2Ffiles%2Feaccelerator%2FeAccelerator%25200.9.6.1%2F&ts=1335276559&use_mirror=waix

Then install some libaries, they should be libiconv,libmcrypt,mhash, mcrypt and pcre

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
tar zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local
make
make install
cd ../
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make
make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make
make install
cd ../../
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure
make
make install
cd ../
ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
cd ../
tar zxvf pcre-8.30.tar.gz
cd pcre-8.30
./configure
make && make install
cd ../

Install MySQL

Read more »

Hello world!

Posted on 07-05-2012 | In Sharing |
Welcome to WordPress. This is your first post. Edit or delete it, then start blogging! 12$s = array();$test = 'this is Solf's Blog'; EOF
Read more »
Solf

Solf

4 posts
2 categories
10 tags
Creative Commons
© 2012 — 2017 Solf
Powered by Hexo
|
Theme — NexT.Mist