วันจันทร์ที่ 12 กันยายน พ.ศ. 2554

Public DNS Server List

http://theos.in/windows-xp/free-fast-public-dns-server-list/

Zimbra stats ไม่รัน

หลังจากใช้ zmcontrol status แล้วพบว่า stats ไม่รันเลยลองสั่ง zmstatctl status ดู มีบางตัวไม่รัน

zimbra@mail:~$ zmstatctl status
Running: zmstat-df
Running: zmstat-fd
process 24246 in /opt/zimbra/zmstat/pid/zmstat-proc.pid not running
process 24250 in /opt/zimbra/zmstat/pid/zmstat-vm.pid not running
Running: zmstat-io-x

แก้โดยลบหรือเปลี่ยนชื่อ process ตัวที่ไม่รันแล้ว zmstatctl stop/start ใหม่อีกครั้ง ^___^

ที่มา : http://blog.spanger.org/?p=555

Failed to spawn ssh pre-start process: unable to set oom adjustment: Operation not permitted

เครื่อง guest ใน openvz ไม่สามารถ start ssh ได้ เจอ error แบบนี้
Failed to spawn ssh pre-start process: unable to set oom adjustment: Operation not permitted

แก้ไขโดย (เครื่อง host)
1. cd /var/lib/vz/private/[VboxID]/etc/init
2. vi ssh.conf แล้วคอมเมนต์ oom never
3. reboot เครื่อง หรือรัน vzctl enter [VboxID] แล้ว service ssh restart

เป็นอันจบเท่านี้แล ^_^

ที่มา : http://mercstudio-tech.blogspot.com/2011/05/vps-ssh-not-starting-after-update-in.html

วันอังคารที่ 19 กรกฎาคม พ.ศ. 2554

ติดตั้ง ocs agent บน Ubuntu

1. ดาวน์โหลด Ocsinventory-Agent-2.0.tar.gz
2. แตกไฟล์นะจ๊ะ tar xvfz Ocsinventory-Agent-2.0.tar.gz
3. เข้าไปในไฟล์ cd Ocsinventory-Agent-2.0
4. ลง Perl module ให้ครบ (perl -MCPAN -eshell)
Digest::MD5
XML::Simple
Net::IP: optional, it is only needed to compute the network information
LWP
5. sudo ./ocsinventory-agent --devlib --server http://servername-ip/ocsinventory

เสร็จเรียบร้อย ^^

วันจันทร์ที่ 18 กรกฎาคม พ.ศ. 2554

Setting up OCS inventory NG on Ubuntu 10.04 LTS

** กันลืม /etc/apache2/conf.d/z-ocsinventory-server.conf บรรทัดที่ 28

OCS Version 2.0
Ubuntu LTS 10.04 Server

PerlSetEnv OCS_DB_USER ocs
# Password for user
PerlSetVar OCS_DB_PWD ocs

ตรวจสอบด้วยไม่งั้นเครื่องลูก connect ไม่ติด

สิ่งที่ต้องเตรียม
1. Apache2
2. PHP5
3. MySQL
4. Perl and Perl Modules
5. Make Utilities (sudo aptitude install make)

ณ ที่นี้จะไม่พูดถึงกรณีติดตั้ง LAMP แต่สามารถติดตั้งได้ง่าย ๆ โดยใช้คำสั่ง tasksel และทำการติดตั้ง LAMP Server

1. ติดตั้ง Perl Modules ที่ใช้ในการติดต่อกับเซิฟเวอร์โดย

staffs@ocsinventory:~$ sudo aptitude install libxml-simple-perl libcompress-zlib-perl libdbi-perl libdbd-mysql-perl libapache-dbi-perl libnet-ip-perl libsoap-lite-perl

2. ติดตั้ง PHP Modules

staffs@ocsinventory:~$ sudo aptitude install libphp-pclzip php5-gd

3. ติดตั้ง OCSNG_UNIX_SERVER-2.0.tar.gz โดย

staffs@ocsinventory:~$ wget http://launchpad.net/ocsinventory-server/stable-2.0/2.0/+download/OCSNG_UNIX_SERVER-2.0.tar.gz
staffs@ocsinventory:~$ tar xvfz OCSNG_UNIX_SERVER-2.0.tar.gz
staffs@ocsinventory:~$ cd OCSNG_UNIX_SERVER-2.0
staffs@ocsinventory:~$ sudo ./setup.sh


