Jan 27, 2011

Install Kernel for OpenVZ

  This section is the virtualization with OpenVZ. 

[1] Install Kernel for OpenVZ first and reboot system with it.
[root@ns ~]# cd /etc/yum.repos.d
[root@ns yum.repos.d]# wget http://download.openvz.org/openvz.repo
[root@ns yum.repos.d]# cd
[root@ns ~]# yum -y install ovzkernel
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Setting up Install Process
Setting up repositories
openvz-kernel-rhel5 100% |=========================|  951 B 00:00
openvz-utils 100% |=========================|951 B 00:00
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 31 kB 00:00
openvz-ker: ######################################### 14/14
Added 14 new packages, deleted 0 old in 0.26 seconds
primary.xml.gz 100% |=========================| 5.3 kB 00:00
openvz-uti: ######################################### 21/21
Added 21 new packages, deleted 0 old in 0.13 seconds
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for ovzkernel to pack into transaction set.
ovzkernel-2.6.18-8.el5.02 100% |====================| 255 kB 00:00
---> Package Package ovzkernel.i686 0:2.6.18-8.el5.028stab031.1 set to be installed
--> Running transaction check

Dependencies Resolved

===================================================================
Package Arch Version Repository Size
===================================================================
Installing:
  ovzkernel i686 2.6.18-8.el5.
028stab031.1 openvz-kernel
-rhel5   15 M

Transaction Summary
===================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 15 M
Downloading Packages:
(1/1): ovzkernel-2.6.18-8 100% |====================| 15 MB 00:38
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing:   ovzkernel#################################### [1/1]

Installed: ovzkernel.i686 0:2.6.18-8.el5.028stab031.1
Complete!
[root@ns ~]#
[root@ns ~]# vi /etc/sysctl.conf

# line 7: change
net.ipv4.ip_forward = 1

# line 16: change
kernel.sysrq = 1

# add at the bottom
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

