CentOS “apxs” command not found

CentOS “apxs” command not found

apxs is an Apachec extension tool.

I realize that this tool, is by default, not installed under CentOS (or perhaps even RedHat).
To fix this, just install it using yum by:

yum install httpd-devel.i386

where apxs is installed under “httpd-devel” package.
Credit http://toytoygogie.blogspot.com/2010/04/centos-apxs-command-not-found.html

Find & Locate CentOS

Find & Locate
      ค้นหา file ใน CentOS หรือ Red Hat

locate FileName

find / – name “FileName”

find / – name “FileName*”

find {DirName} – name “FileName*”

find ./ -type f -name “FileName*”

Credit by Water Cseroom

How to check which apache modules are enabled/installed?

How to check which apache modules are enabled/installed?

apachectl -t -D DUMP_MODULES



____________________________________


Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_file_module (shared)
 authn_alias_module (shared)
 authn_anon_module (shared)
 authn_dbm_module (shared)
 authn_default_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 authz_owner_module (shared)
 authz_groupfile_module (shared)
 authz_dbm_module (shared)
 authz_default_module (shared)
 ldap_module (shared)
 authnz_ldap_module (shared)
 include_module (shared)
 log_config_module (shared)
 logio_module (shared)
 env_module (shared)
 ext_filter_module (shared)
 mime_magic_module (shared)
 expires_module (shared)
 deflate_module (shared)
 headers_module (shared)
 usertrack_module (shared)
 setenvif_module (shared)
 mime_module (shared)
 dav_module (shared)
 status_module (shared)
 autoindex_module (shared)
 info_module (shared)
 dav_fs_module (shared)
 vhost_alias_module (shared)
 negotiation_module (shared)


Credit
http://superuser.com/questions/284898/how-to-check-which-apache-modules-are-enabled-installed
http://adminuser.wordpress.com/2008/06/12/list-all-the-loaded-modules-apache/



Install Mod_evasive On CentOS

Install Mod_Evasive On CentOS

ติดตั้ง Mod_Evasive เพื่อป้องกันการโจมตีแบบ DDOS

wget http://www.zdziarski.com/blog/wp-content/uploads/2010/02/mod_evasive_1.10.1.tar.gz

tar xvfz mod_evasive_1.10.1.tar.gz

cd mod_evasive

apxs -cia mod_evasive20.c

mkdir /var/log/httpd/mod_evasive

chmod 640 /var/log/httpd/mod_evasive/

vi /etc/httpd/conf/httpd.conf

LoadModule evasive20_module   /usr/lib/httpd/modules/mod_evasive20.so

<IfModule mod_evasive20.c>
DOSHashTableSize    3097
DOSPageCount        2
DOSSiteCount        40
DOSPageInterval     1
DOSSiteInterval     1
DOSBlockingPeriod   3600
DOSLogDir           /var/log/httpd/mod_evasive/
DOSWhitelist   127.0.0.1
</IfModule>

ปรับ Ip conntrack linux

การปรับ Ip Conntrack linux

        
ปรับเพื่อใ้ห้สามารถรองรับการ  Connection ได้มาขึ้น แต่มากไปก็ไม่ดีนะ กิน Ram
เช็ค Connection Max

: sysctl net.ipv4.netfilter.ip_conntrack_max

ตรวจสอบ Connection ปัจจุบัน

: wc -l /proc/net/ip_conntrack

ปรับ Connection 

: sysctl -w net.ipv4.netfilter.ip_conntrack_max=120000

ตรวจสอบดูอีกทีว่าสามารถใช้งานได้เพิ่มขึ้้นไหม

: wc -l /proc/net/ip_conntrack
Credit http://network.arit.rmutsv.ac.th/archives/20

Path ปรับแก้ php.ini ใน Kloxo

Path ปรับแก้ php.ini ใน Kloxo

Which php.ini must i edit to disable functions globaly ?
I want to disable some functions

/root/.etc/misc/php.ini
/usr/lib/kloxophp/zend/etc/php.ini
/usr/local/lxlabs/ext/php/etc/php.ini
/usr/local/lxlabs/kloxo/httpdocs/htmllib/filecore/php.ini
/usr/local/lxlabs/kloxo/httpdocs/htmllib/filecore/lxetc/misc /php.ini
/etc/php.ini
/home/httpd/mydomain.com/php.ini
/home/httpd/mydomain.com/php.ini

Create dnp9.com

ปรับแก้ให้ Kloxo อ่านภาษาไทย

ปรับแก้ ให้อ่านภาษาไทยในกรณีที่เป็น เว็บที่เป็น tis 620
เข้าไปที่

# cd /home/apache/conf/domains/
#ls

‘ก็จะเห็นรายชื่อโดเมนต่างๆ ตามด้วย .conf
# vi Domain.com.conf

<VirtualHost
       10.X.X.X:80
>
AddDefaultCharset TIS-620  <——เพิ่มตรงนี้
        ServerName Domain.com
ServerAlias
        www.Domain.com

        DocumentRoot “/home/admin/Domain.com/”

แล้วก็บันทึก

# /etc/init.d/kloxo restart

Create data.dnp9.com

ป้องกันไม่ให้ Hack Web ด้วย shell_exec php

ป้องกันไม่ให้ Hack Web ด้วย shell_exec php
      1. vi /etc/php.ini

      2. Find disable_functions and set new list as follows:

“disable_functions=exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source”

      3. service httpd restart

Credit www.cyberciti.biz/faq/linux-unix-apache-lighttpd-phpini-disable-functions/

CentOS Boot Error “Give root password for maintence”

CentOS Boot Error “Give root password for maintence”
     Error Boot  “Give root password for maintence : ( or type Control-D to continue) แล้ว Boot ไม่เข้าหน้า Login 
     เนื่องจาก Kloxo ของผมเป็นเหตุ Config อยู่ก็เกิด Error Mqsql Counld not open database connection ลองไป Restart Service MySql , Httpd ไม่ได้แถมได้ Error PHP แถมด้วย ลองใช้ Script Kloxo fix-program-mysql ,restart Kloxo Error ก็ไม่หาย ขึ้น Error Permision Fail ตลอด 
     ตลอดดู Permision ตาม Error ก็ปกติไม่น่ามีปัญหาอะไร เอาซิ Restart เครื่องเลย พอ Restart เสร็จถึงกับตกใจ Volume Disk มีปัญหา นี่มัน Logical Volme นะ…..พังได้ไง
     ก็เลยตัดสินใจ Recovery ซะ 
1. ใส่แผ่น CentOS Boot Rescue Mode
2. พิมพ์ linux rescue, Select Continue , Select Read-Only , Select Skip , Select Skip
3. fdisk -l   ดู disk
4. fsck -fy /dev/sda1 <——-Disk
5. lvm pvscan
    lvm vgscan
    lvm lvchange -ay VolGroup00  <—— Vol Root
    lvm lvscan
6. fsck -fy /dev/VolGroup00/LogVol00
7. shutdown -Fr Now
OK ใช้งานได้แล้ว
 Credit  http://www.startupcto.com/server-tech/centos/running-fsck
1 2