+----------------------------------------------------------+
| |
| Welcome to OCS Inventory NG Management server setup ! |
| |
+----------------------------------------------------------+

Trying to determine whitch OS or Linux distribution you use
+----------------------------------------------------------+
| Checking for Apache web server binaries ! |
+----------------------------------------------------------+

CAUTION: If upgrading Communication server from OCS Inventory NG 1.0 RC2 and
previous, please remove any Apache configuration for Communication Server!

Do you wish to continue ([y]/n)? [enter]
Assuming Communication server 1.0 RC2 or previous is not installed
on this computer.

Starting OCS Inventory NG Management server setup from folder /home/admins/OCSNG_UNIX_SERVER-2.0
Storing log in file /home/admins/OCSNG_UNIX_SERVER-2.0/ocs_server_setup.log

+----------------------------------------------------------+
| Checking for database server properties... |
+----------------------------------------------------------+

Your MySQL client seems to be part of MySQL version 5.1.
Your computer seems to be running MySQL 4.1 or higher, good ;-)

Which host is running database server [localhost] ? [enter]
OK, database server is running on host localhost ;-)

On which port is running database server [3306] ? [enter]
OK, database server is running on port 3306 ;-)


+----------------------------------------------------------+
| Checking for Apache web server daemon... |
+----------------------------------------------------------+

Where is Apache daemon binary [/usr/sbin/apache2] ? [enter]
OK, using Apache daemon /usr/sbin/apache2 ;-)


+----------------------------------------------------------+
| Checking for Apache main configuration file... |
+----------------------------------------------------------+

Where is Apache main configuration file [/etc/apache2/apache2.conf] ? [enter]
OK, using Apache main configuration file /etc/apache2/apache2.conf ;-)


+----------------------------------------------------------+
| Checking for Apache user account... |
+----------------------------------------------------------+

Which user account is running Apache web server [www-data] ? [enter]
OK, Apache is running under user account www-data ;-)


+----------------------------------------------------------+
| Checking for Apache group... |
+----------------------------------------------------------+

Which user group is running Apache web server [www-data] ? [enter]
OK, Apache is running under users group www-data ;-)


+----------------------------------------------------------+
| Checking for Apache Include configuration directory... |
+----------------------------------------------------------+

Setup found Apache Include configuration directory in
//etc/apache2/conf.d/.
Setup will put OCS Inventory NG Apache configuration in this directory.
Where is Apache Include configuration directory [//etc/apache2/conf.d/] ? [enter]
OK, Apache Include configuration directory //etc/apache2/conf.d/ found ;-)


+----------------------------------------------------------+
| Checking for PERL Interpreter... |
+----------------------------------------------------------+

Found PERL Intrepreter at ;-)
Where is PERL Intrepreter binary [/usr/bin/perl] ? [enter]
OK, using PERL Intrepreter /usr/bin/perl ;-)


Do you wish to setup Communication server on this computer ([y]/n)? [enter]


+----------------------------------------------------------+
| Checking for Make utility... |
+----------------------------------------------------------+

OK, Make utility found at ;-)

+----------------------------------------------------------+
| Checking for Apache mod_perl version... |
+----------------------------------------------------------+

Checking for Apache mod_perl version 1.99_22 or higher
Found that mod_perl version 1.99_22 or higher is available.
OK, Apache is using mod_perl version 1.99_22 or higher ;-)

+----------------------------------------------------------+
| Checking for Communication server log directory... |
+----------------------------------------------------------+

Communication server can create detailled logs. This logs can be enabled
by setting interger value of LOGLEVEL to 1 in Administration console
menu Configuration.
Where to put Communication server log directory [/var/log/ocsinventory-server] ? [enter]
OK, Communication server will put logs into directory /var/log/ocsinventory-server ;-)


+----------------------------------------------------------+
| Checking for required Perl Modules... |
+----------------------------------------------------------+

Checking for DBI PERL module...
Found that PERL module DBI is available.
Checking for Apache::DBI PERL module...
Found that PERL module Apache::DBI is available.
Checking for DBD::mysql PERL module...
Found that PERL module DBD::mysql is available.
Checking for Compress::Zlib PERL module...
Found that PERL module Compress::Zlib is available.
Checking for XML::Simple PERL module...
Found that PERL module XML::Simple is available.
Checking for Net::IP PERL module...
Found that PERL module Net::IP is available.

