ورود

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



NovinServer
May 23rd, 2010, 23:37
با سلام و درود ، دوستان کسی می دونه چگونه می توانیم تعداد در خواست های اپاچی را برای یک اکانت محدود کرد ؟

مثلا یک اکانت نتواند بیش از 20 درخواست را هندل کند !

Vahid
May 24th, 2010, 00:02
مد mod_limitipconn.c رو نصب کن و
ورژن آپاچی؟
mod_limitipconn.c (http://dominia.org/djao/limitipconn.html)
یا برای ورژن 2
mod_limitipconn.c (http://dominia.org/djao/limitipconn2.html)
بعد هم تعداد و معین کن

---------- Post added 10-05-24 at 12:02 AM ---------- Previous post was 10-05-23 at 11:59 PM ----------

با این مد میتونی حتی روی extention ها تغیر بدی
مثلا .mp3 چند تا باشه یا مصلا .avi .....
توصیه میکنم تجربه کنی :d

NovinServer
May 24th, 2010, 00:08
مد mod_limitipconn.c رو نصب کن و
ورژن آپاچی؟
mod_limitipconn.c (http://dominia.org/djao/limitipconn.html)
یا برای ورژن 2
mod_limitipconn.c (http://dominia.org/djao/limitipconn2.html)
بعد هم تعداد و معین کن

---------- Post added 10-05-24 at 12:02 AM ---------- Previous post was 10-05-23 at 11:59 PM ----------

با این مد میتونی حتی روی extention ها تغیر بدی
مثلا .mp3 چند تا باشه یا مصلا .avi .....
توصیه میکنم تجربه کنی :d

Apache 2.2 نصب هست !
نحوه نصب و تنظیمش را یک راهنمایی میکنی ؟

---------- Post added at 07:38 PM ---------- Previous post was at 07:34 PM ----------


مد mod_limitipconn.c رو نصب کن و
ورژن آپاچی؟
mod_limitipconn.c (http://dominia.org/djao/limitipconn.html)
یا برای ورژن 2
mod_limitipconn.c (http://dominia.org/djao/limitipconn2.html)
بعد هم تعداد و معین کن

---------- Post added 10-05-24 at 12:02 AM ---------- Previous post was 10-05-23 at 11:59 PM ----------

با این مد میتونی حتی روی extention ها تغیر بدی
مثلا .mp3 چند تا باشه یا مصلا .avi .....
توصیه میکنم تجربه کنی :d

خطا می ده :


root@movie [~/mod_limitipconn-0.04]# make install
apxs -c mod_limitipconn.c
/usr/local/apache/build/libtool --silent --mode=compile gcc -prefer-pic --param ggc-min-expand=1 --param ggc-min-heapsize=4096 -DLINUX=2 -D_REENTRANT -D_GNU_SO URCE -D_LARGEFILE64_SOURCE --param ggc-min-expand=1 --param ggc-min-heapsize=409 6 -pthread -I/opt/pcre/include -I/usr/local/apache/include -I/usr/local/apache/ include -I/usr/local/apache/include -c -o mod_limitipconn.lo mod_limitipconn .c && touch mod_limitipconn.slo
mod_limitipconn.c:39: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â be fore âlimitipconn_moduleâ
mod_limitipconn.c:43: error: expected specifier-qualifier-list before âarray_hea derâ
mod_limitipconn.c:49: error: expected â)â before â*â token
mod_limitipconn.c: In function âlimitipconn_handlerâ:
mod_limitipconn.c:66: error: âlimitipconn_moduleâ undeclared (first use in this function)
mod_limitipconn.c:66: error: (Each undeclared identifier is reported only once
mod_limitipconn.c:66: error: for each function it appears in.)
mod_limitipconn.c:69: error: âlimitipconn_dir_configâ has no member named âno_li mitâ
mod_limitipconn.c:70: error: âlimitipconn_dir_configâ has no member named âexcl_ limitâ
mod_limitipconn.c:84: error: âshort_scoreâ undeclared (first use in this functio n)
mod_limitipconn.c:84: error: expected â;â before âscore_recordâ
mod_limitipconn.c:95: error: too few arguments to function âap_sub_req_lookup_ur iâ
mod_limitipconn.c:114: error: âlimitipconn_dir_configâ has no member named âno_l imitâ
mod_limitipconn.c:123: error: âlimitipconn_dir_configâ has no member named âexcl _limitâ
mod_limitipconn.c:125: error: âlimitipconn_dir_configâ has no member named âexcl _limitâ
mod_limitipconn.c:138: error: âHARD_SERVER_LIMITâ undeclared (first use in this function)
mod_limitipconn.c:139: error: âscore_recordâ undeclared (first use in this funct ion)
mod_limitipconn.c: In function âno_limit_config_cmdâ:
mod_limitipconn.c:208: error: âlimitipconn_dir_configâ has no member named âno_l imitâ
mod_limitipconn.c:208: warning: assignment makes pointer from integer without a cast
mod_limitipconn.c: In function âexcl_limit_config_cmdâ:
mod_limitipconn.c:218: error: âlimitipconn_dir_configâ has no member named âexcl _limitâ
mod_limitipconn.c:218: warning: assignment makes pointer from integer without a cast
mod_limitipconn.c: At top level:
mod_limitipconn.c:224: warning: initialization from incompatible pointer type
mod_limitipconn.c:226: warning: initialization from incompatible pointer type
mod_limitipconn.c:228: warning: initialization from incompatible pointer type
mod_limitipconn.c:234: error: expected declaration specifiers or â...â before âp oolâ
mod_limitipconn.c: In function âlimitipconn_initâ:
mod_limitipconn.c:236: warning: passing argument 4 of âap_log_errorâ makes integ er from pointer without a cast
mod_limitipconn.c:236: warning: passing argument 5 of âap_log_errorâ from incomp atible pointer type
mod_limitipconn.c:236: error: too few arguments to function âap_log_errorâ
mod_limitipconn.c: At top level:
mod_limitipconn.c:239: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â b efore âlimitipconn_moduleâ
apxs:Error: Command failed with rc=65536
.
make: *** [mod_limitipconn.so] Error 1

Vahid
May 24th, 2010, 00:13
(Apache 1.3.x) -
cd /usr/src
http://dominia.org/djao/limit/mod_limitipconn-0.04.tar.gz
tar xzvf mod_limitipconn-0.04.tar.gz
cd mod_limitipconn-0.04

(Apache 2.0.x)
cd /usr/src
http://dominia.org/djao/limit/mod_limitipconn-0.22.tar.gz
tar xzvf mod_limitipconn-0.22.tar.gz
cd mod_limitipconn-0.22

pico Makefile
find the line that reads APXS=apxs
change that to
APXS=/usr/local/apache/bin/apxs

press cntrl O to save
then cntrl X

// if your locations to apxs is different
locate apxs and copy the path
then paste that in
//

make
make install

service httpd restart

pico -w /etc/httpd/conf/httpd.conf

locate ExtendedStatus
Make sure ExtendedStatus is on and without the comment at the start

and add this line to every virtual directory you want to limit
or add it once to the main directory to limit all



MaxConnPerIP 3
# exempting images from the connection limit is often a good
# idea if your web page has lots of inline images, since these
# pages often generate a flurry of concurrent image requests
NoIPLimit image/*



MaxConnPerIP 1
# In this case, all MIME types other than audio/mpeg and video*
# are exempt from the limit check
OnlyIPLimit audio/mpeg video



press cntrl O to save
then cntrl X
then service httpd restart

---------- Post added at 12:13 AM ---------- Previous post was at 12:11 AM ----------

درست apxs رو ادرس بده

NovinServer
May 24th, 2010, 00:15
من اپاچی 2.2 هستم وحید جان !

Vahid
May 24th, 2010, 00:18
pico Makefile
find the line that reads APXS=apxs
change that to
APXS=/usr/local/apache/bin/apxs
اینو انجام دادی؟

NovinServer
May 24th, 2010, 00:20
ایول نصب شد تا اخرش امدم فقط اینجا را نفهمدیم چیکار کنم :


pico -w /etc/httpd/conf/httpd.conf

locate ExtendedStatus
Make sure ExtendedStatus is on and without the comment at the start

and add this line to every virtual directory you want to limit
or add it once to the main directory to limit all



MaxConnPerIP 3
# exempting images from the connection limit is often a good
# idea if your web page has lots of inline images, since these
# pages often generate a flurry of concurrent image requests
NoIPLimit image/*



MaxConnPerIP 1
# In this case, all MIME types other than audio/mpeg and video*
# are exempt from the limit check
OnlyIPLimit audio/mpeg video



press cntrl O to save
then cntrl X
then service httpd restart

IFACO.Net
May 24th, 2010, 00:21
مد mod_limitipconn.c رو نصب کن و
ورژن آپاچی؟
mod_limitipconn.c (http://dominia.org/djao/limitipconn.html)
یا برای ورژن 2
mod_limitipconn.c (http://dominia.org/djao/limitipconn2.html)
بعد هم تعداد و معین کن

---------- Post added 10-05-24 at 12:02 AM ---------- Previous post was 10-05-23 at 11:59 PM ----------

با این مد میتونی حتی روی extention ها تغیر بدی
مثلا .mp3 چند تا باشه یا مصلا .avi .....
توصیه میکنم تجربه کنی :d

آیا با سی پنل سازگار هست ؟
و چند درصد موفق عمل میکنه ؟

Vahid
May 24th, 2010, 00:24
ببین برو httpd.conf رو با یه ادیتور باز کن و بگرد دنبال ExtendedStatus این باید On باشه
و بعد MaxConnPerIP این ها رو تک تک تعداد بهشون بده که چند تا کانکش بیفته و بعد سیو کن و ریسیت کن apache رو !

---------- Post added at 12:24 AM ---------- Previous post was at 12:23 AM ----------


آیا با سی پنل سازگار هست ؟
و چند درصد موفق عمل میکنه ؟
من 1 بار یکی از دوستام یه سایت دانلود داشت داد نصب کردم خیلی بهش سازگار بود
البته 1 دونه سایت رو سرورش بود

NovinServer
May 24th, 2010, 00:26
ببین برو httpd.conf رو با یه ادیتور باز کن و بگرد دنبال ExtendedStatus این باید On باشه
و بعد MaxConnPerIP این ها رو تک تک تعداد بهشون بده که چند تا کانکش بیفته و بعد سیو کن و ریسیت کن apache رو !

---------- Post added at 12:24 AM ---------- Previous post was at 12:23 AM ----------


من 1 بار یکی از دوستام یه سایت دانلود داشت داد نصب کردم خیلی بهش سازگار بود
البته 1 دونه سایت رو سرورش بود

Timeout 300
User nobody
Group nobody
ExtendedStatus On
ServerAdmin novinserver@gmail.com

MaxConnPerIP را منظورت تعداد درخواست ها جلوش بنویسم ! مثلا 30 درخواست ؟

Vahid
May 24th, 2010, 00:27
MaxConnPerIP را منظورت تعداد درخواست ها جلوش بنویسم ! مثلا 30 درخواست ؟
اره دیگه

NovinServer
May 24th, 2010, 00:35
اره دیگه

وحید من 5 بار HTTPD را چک کردم اما چیزی به نام MaxConnPerIP پیدا نکردم !

Vahid
May 24th, 2010, 00:40
<IfModule mod_limitipconn.c>
<Location /videos>
MaxConnPerIP 1
# In this case, all MIME types other than audio/mpeg and video*
# are exempt from the limit check
OnlyIPLimit audio/mpeg video
</Location>
<Location /forums/media/data>
MaxConnPerIP 1
# In this case, all MIME types other than audio/mpeg and video*
# are exempt from the limit check
OnlyIPLimit audio/mpeg video
</Location>
</IfModule>
خودت اضافه کن

NovinServer
May 24th, 2010, 00:47
<IfModule mod_limitipconn.c>
<Location /videos>
MaxConnPerIP 1
# In this case, all MIME types other than audio/mpeg and video*
# are exempt from the limit check
OnlyIPLimit audio/mpeg video
</Location>
<Location /forums/media/data>
MaxConnPerIP 1
# In this case, all MIME types other than audio/mpeg and video*
# are exempt from the limit check
OnlyIPLimit audio/mpeg video
</Location>
</IfModule>
خودت اضافه کن

این را خط اخر HTTPD.conf ذخیره کنم مشکلی نیست ؟
یا باید جای خاصی این کد بزارم !

بعد این تعداد را که گذاشتی 1 یعنی هر ایپی می تواند در ثانیه یک درخواست بده یا کلا یک ایپی می توانه وارد بشه ؟
چون نوشته Max Connection Per IP دقیقا منظورش چیه ؟ یعنی من بزنم جلوش 25 یعنی کلا 25 تا درخواست می توانه اون اکانت هندل کنه یا هر ایپی 25 درخواست ؟

iranihost
June 7th, 2010, 22:00
وحید

میخوام کل سرور لیمیت بشه !
کجا و چی بزنم !؟

Woshka
June 8th, 2010, 00:48
کل سرور رو چرا می خوای لیمیت کنی؟

iranihost
June 8th, 2010, 00:49
چون فقط 1 سایت روی سرور هست !

Woshka
June 8th, 2010, 03:26
در حال درس خوندن بودم(معادلات)
اومدم جواب بدم دیدم مشکلت حل شده

iranihost
June 8th, 2010, 04:52
woshka جان حل نشد !

وحید لیمیت کرد ، (1 آیپی) ولی باز هم استاپ میکنه ! ولی خیلی کمتر شده !

چه راه حلی توصیه میکنی ؟