PDA

توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : نصب CSF روی openVZ



Desperados
October 13th, 2009, 15:12
سلام
من یک وی پی اس دارم که با openVZ ایجاد شده
هر کاری میکنم نمیتونم فایروال CSF رو روی این اجرا کنم
مشکل اصلی تنظیمات iptable ها هست که درست نمی توانم انجام بدم :106:
الان فقط ipt_REDIRECT مشکل دارم و توی تست FAILED میده چه کنم ؟

HugeServer
October 13th, 2009, 15:35
/etc/csf/csftest.pl
اینو بزنید
خروجی رو بدید

Desperados
October 13th, 2009, 16:00
سلام

خروجی :



root@host [~/csf]# /etc/csf/csftest.pl
Testing ip_tables/iptable_filter...OK
Testing ipt_LOG...OK
Testing ipt_multiport/xt_multiport...OK
Testing ipt_REJECT...OK
Testing ipt_state/xt_state...OK
Testing ipt_limit/xt_limit...OK
Testing ipt_recent...OK
Testing ipt_owner...OK
Testing iptable_nat/ipt_REDIRECT...FAILED [Error: iptables v1.3.5: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)] - Required for MESSENGER feature

Desperados
October 14th, 2009, 01:00
دوستان کسی نظری نداره ؟
الان مشکل این هست که ایمیل ارسال نمیشه تا زمانی که csf فعال هست
در تنظیمات هم smtp_block غیر فعال هست و پورت 25 هم اجازه داده شده و باز هست
توسط اسکریپت ها ایمیلی ارسال نمیشه کمک لطفاً

HugeServer
October 14th, 2009, 01:04
Mail Queue Manager
رو چک کنید, ممکنه ایمیل ها اینجا باشه

Desperados
October 14th, 2009, 01:14
بله الان 72 تا ایمیل اینجا هست !
چکار کنم که اینجا ذخیره نشوند و ارسال بشن ؟

HugeServer
October 14th, 2009, 01:29
بله الان 72 تا ایمیل اینجا هست !
چکار کنم که اینجا ذخیره نشوند و ارسال بشن ؟

ذخیره نیستند!
در صف هستند تا ارسال شوند.
:77:

Desperados
October 14th, 2009, 01:35
عجب صف طولانی و کندی /:)
مشکل اینجاست که وقتی فایل وال رو غیر فعال می کنم ارسال می شوند.
الان اینا تا کی توی صف هستند ؟ d:

Roka
October 14th, 2009, 11:36
سلام
من یک وی پی اس دارم که با openVZ ایجاد شده
هر کاری میکنم نمیتونم فایروال CSF رو روی این اجرا کنم
مشکل اصلی تنظیمات iptable ها هست که درست نمی توانم انجام بدم :106:
الان فقط ipt_REDIRECT مشکل دارم و توی تست FAILED میده چه کنم ؟

سلام
از دو لینک زیر میتونید تنظیمات iptables رو درست کنید !

1 : آموزش نصب APF هست که یه تنظیماتی برای iptables گفته که بدرد شما میخوره !
http://kb.parallels.com/en/875

2 : آموزش نصب CSF هست که اینم بدرتون میخوره
http://www.sherin.co.in/csf-lfd-firewall-configuration-in-vps-virtuozzo-openvz/

البته دو نکته لازم به ذکر است
1 : شما نمیتونید کاری کنید و مدیر سرور ( از SSH سرور اصلی باید این کار رو انجام بده )
2 : هر دو آموزش رو ببینید و باید تنظیماتش رو انجام بدید ! مکمل همدیگه هستند

و نکته خیلی مهم : من مدیر سرورتون رو نمیشناسم و نمیدونم در چه حد بلدند ولی بهش بگو اگه واسه این کار یه اشتباه کوچیک انجام بده = نابود شدن سرورش جوری که حتی دیتاسنتر هم نتونه کمک کنه !!!
اگه اطلاعاتش تکمیل نیست اصلاً انجام نده

موفق باشید

Sajad
October 14th, 2009, 11:41
1 : آموزش نصب APF هست که یه تنظیماتی برای iptables گفته که بدرد شما میخوره !
http://kb.parallels.com/en/875


The installation of APF requires some additional steps to be taken on the hardware node.

1. First of all, you should define which iptables modules are available for VEs.

Edit /etc/sysconfig/iptables-config file on a Virtuozzo hardware node:
IPTABLES_MODULES="ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp"