+----------------------------------------------------------+
| Checking for optional Perl Modules... |
+----------------------------------------------------------+

Checking for SOAP::Lite PERL module...
Found that PERL module SOAP::Lite is available.
Checking for XML::Entities PERL module...
Found that PERL module XML::Entities is available.


+----------------------------------------------------------+
| OK, looks good ;-) |
| |
| Configuring Communication server Perl modules... |
+----------------------------------------------------------+

Writing Makefile for Apache::Ocsinventory

+----------------------------------------------------------+
| OK, looks good ;-) |
| |
| Preparing Communication server Perl modules... |
+----------------------------------------------------------+


+----------------------------------------------------------+
| OK, prepare finshed ;-) |
| |
| Installing Communication server Perl modules... |
+----------------------------------------------------------+


+----------------------------------------------------------+
| OK, Communication server Perl modules install finished;-)|
| |
| Creating Communication server log directory... |
+----------------------------------------------------------+

Creating Communication server log directory /var/log/ocsinventory-server.

Fixing Communication server log directory files permissions.
Configuring logrotate for Communication server.
Removing old communication server logrotate file /etc/logrotate.d/ocsinventory-NG
Writing communication server logrotate to file /etc/logrotate.d/ocsinventory-server


+----------------------------------------------------------+
| OK, Communication server log directory created ;-) |
| |
| Now configuring Apache web server... |
+----------------------------------------------------------+

To ensure Apache loads mod_perl before OCS Inventory NG Communication Server,
Setup can name Communication Server Apache configuration file
'z-ocsinventory-server.conf' instead of 'ocsinventory-server.conf'.
Do you allow Setup renaming Communication Server Apache configuration file
to 'z-ocsinventory-server.conf' ([y]/n) ?
OK, using 'z-ocsinventory-server.conf' as Communication Server Apache configuration file
Removing old communication server configuration to file //etc/apache2/conf.d//ocsinventory.conf
Writing communication server configuration to file //etc/apache2/conf.d//z-ocsinventory-server.conf

+----------------------------------------------------------+
| OK, Communication server setup sucessfully finished ;-) |
| |
| Please, review //etc/apache2/conf.d//z-ocsinventory-server.conf
| to ensure all is good. Then restart Apache daemon. |
+----------------------------------------------------------+


Do you wish to setup Administration Server (Web Administration Console)
+----------------------------------------------------------+
| Checking for Administration Server directories... |
+----------------------------------------------------------+

CAUTION: Setup now install files in accordance with Filesystem Hierarchy
Standard. So, no file is installed under Apache root document directory
(Refer to Apache configuration files to locate it).
If you're upgrading from OCS Inventory NG Server 1.01 and previous, YOU
MUST REMOVE (or move) directories 'ocsreports' and 'download' from Apache
root document directory.
If you choose to move directory, YOU MUST MOVE 'download' directory to
Administration Server writable/cache directory (by default
/var/lib/ocsinventory-reports), especialy if you use deployement feature.

Do you wish to continue ([y]/n)? [enter]
Assuming directories 'ocsreports' and 'download' removed from
Apache root document directory.

Where to copy Administration Server static files for PHP Web Console
[/usr/share/ocsinventory-reports] ? [enter]
OK, using directory /usr/share/ocsinventory-reports to install static files ;-)
Where to create writable/cache directories for deployement packages,
IPDiscover and SNMP [/var/lib/ocsinventory-reports] ? [enter]
OK, writable/cache directory is /var/lib/ocsinventory-reports ;-)


+----------------------------------------------------------+
| Checking for required Perl Modules... |
+----------------------------------------------------------+

Checking for DBI PERL module...
Found that PERL module DBI is available.
Checking for DBD::mysql PERL module...
Found that PERL module DBD::mysql is available.
Checking for XML::Simple PERL module...
Found that PERL module XML::Simple is available.
Checking for Net::IP PERL module...
Found that PERL module Net::IP is available.

+----------------------------------------------------------+
| Installing files for Administration server... |
+----------------------------------------------------------+