[root@ns ~]# vi /boot/grub/grub.conf

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
#all kernel and initrd paths are relative to /boot/, eg.
#root (hd0,0)
#kernel /vmlinuz-version ro root=/dev/Host/LogVol01
#initrd /initrd-version.img
#boot=/dev/sda
# change default kernel
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-8.el5.028stab031.1)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.el5.028stab031.1 ro root=/dev/VZ/Host00 console=tty0
initrd /initrd-2.6.18-8.el5.028stab031.1.img
title CentOS (2.6.18-8.1.4.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-8.1.4.el5 dom0_mem=512M
module /vmlinuz-2.6.18-8.1.4.el5xen ro root=/dev/Xen/Host00
module /initrd-2.6.18-8.1.4.el5xen.img
title CentOS (2.6.18-8.1.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.1.1.el5 ro root=/dev/Xen/Host00
initrd /initrd-2.6.18-8.1.1.el5.img
title CentOS (2.6.18-8.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.el5 ro root=/dev/Xen/Host00
initrd /initrd-2.6.18-8.el5.img

[root@ns ~]# shutdown -r now

[root@ns ~]# uname -r
2.6.18-8.el5.028stab031.1# OpenVZ kerne

From (http://linuxbasiccommand.blogspot.com/search/label/Virtualization)

Linux CentOS 5 On VMWare Server: Installing VMWare Tools

A few weeks ago I’ve made a few posts on installing Linux CentOS 5 on a VMware Server. Well today I realized I didn’t post the part about installing the VMware Tools. These tools allow you to increase your virtual machine’s performance and capabilities.
Prior to installing the VMware Tools, there are a few things you want to do. The first step would be to install the kernel header files and a C compiler:
# yum install gcc gcc-c++ kernel-devel
The second thing would be to create a symbolic link pointing to your kernel header files:
# ln –s /usr/src/kernels/[your kernel version] /usr/src/linux
Now you’re ready to install the VMware Tools. From the VMware Server Console (with your virtual machine running), click on “VM => Install VMware Tools…”. Nothing is supposed to be happening at this point, it’s just like you inserted a virtual CD. From the command line, mount the cdrom drive, copy the installation files to a directory on your virtual hard drive and untar them:
# mount /dev/cdrom /mnt/cdrom
# cd /mnt/cdrom
# cp VMwareTools-[version].tar.gz /tmp
# cd /tmp
# umount /mnt/cdrom
# tar zxf VMwareTools-[version].tar.gz
Execute the VMware Tools installation script:
# cd /tmp/vmware-tools-distrib
# ./vmware-install.pl
Go through the installation and answer all the questions. I’ve left every settings to its default value.
When you’re done, simply reboot your virtual machine. I’ve had a little problem with X as it wouldn’t start upon reboot. I just used the X configuration wizard (which launched automatically) to make some adjustments, rebooted the VM again and everything worked fine.

Jan 25, 2011

Triển khai ISA Firewall cho hệ thống doanh nghiệp - Phần I: Cài đặt ISA Server 2006


ISA Server 2006 là phiên bản mới nhất của sản phẩm Microsoft  ISA Server. Về giao diện thì ISA 2006 giống ISA 2004 đến 90%. Tuy nhiên, nó có những tính năng mới nổi trội hơn mà ISA 2004 vẫn còn hạn chế, chẳng hạn như:

+ Phát triển hỗ trợ OWA, OMA , ActiveSync và RPC/HTTP pubishing

+ Hổ trợ SharePoint Portal Server

+ Hổ trợ cho việc kết nối nhiều certificates tới 1 Web listener

+ Hỗ trợ việc chứng thực LDAP cho Web Publishing Rules

ISA Server 2006 là phiên bản mới nhất của sản phẩm Microsoft  ISA Server. Về giao diện thì ISA 2006 giống ISA 2004 đến 90%. Tuy nhiên, nó có những tính năng mới nổi trội hơn mà ISA 2004 vẫn còn hạn chế, chẳng hạn như:

+ Phát triển hỗ trợ OWA, OMA , ActiveSync và RPC/HTTP pubishing

+ Hổ trợ SharePoint Portal Server

+ Hổ trợ cho việc kết nối nhiều certificates tới 1 Web listener

+ Hỗ trợ việc chứng thực LDAP cho Web Publishing Rules

Trong bộ bài viết này bao gồm các phần:
Phần I:  Cài đặt ISA Server 2006
Phần II: Cấu hình Access Rule
Phần III: Cấu hình VPN Client-to-Gateway qua đường truyền ADSL


Ở phần 1 này, các bạn sẽ bắt đầu làm quen với ISA Firewall thông qua việc cài đặt ISA Server 2006



 

Bài lab bao gồm các bước:

      1. Cài đặt ISA Server 2006

      2. Cài đặt và cấu hình Firewall Client

      3. Cấu hình Auto Discovery

      4. Tạo Access Rule để kiểm tra kết nối Internet


II. Chuẩn bị

Bài lab bao gồm 2 máy:

       - Máy DC: Windows Server 2003 đã nâng cấp lên Domain Controller

       - Máy Server:  Windows Sever 2003 đã Join domain 

Cấu hình TCP/IP cho 2 máy như trong bảng sau:
Máy ISA Server
Card INT
IP Address: 172.16.1.1
Subnet Mask: 255.255.255.0
Gateway:
Preferred DNS: 172.16.1.2
Card EXT
IP Address: 192.168.1.1
Subnet Mask: 255.255.255.0
Gateway: 192.168.1.200 (địa chỉ ADSL Router)
Preferred DNS:

Máy DC
IP Address: 172.16.1.2
Subnet Mask: 255.255.255.0
Gateway: 172.16.1.1
Preferred DNS: 172.16.1.2
III. Thực hiện

1. Cài đặt ISA Server 2006
- Mở Windows Explorer, vào thư mục chứa bộ cài đặt ISA SERVER 2006

- Chạy file isaautorun.exe (Bạn có thể chạy isauotorun.exe từ CD cài đặt ISA Server 2006)



- Chọn Install ISA Server 2006



- Hộp thoại Welcome to the Install Wizard…, nhấn Next



- Chọn I accept the terms in the license agreement, nhấn Next



- Hộp thoại Setup Type, chọn Custom



- Chọn Install ISA Server và ISA Server Management, nhấn Next



- Trong hộp thoại Internal Network, nhấn chọn Add



- Sau đó bạn chọn Add Adapter



- Đánh dấu chọn Int (Interface mặt trong của máy ISA), chọn OK



- Chọn IP: 172.16.255.255, nhấn Delete



- Chọn OK





- Tiếp theo trong hộp thoại Firewalll Client Connections, đánh dấu check vào Allow non-encrypted Firewall client connections



- Tiếp theo bạn cài đặt theo mặc định





- Hộp thoại Installation Wizard Completed, nhấn Finish


 

2. Cài đặt và cấu hình Firewall Client trên máy DC- Tại máy DC, logon MSOpenLab\Administrator
- Cài đặt ISA Firewall Client trong đĩa CD cài đặt (thư mục Client)

- Hộp thoại Welcome to the Install…, nhấn Next



- Tiếp theo bạn cài đặt theo mặc định





- Hộp thoại ISA Server Computer Selection, nhập vào địa chỉ IP của máy ISA Server, nhấn Next




- Nhấn Finish kết thúc quá trình cài đặt


 

 

3. Cấu hình Auto Discovery
- Mở ISA Server Management, phần Configuration, chọn Network. Ở khung bên phải, right click Internal, chọn Properties



- Chọn tab Auto Discovery, đánh dấu check vào Publish automatic discovery information for this network

 


- Nhấn Apply



 



- Tại máy DC, mở DNS manager từ Administrative Tools

- Click phải vào zone MSOpenLab.Com chọn New Alias (CNAME)…



- Nhập WPAD vào ô Alias name

- Ở khung FQDN, bạn Browse đến máy ISA Server



- Sau đó bạn Restart lại DNS



- Vào cmd, gõ lệnh ipconfig /flushdns để xóa cache DNS



- Mở ISA Firewall Client, vào tab Setting, chọn Automatically detected ISA Server, chọn Detect Now, kiểm tra máy client đã detect đuợc tên máy ISA Server, chọn OK



4. Tạo Access Rule để kiểm tra kết nối Internet
- Tại máy ISA Server, mở ISA Server Management, chuột phải Firewall Policy, chọn New, chọn Access Rule


 

- Hộp thoại Access Rule Names, đặt tên rule là: Allow to Internet

 



- Hộp thoại Rule Action, bạn chọn Allow


 

- Hộp thoại Protocols, chọn All outbound traffic



- Hộp thoại Access Rule Sources, nhấn Add, chọn 2 mục: Internal và Localhost

 



- Hộp thoại Access Rule Destinations, nhấn Add, chọn External



- Hộp thoại User Sets, chọn All User

 



- Nhấn Finish 



- Nhấn Apply 


 


 

- Cả 2 máy truy cập trang: www.google.com.vn, kiểm tra truy cập thành công

Viết bởi Đào Duy Hiếu