Edit /etc/sysconfig/vz file on a Virtuozzo hardware node:
IPTABLES="ipt_REJECT
ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp"

Please note - iptables modules list in IPTABLES and IPTABLES_MODULES parameters in /etc/sysconfig/vz and /etc/sysconfig/iptables-config files should be placed in one single line, no linebreaks is allowed in this parameter.

Restart Virtuozzo. All VEs will be restarted.
# service vz restart

2. Increase 'numiptent' parameter for the VE you need to install APF into. This parameter limits the amount of iptables rules available for a VE. Default APF configuration requires ~400 rules. Lets set it to 400 in the example below for VE #101:
# vzctl set 101 --numiptent 400 --save

3. Install APF inside the VE. Edit /etc/apf/conf.apf inside VE, set the following parameters:
IFACE_IN="venet0"
IFACE_OUT="venet0"
SET_MONOKERN="1"

4. Start APF inside the VE:
# /etc/init.d/apf start

Sajad
October 14th, 2009, 11:42
2 : آموزش نصب CSF هست که اینم بدرتون میخوره
http://www.sherin.co.in/csf-lfd-fire...tuozzo-openvz/ (http://www.sherin.co.in/csf-lfd-firewall-configuration-in-vps-virtuozzo-openvz/)


Introduction:

In general csf is giving good compatibility with cpanel servers . But in a vps (openvz or Virtuzzo) the csf configuration is something different.

Sometimes you may get an error as follow after the csf installation in vps

————–

Error: iptables command [/sbin/iptables -v -A LOGDROPIN -p tcp -m limit --limit 30/m --limit-burst 5 -j LOG --log-prefix 'Firewall: *TCP_IN Blocked* '] failed, at line 196

—————

So how to resolve this issue. Let us do it as follows,

There are two steps to configure the csf in vps

i)Main vps server ( The host server ,in which the vps nodes are running) configuration

ii) Vps node configuration.

Main vps serverconfiguration

Before starting the csf installation in a node login to the main server (host server) and check whether the following modules are inserted in to the kernel

———
ipt_conntrack
ipt_LOG
ipt_owner
ipt_state
ip_conntrack_ftp
———

You can check it as follows

—————
# lsmod |grep -i <module-name>
—————

If not please insert these modules into the kernel.

————
#modprob <module-name>
eg: modprob ipt_conntrack
————-

Now add these modules to iptable configuration as follows.

———–
# vi /etc/sysconfig/iptables-config
Add the following in this file
IPTABLES_MODULES=”ipt_conntrack ipt_LOG ipt_owner ipt_state ip_conntrack_ftp”
———–

Now edit the vps configuration file from /etc/sysconfig/vz-scripts/ Let 101 is the VEID, add the above inserted modules in to the IPTABLE section in this configuration file.

———-
# vi /etc/sysconfig/vz-scripts/101.conf
IPTABLES=”iptable_filter iptable_mangle ipt_limit ipt_multiport ipt_tos ipt_TOS ipt_REJECT ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_LOG ipt_length ip_conntrack ipt_state
iptable_nat ip_nat_ftp ipt_owner ip_conntrack_ftp”
————-

Here we completed the main vps server configuration . So now reboot the child node (not main server) as follows

—————

# vzctl restart <veid>

eg: vzctl restart 101

——————-

ii) Vps node configuration.

Now ssh /enter your child vps node

Now download and install the csf . You can download the csf fromhere

Before restarting the csf let us do some configurations as follows , Edit the file /etc/csf/csf.conf .Then set the following variables

——–
ETH_DEVICE = “venet0″ #from ifconfig you can see the n/w device
MONOLITHIC_KERNEL = “1″
VERBOSE = “0″ # will disable the verbose output during start
———
Now start the csf and lfd .

———–

/etc/init.d/csf start

/etc/init.d/lfd start

———–

Note: If it is cpanel server go to whm and configure the firewall settings

Enjoy it

Desperados
October 14th, 2009, 14:07
مدیر سرور اصلی خودم هستم :d
و این 2 تا آموزش رو دقیقاً انجام دادم قبلاً که الان فقط یکی از IPTABLE ها Failed هست و اینو نمی دونم چکار کنم !
به خود دیتاسنتر گفتم روی یکی دیگر از VPS ها انجام دادند و خیلی عالی کار میکنه اینم مثل اینکه باید به دیتاسنتر بگم ردیف کنند.