Creating PHP directory /usr/share/ocsinventory-reports/ocsreports.
Copying PHP files to /usr/share/ocsinventory-reports/ocsreports.
Fixing permissions on directory /usr/share/ocsinventory-reports/ocsreports.
Creating database configuration file /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php.
Creating IPDiscover directory /var/lib/ocsinventory-reports/ipd.
Fixing permissions on directory /var/lib/ocsinventory-reports/ipd.
Creating packages directory /var/lib/ocsinventory-reports/download.
Fixing permissions on directory /var/lib/ocsinventory-reports/download.
Creating packages directory /var/lib/ocsinventory-reports/snmp.
Fixing permissions on directory /var/lib/ocsinventory-reports/snmp.
Configuring snmp_com.txt file
Configuring IPDISCOVER-UTIL Perl script.
Installing IPDISCOVER-UTIL Perl script.
Fixing permissions on IPDISCOVER-UTIL Perl script.
Writing Administration server configuration to file //etc/apache2/conf.d//ocsinventory-reports.conf

+----------------------------------------------------------+
| OK, Administration server installation finished ;-) |
| |
| Please, review //etc/apache2/conf.d//ocsinventory-reports.conf
| to ensure all is good and restart Apache daemon. |
| |
| Then, point your browser to http://server//ocsreports
| to configure database server and create/update schema. |
+----------------------------------------------------------+


Setup has created a log file /home/admins/OCSNG_UNIX_SERVER-2.0/ocs_server_setup.log. Please, save this file.
If you encounter error while running OCS Inventory NG Management server,
we can ask you to show us his content !

DON'T FORGET TO RESTART APACHE DAEMON !

Enjoy OCS Inventory NG ;-)



4. Restart Apache2

staffs@ocsinventory:~$ sudo /etc/init.d/apache2 restart



5. แก้ default language เป็น english โดยไปที่ไฟล์ /usr/share/ocsinventory-reports/ocsreports/var.php
แก้
define("DEFAULT_LANGUAGE","french");
เป็น
define("DEFAULT_LANGUAGE","english");


6. ลง phpmyadmin ช่วยก็ได้ สร้าง db ชื่อ ocsweb แล้วก็ลงต่อ อ่อ อย่าลืมแก้ /etc/php5/apache2/php.ini
post_max_size = 32M
upload_max_filesize = 32M

*** หมายเหตุ ถ้าลง perl module ไม่ครบให้ติดตั้งโดย perl -MCPAN -e 'Module_Name'

7. เข้า http://localhost/ocsreports จะเห็นหน้าตาแบบนี้




วันอังคารที่ 24 พฤษภาคม พ.ศ. 2554

Wireless บน Ubuntu 10.10 งอแง

วันดีคืนดี อยู่ ๆ เจ้า Compaq Presario V3000 ตัวเก่งดันมีปัญหา wireless ใช้งานไม่ได้ซะงั้น ตรวจสอบดู
anchalee@VIOS:~$ sudo rfkill list
0: hp-wifi: Wireless LAN
Soft blocked: yes
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: yes
2: hp-bluetooth: Bluetooth
Soft blocked: yes
Hard blocked: no

ใช้คำสั่ง

sudo rfkill unblock all

หรือ rfkill unblock hp-wifi

ก็จะเห็นไฟสีน้ำเงินเป็นบุญตา แสดงว่า wireless หนูใช้ได้แว้วว ^__^

ที่มา : https://answers.launchpad.net/ubuntu/+question/131937

วันจันทร์ที่ 7 กุมภาพันธ์ พ.ศ. 2554

port 22: Connection refused

บันทึกเผื่อลืม
หลังจากติดตั้ง Ubuntu 10.04 LTS Server แล้วใช้งาน ssh ได้ปกติ หลังจาก update, upgrade แล้วรีบูทเครื่อง จะเข้า ssh ไม่ได้จะขึ้นว่า
ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused

ให้แก้ไขค่า ServerKeyBits จาก /etc/ssh/sshd_config
โดย default จำนวนบิตที่จะใช้ในคีย์ของเซิร์ฟเวอร์จะมีค่าเป็น 768 ให้ทำการแก้ไขเป็น 1024

แล้วทดลองรีโมทเข้าใหม่ พบว่าเข้าได้ปกติค่า Security ล้ำจริง ๆ ^__^

*** server key เป็นคีย์ที่ใช้ในการเข้ารหัส session key และ session key เป็นคีย์ที่จะใช้ในการสื่อสารทั้งหมดหลัง log in ถ้า server key สั้นเกินไป จะทำให้ session key ถูกเจาะได้ (ที่มา : http://www.thaicert.org/paper/encryption/ssh_chklist.php)