Quantcast
Channel: مرکز آموزش و مستندات - رسانگار - رسانگار
Viewing all 31 articles
Browse latest View live

جلوگیری از دزدی لینک و پهنای باند ( hotlinking ) با فایل httaccess

$
0
0

لینک داغ ، هات لینکینگ ، Hotlinking که به استفاده از تصاویر و یا دیگر فایلهای یک وب سایت در وب سایت دیگر و استفاده از پهنای باند و منابع وب سایت مبدا است می گویند که متاسفانه یک موضوع شایع در وب است . در ادامه به روش جلوگیری از این کار با استفاده از فایل htaccess اشاره خواهیم نمود.

با قرار دادن مجموعه کد های کاربردی که در زیر آورده شده است در فایل htaccess تمامی درخواستهای وب سایتهای دیگر که برای این تصاویر و دیگر رسانه ها که به وب سایت شما لینک شده اند را با یک تصویر اخطار جایگرین خواهد نمود

RewriteEngine On
#Replace ?mysite\.com/ with your blog url
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
#Replace /images/nohotlink.jpg with your "don't hotlink" image url
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]

خطای اتصال به دیتاسبیس در سایتها و استارت نشدن MySQL در cPanel

$
0
0

بسیار پیش آمده است که به علت های گوناگون سرویس MySQL سی پنل شما استارت نشود و وب سایتهای روی سرور شما با خطای اتصال به دیتابیس مواجه شوند :

در زیر به برخی از این خطا ها ، علت لوجود آمدن ها و روش حل مشکل اشاره خواهیم داشت .

  1. استارت نشدن سرویس mySQL به علت پرشدن مسیر /tmp سرور


در صورتی که مسیر /tmp سرور شما که محل ذخیره سازی فایلهای موقتی اعم از اسکریپت ها ، نشستهای کنترل پنل ، فایلهای در حال فشرده سازی ، نسخه های در حال پشتیبان گیری دیتابیس و ..... پر شود بعد از اطمینان از علت مشکل اط طریق قسمت service manager در WHM نسبت به حذف این فایلها به ترتبی زیر اقدام نمائید.

cd /tmp
rm -f -r sess_*

که تمامی session ها را پاک میکند
با دستور
ls -l میتوانید لیست فایلها و سایز هر یک از آنها روی دیسک را مشاهده و بصورت دستی حذف نمائید
مثلا
rm -f fcgid.tmp.zDbdhS

هیچ گاه از دستور rm -f به تنهایی استفاده ننموده  و  فایلهای مهم و در حال استفاده مانند mysql.sock@ را حذف نکنید.

بسیار پیش آمده است که به علت های گوناگون سرویس MySQL سی پنل شما استارت نشود و وب سایتهای روی سرور شما با خطای اتصال به دیتابیس مواجه شوند :

در زیر به برخی از این خطا ها ، علت لوجود آمدن ها و روش حل مشکل اشاره خواهیم داشت .

بهینه سازی و امنیت آپاچی در cPanel

$
0
0
کانفیگ امنیتی cPanel

در این مقاله ما بر اساس تجربیات خود در زمینه ارائه سرویسهای میزبانی وب اشتراکی لینوکس نکاتی را با شما به اشتراک می گذاریم تا بدانید چگونه میتوانید آپاچی را امن کنید و تا حدودی کارایی آن را افزایش دهید !

در این مطلب من به شما راهکارهایی کوچک را نشان خواهم دارد تا آپاچی را امن و بهینه نمائید. این مقاله فقط یک نقطه آغاز برای سری طولانی امنیت و بهینه سازی سرورهای cPanel می باشد.

مقالاتی که در آینده به آنها اشاره خواهیم نمود : امنیت PHP , تنظیمات CentOS

In this article I will share a few tips on how to optimize and secure Apache for cPanel servers. This article is the beginning of a long series of server security and optimization for cPanel.
Articles to come: PHP security, CentOS configuration for cPanel, mod security for apache, firewall configuration, cPanel optimization, and much more.

Building Apache:

In order to compile apache, php and other modules you can use “Easy Apache”, you can access it using this ways:
1. From cPanel WHM navigate to: Main >> Software >> EasyApache (Apache Update)
2. From a ssh session execute: /scripts/easyapache
I suggest using the web version, it is easier to read for beginners. Let’s begin:
Page1: Profile
Select: “PHP Security” and push: “Start customizing based on profile”
Page2: Apache Version
Select: “Apache 2.2″ and click “Next Step”
Page3: PHP Major Version
Select: “PHP 5″ and click “Next Step”
Page4: PHP Minor Version
Select: “PHP 5.2.12″ and click “Next Step” (PHP 5.3 is a bit different then 5.2 and has a lot of functions disabled/removed, select PHP 5.3 only if your scripts are compatible with this version).
Page5: Short Options List
Uncheck: Frontpage (this extension is not supported anymore)
Check: Anything that you might need and make sure that: Mod Security, Mod SuPHP and Suhosin for PHP remains checked.
After you are done click on: “Exhaustive Options List”
Page6: Exhaustive Options List
Check: Mod FCGID, Fileprotect, MPM Prefork, Mod SuPHP, Proxy, UniqueId, Mod Security, Suhosin for PHP, CGI, Fastcgi, SafeMode, Safe PHP CGI

Uncheck: Frontpage, Eaccelerator, POSIX, Path Info Check
Don’t forget to read the documentation before you activate any more extensions.
After you are done click “Save and build”.
The compilation process will take a while so be patient. After it is done you will be prompted with a form, select the following:
Default PHP Version (.php files) 5
PHP 5 Handler ***
PHP 4 Handler none
Apache suEXEC on
*** At this point you need to select the php handler, for now let’s stick with suPHP since it’s secure
I guess that you noticed fcgi was selected for compilation, I’ll explain in a future article how to securely configure fcgi as php handler, by default it’s a security risk and not stable at all. For suPHP you can’t enable Eaccelerator so make sure it’s disabled, when you wanna switch to fcgi you can enable it.
And click “Save New Configuration”

Configuring Apahce:

1. Navigate to: Main >> Security Center >> Apache mod_userdir Tweak
And check: “Enable mod_userdir Protection”

2. Navigate to: Main >> Service Configuration >> Apache Configuration >> Global Configuration
Now configure the options as bellow:
TraceEnable – Off
ServerSignature – Off
ServerTokens – ProductOnly
FileTag – None
MaxClients – 256
MaxRequestsPerChild – 1000
Click “Save” and in the following window click “Rebuild Configuration and Restart Apache”.
If you server is under heavy traffic then you should edit: /usr/local/apache/conf/httpd.conf
ServerLimit 1000
MinSpareServers 5
MaxSpareServers 10
</IfModule>
MaxClients 256
MaxRequestsPerChild 1000

And raise the valuse of “ServerLimit” and “MaxClients”, don’t raise too much the value of MaxClients, if your server ever gets attacked/ddos then it might hang if it runs out of memory, try and set it to under: 150 x RAM Memory (in GB).

3. Navigate to: Main >> Service Configuration >> Apache Configuration >> Memory Usage Restrictions
And click: “Proceed >>”

4. Navigate to: Main >> Service Configuration >> Apache Configuration >> Log Rotation
And check all files/logs, after click “Save”.

That’s it for now, stay tuned for more.

مشکل آپدیت نشدن ویندوز 2003 & 2008 Server

$
0
0
مشکل آپدیت ویندوز 2008 و 2003

سـلام

چند وقتی بود که برخی از کاربران سرورهای مجازی و اختصاصی رسانگار مطلبی رو عنوان میردند که جالب و تقریبا بدون علت بود !

 

آپدیت نشدن سرورهای ویندوز نسخه سرور 2033 و 2008

به صورت همزمان گزارش شد که در صورت عدم آپدیت  وارد سایت مایکروسافت هم نمیتوان شد،

شاید اولین گامی که شما برداشته باشید نصب مجدد ویندوز بوده باشد .  ولی در این مطلب یک راه حل خوب و ساده برای رفع این مشکل به شما معرفی میکینم !

به مسیر زیر رفته  :

    Start —> Control Panel —> Administrative Tools —> Services

ابتدا Automatic Updates رو انتخاب کرده و مقدار StartUp Type رو روی Automatic تنظیم و فعال میکنیم

بعد Background Intelligent Transfer Service رو انتخاب نموده و مقدار StartUp Type روی Manual تنظیم و غیر فعال میکنیم

در مرحله بعدی DNS Client رو غیرفعال کرده و سرویس مروبطه را از Service Manager  Stop میکنیم

بعد باید بریم توی تنظیمات کارت شبکه و dns ها رو به DNS های گوگل تغییر بدیم:

8.8.8.8

8.8.4.4  و یا 4.2.2.2

بعد از انجام این کار ویندوز شما روی VPS یا سرور اختصاصی به راحتی Update خواهد شد.

بهینه سازی مصرف RAM و CPU در cPanel/WHM VPS Optimized 3

$
0
0

با انتشار لایسنس و نسخه مخصوص سرور های مجازی کنترل پنل محبوب  cPanel یکی از کاربران درخواست انتشار آموزشی مبنبی بر کاهش استفاده از RAM و CPU سرور مجازی ویژه هاستینگ را داشتند

In order to keep the How-Tos tidy, we're also going to start a separate thread for feedback, comments, suggestions and queries so that, if necessary, we can come back to the original how-tos and edit/update/correct them, so please do not reply to this - Please use this thread for any feedback: http://www.solarvps.com/forums/showthread.php?p=1169#post1169

So, here goes - Whenever I get a new cPanel/WHM VPS (or server) here's the first things I adjust or tweak to cut down on resource usage:

1) Mailman - Mailman is a memory glutton. It runs constantly as a process, gobbling memory for no good reason. If you don't need it, pop into WHM >> Server Configuration >> Tweak Settings and turn it off by unchecking the box. If you need a good mailing list, then PHPList (http://www.phplist.com) works fine, uses resources only when it needs it, and also comes with Fantastico if you have it.

2) While in Tweak Settings, there's some other adjustments you can make:

a) Mail >> Number of minutes between mail server queue runs (default is 60). Each time the mail queue runs it increases load - The default of 60 can safely be reduced to 120 or even 180 on a busy server. Whilst there I also disable Boxtrapper Spam Trap and SpamAssassin Spam Box delivery, on the basis that whilst the server will filter out most of the spam coming in, it's then up to the users to employ filters in their email clients etc in order to filter out the rest of the rubbish - Using Boxtrapper and SpamBox simply puts more load on the server. (These 2 options also need to be disabled in the feature lists you use so that they don't show up as available in clients' cPanels).

b) Also under the Mail section, I set the "Default catch-all/default address behavior for new accounts" to fail - there's no need to collect unwanted or unroutable mail in catch-all folders.

If you're doing this to a server with accounts already on it, changing this setting will not change those existing accounts, which are probably set to the default of BLACKHOLE. You can enforce the change onto all existing accounts by logging in via SSH and running the command:

perl -pi -e "s:blackhole:/:fail:/g;" /etc/valiases/*


c) Further down in the Tweak Settings section are the settings for Stats programs. Turn off Reverse DNS Lookup for AWStats, disable Analog Stats (pretty useless really) and just run with AWStats (if you need it) and Webalizer. All stats programs run processes to collate the stats so if you can get away with using just Webalizer all the better.

d) Further down under tweak Settings, in the System section, is an option "Conserve Memory at the expense of using more cpu/diskio." If you're running a server that is always maxing out on memory usage this may be an option to try, but you should bear in mind that it does slightly reduce speed of processing, and you should check with Solar VPS Support that, as a result, you're not using more than your share of CPU resources.

Also under the System section, ensure that you have checked the "Do not start deprecated Melange 1.10 chat server." option.

3) Spamassassin: Spamassassin is also a memory hungry beast in its default setup, but you can reduce this very easily. In WHM scroll right down the left-hand menus until you get to the cPanel section and click on Manage Plugins. There are two plugins in there that you should enable - spamdconf and cronconfig (more on this one in a minute). Once you have checked those two options, scroll down to the bottom and click Save. Your server will then contact the cPanel servers and install those 2 plugins for you in a minute or so. Once done, refresh the left hand frame in your browser (the one containing the WHM menus) and you'll see a new section right at the bottom (You will already have this section if you run Fantastico, but these new 2 options will be added to it).

Select "Setup Spamd Startup Configuration" and you will presented with 4 option boxes, the second of which is the one we want. Setting "Maximum Children" to 2 (no, this isn't birth control LOL) will restrict the number of processes Spamassassin fires up on startup, each of which eats memory. Once you save this the server will restart Ensim to build in the new setting - this can take up to a minute to restart, so just be patient.

4) Cron times: Cron jobs use memory and CPU resources, so it's best to check that they run in off-peak hours (usually overnight). The other option we just added in the Manage Plugins section has added a menu option "Configure cPanel Cron Times" in the Plugins section at the bottom of the WHM menu. Within that section are 2 settings for the times that your cPanel Update runs (if you run it automatically) and the time your backup runs. You can change and "commit" each of these times to something more sensible. Also, if you run Fantastico, there's another option in the Fantastico settings for the time the daily Fantastico update cron job. This is all very much a matter of preference, and depends a lot on when your server is least busy but, for example, one of my standard settings for these would be:

cpbackup = 01:00AM
cpupdate = 03:00AM
Fantastico = 04:00AM

This allows each cron job enough time to run before another one starts so that you don't get 2 resource-hungry routines overlapping. The actual times you use depend on when your own server is least busy. You should also check right up at the top of the WHM menu under Server Time that the server is actually running in the Time Zone you expect - You cannot change this on a VPS but you should ensure that the server time is actually reasonably correct and not set to a timezone that would actually cause your cron jobs to run in peak hours - this actually happened to me once when I discovered that a USA server was actually set to GMT and all my crons were running seven hours earlier than I thought, slap bang in the middle of one of the busiest periods ;)

5) FTP: In WHM >> Service Configuration, there is an option to change 2 settings for FTP. By default the first will be set to use pure-ftpd (this is good) and the second is to allow anonymous FTP (this is very bad). Unless you really want half the world (the bad half) discovering that you run an open FTP server, turn anonymous OFF. Each FTP session uses resources, so you should also be careful about how many FTP logons you allow each account in your Feature Lists. Up to 3 is fine - anything over 10 is getting silly and simply invites your users to use your server for file sharing.

OK, so I guess that's enough for the first section, and following these settings will reduce your memory usage. More soon, and please feel free to comment on or query any of this in the new thread under cPanel in these forums.

نصب و پیکربندی SNMP در Centos

$
0
0
نصب و پیکربندی SNMP در Centos

به احتمال زیاد پیش آمده است بخواهید منابع مصرفی سرور لینوکس CentOS خود را مانیتور نمائید ، این کار را می توانید از طرق مختلف از جمله دریافت اطلاعات از طریق پروتکل SNMP انجام دهید . در این مطلب آموزش به شما آموزش خواهیم داد گونه SNMP را روی سرور اختصاصی یا مجازی لینوکسی خود ( CentOS )  نصب نمایئد .

با استفاده از پروتکل SNMP میتوانید ابعاد مختلف یک CentOS مانند Memory , HardDrive, Uptime , Cpue Usage , Network Usage را مانیتور و بررسی نمائید.

برای آشنایی با پروتکل SNMP اینجا کلیک کنید .

 

گام اول : نصب SNMP روی CentOS (6.3) or other version

خط زیر را در محیط Shell محبوب خود جرا نمائید .

yum install net-snmp-utils net-snmp

گام دوم : قرار دادن SNMP در استارت آپ

chkconfig snmpd on

گام سوم : پیکربندی اولیه تنظیمات SNMP در snmpd.conf

فایل اصلی تنظیمات را به مسیر دیگری منتقل نمائید

mv /etc/snmp/snmpd.conf /root

یک فایل جدید تنظیمات ایجاد کنید

touch /etc/snmp/snmpd.conf

قایل را با ویرایشگر متنی ویرایش نمائید

customize it to your network needs, the important part is the rocommunity, this is your SNMP string

From there start the service

you should be good to start monitoring, check your monitoring software

looks like we are good from our end.

تفاوت Addon Domain , Parked Domain و Subdomain

$
0
0

این سوال بارها توسط کاربران سرویسهای میزبانی وب رسانگار پرسیده شده است :

تفاوت Addon Domain , Parked Domain و Subdomain در کنترل پنهای مختلف هاستینگ چیست ؟ در ادامه توضیحاتی در این خصوص ارائه شده است.

Sub domain یا زیر دامنه

    اگر فرض کنیم سایت شما  mysite.com باشد.
    شما یک بخش پیام ها ایجاد میکنید و آن را در مسیرmysite.com/board/.قرار می دهید.
    شما میتوانید این دایرکتوری را با ایجاد یک زیر دامنه به board.mysite.com تبدیل کنید
    حال میتوانید به سیستم خود از طریق هر دو آدرس board.mysite.com , mysite.com/board/ دسترسی داشته باشید
    این قابلیت در سرویسهای میزبانی وب رسانگار هیچ هزینه ای برای شما نداشته و کاملا رایگان است.

Parked Domain یا دامنه پارک شده

    شما 2 سایت دارید mysite.com و my-other-site.com.
    mysite.com دامنه وب سایت شما است و میخواهید  my-other-site.com. نیز همین وب سایت شما را باز کند.
    You want them both to go to the same place. In other words, when someone types either www.mysite.com or www.my-other-site.com they will go to the same page(s) on your website.
      اگر به دامنه اضافه نیاز دارید لازم است تا از طریق لینک دامنه های مورد نظر خود را سفارش دهید
   

Add-On Domains یا دامنه اضافه

    شما 2 دامنه دارید  mysite.com و my-other-site.com.
    شما می خواهید هر دامنه شما 2 وب سایت جدا گانه باشد
    اگر به دامنه اضافه نیاز دارید لازم است تا از طریق لینک دامنه های مورد نظر خود را سفارش دهید
    ممکن است روی برخی از سرویسهای میزانی قابلیت دامنه اضافه فعال نباشد . برای فعال سازی این قابلیت بایستی درخواست خود را از طریق ارسال تیکت پشتیبانی و با در هنگام ارسال سفارش مطرح نمائید.

نصب و فعال سازی Phyton 2.7 روی CentOS 6.2

$
0
0

CentOS 6.2 ships with Python 2.6.6 and depends on that specific version. Be careful not to replace it or bad things will happen. If you need access to a newer version of Python you must compile it yourself and install it side-by-side with the system version.

Here are the steps necessary to install Python 2.7.3. The procedure is exactly the same for installing Python 3.2.3, just make sure you use the command "python3.2 setup.py install" when you install distribute.

Execute all the commands below as root. Either log in as root temporarily or use sudo.

Install development tools

In order to compile Python you must first install the development tools:

# yum groupinstall "Development tools"

You also need a few extra libs installed before compiling Python or else you will run into problems later when trying to install various packages:

# yum install zlib-devel
# yum install bzip2-devel
# yum install openssl-devel
# yum install ncurses-devel

Download, compile and install Python

# wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
# tar xf Python-2.7.3.tar.bz2
# cd Python-2.7.3
# ./configure --prefix=/usr/local
# make && make altinstall

It is important to use altinstall instead of install, otherwise you will end up with two different versions of Python in the filesystem both named python.

After running the commands above your newly installed Python 2.7.3 interpreter will be available as /usr/local/bin/python2.7 and the system version of Python 2.6.6 will be available as /usr/bin/python and /usr/bin/python2.6.

Installing and configuring distribute (setuptools)

After installing Python 2.7.3 you also need to install distribute (setuptools) so you can easily install new packages in the right location.

# wget http://pypi.python.org/packages/source/d/distribute/distribute-0.6.27.tar.gz
# tar xf distribute-0.6.27.tar.gz
# cd distribute-0.6.27
# python2.7 setup.py install

The commands above will generate the script /usr/local/bin/easy_install-2.7. Use this script to install packages for your new Python version:

# easy_install-2.7 virtualenv

فعال سازی SNMP روی ESXi 5

$
0
0

شاید تا به حال به این نیاز پیدا کرده باشید که وضعیت I/O یکی از LUN های یک سرور اختصاصی با سیستم عامل  ESXi5 که برای مجازی سازی از آن استفاده میکنید را مانیتور کنید ، و یا شاید بخواهید وضعیت پهنای باند پورت سرور را داشته باشید . در این آموزش با ما همراه شوید تا چگونیگی این کار را به شما آموزش دهیم ، فرض بر این سات که شما قبلتر نرم افزار مانیتورینگ مانند Cacti , MRT ,PRTG را نصب کرده و آماده بهره برداری است .

راه های زیادی در گوگل و وب سایت Vmware برای فعال سازی پیشنهاد شده است .اما سرعترین راه همین است که در این مطلب له آن پرداخته ایم ، ویرایش فایل snmp.xml

با برنامه Putty به سرور خود متصل شوید  ( لازم است قبلا سرویس SSH را روی سرور فعال کرده باشید و همچنین روی فایروال ESX SSH آی پی که میخواهید با آن به سرور متصل شوید را باز کنید )

به پوشه Vmware  بروید

cd /etc/vmware/

با دستور ls می بینید که snmp.xml آنجا قرار دارد

Step1

این فایل را با استفاده از vi ویرایش کنید

vi snmp.xml

یک خط متون پشت سر هم خواهید دید برای شروع ویرایش کلید i را زده و تغیرات زیر را اعمال کنید

Step2

بایستی  false به true  و عبارت Public  بین تگ های <communities></communities> قرار داده شود (Public همان کلمه دسترسی به  SNMP سرور شما از SNMP کلاینت می باشد)

Step3

بعد از اتمام کلید Esc را زده و  :wq را بر ای ذخیره و خروج تایپ و Enter کنید

حالا تمامی سرویسها را با استفاده از دستور  /sbin/services.sh restart مجددا راه اندازی کنید

سرور شما با کلمه دسترسی که تعریف نموده اید از طریق برنامه مانیتورینگ شما در دسترس قرار خواهد گرفت

موفق باشید .

10 نکته در طراحی رابط کاربری

$
0
0

10 قانون طراحی رابط کاربری نرم افزار کارآمد

توضیح :

10 قاعده بسیار کلی و فراگیر طراحی رابط کاربری که به آنها قواعد اکتشافی گفته می شود در زیر آورده شده است ، اکتشافی برای اینکه آنها در طبیعت قوانین شصت انسان هستند تا یک قاعده کاربری ساده مشخص!

قابل روئیت بودن وضعیت سیستم: 

سیستم همیشه باید کاربر را از وضعیت فعلی خود مطلع سازد و پیامی مبنی بر رخداد در حال اجرا در سیستم در یک پیام مناسب و بازه زمانی قابل قبول نمایش دهد.

هماهنگی بین سیستم و دنیای واقعی :

سیستم بایستی به زبان کاربران سخن بگوید ، با کلمات ، عبارات و مفاهیمی که برای کاربران آشنا باشد ،بر خلاف قوائد سیستم محوری ، از قواعد دنیای واقعی پیروی نمائید، کاری کنید تا اطلاعات با یک ترتیب طبیعی و منطقی نمایش داده شوند

 

کنترل و آزادی کاربر

کاربران گاهی ممکن است عملکردهای سیستمی خاصی را ناخواسته و یا به اشتباه تغییر دهند ، همیشه نیاز استا تا یک راه خروج اضطراری به صورت شفاف برای اون وجودئ داشته باشد تا بتواند به راحتی از ظرایط تاخواسته ، بدون عبور از دیالوگ های طولانی خطا و پیام خارج شود ، پشتیبانی از Redo,Undo یکی از این گزینه ها می باشد.
      
     
سازگاری و استانداردها

کاربران نباید از
    Users should not have to wonder whether different words, situations, or actions mean the same thing. Follow platform conventions.
      
Error prevention
    Even better than good error messages is a careful design which prevents a problem from occurring in the first place. Either eliminate error-prone conditions or check for them and present users with a confirmation option before they commit to the action.
      
Recognition rather than recall
    Minimize the user's memory load by making objects, actions, and options visible. The user should not have to remember information from one part of the dialogue to another. Instructions for use of the system should be visible or easily retrievable whenever appropriate.
      
Flexibility and efficiency of use
    Accelerators -- unseen by the novice user -- may often speed up the interaction for the expert user such that the system can cater to both inexperienced and experienced users. Allow users to tailor frequent actions.
      
Aesthetic and minimalist design
    Dialogues should not contain information which is irrelevant or rarely needed. Every extra unit of information in a dialogue competes with the relevant units of information and diminishes their relative visibility.
      
Help users recognize, diagnose, and recover from errors
    Error messages should be expressed in plain language (no codes), precisely indicate the problem, and constructively suggest a solution.
      
Help and documentation
    Even though it is better if the system can be used without documentation, it may be necessary to provide help and documentation. Any such information should be easy to search, focused on the user's task, list concrete steps to be carried out, and not be too large.

- See more at: http://www.nngroup.com/articles/ten-usability-heuristics/#sthash.6XPwsaTU.dpuf

جلوگیری از دزدی لینک و پهنای باند ( hotlinking ) با فایل httaccess

$
0
0

لینک داغ ، هات لینکینگ ، Hotlinking که به استفاده از تصاویر و یا دیگر فایلهای یک وب سایت در وب سایت دیگر و استفاده از پهنای باند و منابع وب سایت مبدا است می گویند که متاسفانه یک موضوع شایع در وب است . در ادامه به روش جلوگیری از این کار با استفاده از فایل htaccess اشاره خواهیم نمود.

با قرار دادن مجموعه کد های کاربردی که در زیر آورده شده است در فایل htaccess تمامی درخواستهای وب سایتهای دیگر که برای این تصاویر و دیگر رسانه ها که به وب سایت شما لینک شده اند را با یک تصویر اخطار جایگرین خواهد نمود

RewriteEngine On
#Replace ?mysite\.com/ with your blog url
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
#Replace /images/nohotlink.jpg with your "don't hotlink" image url
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]

خطای اتصال به دیتاسبیس در سایتها و استارت نشدن MySQL در cPanel

$
0
0

بسیار پیش آمده است که به علت های گوناگون سرویس MySQL سی پنل شما استارت نشود و وب سایتهای روی سرور شما با خطای اتصال به دیتابیس مواجه شوند :

در زیر به برخی از این خطا ها ، علت لوجود آمدن ها و روش حل مشکل اشاره خواهیم داشت .

  1. استارت نشدن سرویس mySQL به علت پرشدن مسیر /tmp سرور


در صورتی که مسیر /tmp سرور شما که محل ذخیره سازی فایلهای موقتی اعم از اسکریپت ها ، نشستهای کنترل پنل ، فایلهای در حال فشرده سازی ، نسخه های در حال پشتیبان گیری دیتابیس و ..... پر شود بعد از اطمینان از علت مشکل اط طریق قسمت service manager در WHM نسبت به حذف این فایلها به ترتبی زیر اقدام نمائید.

cd /tmp
rm -f -r sess_*

که تمامی session ها را پاک میکند
با دستور
ls -l میتوانید لیست فایلها و سایز هر یک از آنها روی دیسک را مشاهده و بصورت دستی حذف نمائید
مثلا
rm -f fcgid.tmp.zDbdhS

هیچ گاه از دستور rm -f به تنهایی استفاده ننموده  و  فایلهای مهم و در حال استفاده مانند mysql.sock@ را حذف نکنید.

بسیار پیش آمده است که به علت های گوناگون سرویس MySQL سی پنل شما استارت نشود و وب سایتهای روی سرور شما با خطای اتصال به دیتابیس مواجه شوند :

در زیر به برخی از این خطا ها ، علت لوجود آمدن ها و روش حل مشکل اشاره خواهیم داشت .

بهینه سازی و امنیت آپاچی در cPanel

$
0
0
کانفیگ امنیتی cPanel

در این مقاله ما بر اساس تجربیات خود در زمینه ارائه سرویسهای میزبانی وب اشتراکی لینوکس نکاتی را با شما به اشتراک می گذاریم تا بدانید چگونه میتوانید آپاچی را امن کنید و تا حدودی کارایی آن را افزایش دهید !

در این مطلب من به شما راهکارهایی کوچک را نشان خواهم دارد تا آپاچی را امن و بهینه نمائید. این مقاله فقط یک نقطه آغاز برای سری طولانی امنیت و بهینه سازی سرورهای cPanel می باشد.

مقالاتی که در آینده به آنها اشاره خواهیم نمود : امنیت PHP , تنظیمات CentOS

In this article I will share a few tips on how to optimize and secure Apache for cPanel servers. This article is the beginning of a long series of server security and optimization for cPanel.
Articles to come: PHP security, CentOS configuration for cPanel, mod security for apache, firewall configuration, cPanel optimization, and much more.

Building Apache:

In order to compile apache, php and other modules you can use “Easy Apache”, you can access it using this ways:
1. From cPanel WHM navigate to: Main >> Software >> EasyApache (Apache Update)
2. From a ssh session execute: /scripts/easyapache
I suggest using the web version, it is easier to read for beginners. Let’s begin:
Page1: Profile
Select: “PHP Security” and push: “Start customizing based on profile”
Page2: Apache Version
Select: “Apache 2.2″ and click “Next Step”
Page3: PHP Major Version
Select: “PHP 5″ and click “Next Step”
Page4: PHP Minor Version
Select: “PHP 5.2.12″ and click “Next Step” (PHP 5.3 is a bit different then 5.2 and has a lot of functions disabled/removed, select PHP 5.3 only if your scripts are compatible with this version).
Page5: Short Options List
Uncheck: Frontpage (this extension is not supported anymore)
Check: Anything that you might need and make sure that: Mod Security, Mod SuPHP and Suhosin for PHP remains checked.
After you are done click on: “Exhaustive Options List”
Page6: Exhaustive Options List
Check: Mod FCGID, Fileprotect, MPM Prefork, Mod SuPHP, Proxy, UniqueId, Mod Security, Suhosin for PHP, CGI, Fastcgi, SafeMode, Safe PHP CGI

Uncheck: Frontpage, Eaccelerator, POSIX, Path Info Check
Don’t forget to read the documentation before you activate any more extensions.
After you are done click “Save and build”.
The compilation process will take a while so be patient. After it is done you will be prompted with a form, select the following:
Default PHP Version (.php files) 5
PHP 5 Handler ***
PHP 4 Handler none
Apache suEXEC on
*** At this point you need to select the php handler, for now let’s stick with suPHP since it’s secure
I guess that you noticed fcgi was selected for compilation, I’ll explain in a future article how to securely configure fcgi as php handler, by default it’s a security risk and not stable at all. For suPHP you can’t enable Eaccelerator so make sure it’s disabled, when you wanna switch to fcgi you can enable it.
And click “Save New Configuration”

Configuring Apahce:

1. Navigate to: Main >> Security Center >> Apache mod_userdir Tweak
And check: “Enable mod_userdir Protection”

2. Navigate to: Main >> Service Configuration >> Apache Configuration >> Global Configuration
Now configure the options as bellow:
TraceEnable – Off
ServerSignature – Off
ServerTokens – ProductOnly
FileTag – None
MaxClients – 256
MaxRequestsPerChild – 1000
Click “Save” and in the following window click “Rebuild Configuration and Restart Apache”.
If you server is under heavy traffic then you should edit: /usr/local/apache/conf/httpd.conf
ServerLimit 1000
MinSpareServers 5
MaxSpareServers 10
</IfModule>
MaxClients 256
MaxRequestsPerChild 1000

And raise the valuse of “ServerLimit” and “MaxClients”, don’t raise too much the value of MaxClients, if your server ever gets attacked/ddos then it might hang if it runs out of memory, try and set it to under: 150 x RAM Memory (in GB).

3. Navigate to: Main >> Service Configuration >> Apache Configuration >> Memory Usage Restrictions
And click: “Proceed >>”

4. Navigate to: Main >> Service Configuration >> Apache Configuration >> Log Rotation
And check all files/logs, after click “Save”.

That’s it for now, stay tuned for more.

مشکل آپدیت نشدن ویندوز 2003 & 2008 Server

$
0
0
مشکل آپدیت ویندوز 2008 و 2003

سـلام

چند وقتی بود که برخی از کاربران سرورهای مجازی و اختصاصی رسانگار مطلبی رو عنوان میردند که جالب و تقریبا بدون علت بود !

 

آپدیت نشدن سرورهای ویندوز نسخه سرور 2033 و 2008

به صورت همزمان گزارش شد که در صورت عدم آپدیت  وارد سایت مایکروسافت هم نمیتوان شد،

شاید اولین گامی که شما برداشته باشید نصب مجدد ویندوز بوده باشد .  ولی در این مطلب یک راه حل خوب و ساده برای رفع این مشکل به شما معرفی میکینم !

به مسیر زیر رفته  :

    Start —> Control Panel —> Administrative Tools —> Services

ابتدا Automatic Updates رو انتخاب کرده و مقدار StartUp Type رو روی Automatic تنظیم و فعال میکنیم

بعد Background Intelligent Transfer Service رو انتخاب نموده و مقدار StartUp Type روی Manual تنظیم و غیر فعال میکنیم

در مرحله بعدی DNS Client رو غیرفعال کرده و سرویس مروبطه را از Service Manager  Stop میکنیم

بعد باید بریم توی تنظیمات کارت شبکه و dns ها رو به DNS های گوگل تغییر بدیم:

8.8.8.8

8.8.4.4  و یا 4.2.2.2

بعد از انجام این کار ویندوز شما روی VPS یا سرور اختصاصی به راحتی Update خواهد شد.

بهینه سازی مصرف RAM و CPU در cPanel/WHM VPS Optimized 3

$
0
0

با انتشار لایسنس و نسخه مخصوص سرور های مجازی کنترل پنل محبوب  cPanel یکی از کاربران درخواست انتشار آموزشی مبنبی بر کاهش استفاده از RAM و CPU سرور مجازی ویژه هاستینگ را داشتند

In order to keep the How-Tos tidy, we're also going to start a separate thread for feedback, comments, suggestions and queries so that, if necessary, we can come back to the original how-tos and edit/update/correct them, so please do not reply to this - Please use this thread for any feedback: http://www.solarvps.com/forums/showthread.php?p=1169#post1169

So, here goes - Whenever I get a new cPanel/WHM VPS (or server) here's the first things I adjust or tweak to cut down on resource usage:

1) Mailman - Mailman is a memory glutton. It runs constantly as a process, gobbling memory for no good reason. If you don't need it, pop into WHM >> Server Configuration >> Tweak Settings and turn it off by unchecking the box. If you need a good mailing list, then PHPList (http://www.phplist.com) works fine, uses resources only when it needs it, and also comes with Fantastico if you have it.

2) While in Tweak Settings, there's some other adjustments you can make:

a) Mail >> Number of minutes between mail server queue runs (default is 60). Each time the mail queue runs it increases load - The default of 60 can safely be reduced to 120 or even 180 on a busy server. Whilst there I also disable Boxtrapper Spam Trap and SpamAssassin Spam Box delivery, on the basis that whilst the server will filter out most of the spam coming in, it's then up to the users to employ filters in their email clients etc in order to filter out the rest of the rubbish - Using Boxtrapper and SpamBox simply puts more load on the server. (These 2 options also need to be disabled in the feature lists you use so that they don't show up as available in clients' cPanels).

b) Also under the Mail section, I set the "Default catch-all/default address behavior for new accounts" to fail - there's no need to collect unwanted or unroutable mail in catch-all folders.

If you're doing this to a server with accounts already on it, changing this setting will not change those existing accounts, which are probably set to the default of BLACKHOLE. You can enforce the change onto all existing accounts by logging in via SSH and running the command:

perl -pi -e "s:blackhole:/:fail:/g;" /etc/valiases/*


c) Further down in the Tweak Settings section are the settings for Stats programs. Turn off Reverse DNS Lookup for AWStats, disable Analog Stats (pretty useless really) and just run with AWStats (if you need it) and Webalizer. All stats programs run processes to collate the stats so if you can get away with using just Webalizer all the better.

d) Further down under tweak Settings, in the System section, is an option "Conserve Memory at the expense of using more cpu/diskio." If you're running a server that is always maxing out on memory usage this may be an option to try, but you should bear in mind that it does slightly reduce speed of processing, and you should check with Solar VPS Support that, as a result, you're not using more than your share of CPU resources.

Also under the System section, ensure that you have checked the "Do not start deprecated Melange 1.10 chat server." option.

3) Spamassassin: Spamassassin is also a memory hungry beast in its default setup, but you can reduce this very easily. In WHM scroll right down the left-hand menus until you get to the cPanel section and click on Manage Plugins. There are two plugins in there that you should enable - spamdconf and cronconfig (more on this one in a minute). Once you have checked those two options, scroll down to the bottom and click Save. Your server will then contact the cPanel servers and install those 2 plugins for you in a minute or so. Once done, refresh the left hand frame in your browser (the one containing the WHM menus) and you'll see a new section right at the bottom (You will already have this section if you run Fantastico, but these new 2 options will be added to it).

Select "Setup Spamd Startup Configuration" and you will presented with 4 option boxes, the second of which is the one we want. Setting "Maximum Children" to 2 (no, this isn't birth control LOL) will restrict the number of processes Spamassassin fires up on startup, each of which eats memory. Once you save this the server will restart Ensim to build in the new setting - this can take up to a minute to restart, so just be patient.

4) Cron times: Cron jobs use memory and CPU resources, so it's best to check that they run in off-peak hours (usually overnight). The other option we just added in the Manage Plugins section has added a menu option "Configure cPanel Cron Times" in the Plugins section at the bottom of the WHM menu. Within that section are 2 settings for the times that your cPanel Update runs (if you run it automatically) and the time your backup runs. You can change and "commit" each of these times to something more sensible. Also, if you run Fantastico, there's another option in the Fantastico settings for the time the daily Fantastico update cron job. This is all very much a matter of preference, and depends a lot on when your server is least busy but, for example, one of my standard settings for these would be:

cpbackup = 01:00AM
cpupdate = 03:00AM
Fantastico = 04:00AM

This allows each cron job enough time to run before another one starts so that you don't get 2 resource-hungry routines overlapping. The actual times you use depend on when your own server is least busy. You should also check right up at the top of the WHM menu under Server Time that the server is actually running in the Time Zone you expect - You cannot change this on a VPS but you should ensure that the server time is actually reasonably correct and not set to a timezone that would actually cause your cron jobs to run in peak hours - this actually happened to me once when I discovered that a USA server was actually set to GMT and all my crons were running seven hours earlier than I thought, slap bang in the middle of one of the busiest periods ;)

5) FTP: In WHM >> Service Configuration, there is an option to change 2 settings for FTP. By default the first will be set to use pure-ftpd (this is good) and the second is to allow anonymous FTP (this is very bad). Unless you really want half the world (the bad half) discovering that you run an open FTP server, turn anonymous OFF. Each FTP session uses resources, so you should also be careful about how many FTP logons you allow each account in your Feature Lists. Up to 3 is fine - anything over 10 is getting silly and simply invites your users to use your server for file sharing.

OK, so I guess that's enough for the first section, and following these settings will reduce your memory usage. More soon, and please feel free to comment on or query any of this in the new thread under cPanel in these forums.


نصب و پیکربندی SNMP در Centos

$
0
0
نصب و پیکربندی SNMP در Centos

به احتمال زیاد پیش آمده است بخواهید منابع مصرفی سرور لینوکس CentOS خود را مانیتور نمائید ، این کار را می توانید از طرق مختلف از جمله دریافت اطلاعات از طریق پروتکل SNMP انجام دهید . در این مطلب آموزش به شما آموزش خواهیم داد گونه SNMP را روی سرور اختصاصی یا مجازی لینوکسی خود ( CentOS )  نصب نمایئد .

با استفاده از پروتکل SNMP میتوانید ابعاد مختلف یک CentOS مانند Memory , HardDrive, Uptime , Cpue Usage , Network Usage را مانیتور و بررسی نمائید.

برای آشنایی با پروتکل SNMP اینجا کلیک کنید .

 

گام اول : نصب SNMP روی CentOS (6.3) or other version

خط زیر را در محیط Shell محبوب خود جرا نمائید .

yum install net-snmp-utils net-snmp

گام دوم : قرار دادن SNMP در استارت آپ

chkconfig snmpd on

گام سوم : پیکربندی اولیه تنظیمات SNMP در snmpd.conf

فایل اصلی تنظیمات را به مسیر دیگری منتقل نمائید

mv /etc/snmp/snmpd.conf /root

یک فایل جدید تنظیمات ایجاد کنید

touch /etc/snmp/snmpd.conf

قایل را با ویرایشگر متنی ویرایش نمائید

customize it to your network needs, the important part is the rocommunity, this is your SNMP string

From there start the service

you should be good to start monitoring, check your monitoring software

looks like we are good from our end.

تفاوت Addon Domain , Parked Domain و Subdomain

$
0
0

این سوال بارها توسط کاربران سرویسهای میزبانی وب رسانگار پرسیده شده است :

تفاوت Addon Domain , Parked Domain و Subdomain در کنترل پنهای مختلف هاستینگ چیست ؟ در ادامه توضیحاتی در این خصوص ارائه شده است.

Sub domain یا زیر دامنه

    اگر فرض کنیم سایت شما  mysite.com باشد.
    شما یک بخش پیام ها ایجاد میکنید و آن را در مسیرmysite.com/board/.قرار می دهید.
    شما میتوانید این دایرکتوری را با ایجاد یک زیر دامنه به board.mysite.com تبدیل کنید
    حال میتوانید به سیستم خود از طریق هر دو آدرس board.mysite.com , mysite.com/board/ دسترسی داشته باشید
    این قابلیت در سرویسهای میزبانی وب رسانگار هیچ هزینه ای برای شما نداشته و کاملا رایگان است.

Parked Domain یا دامنه پارک شده

    شما 2 سایت دارید mysite.com و my-other-site.com.
    mysite.com دامنه وب سایت شما است و میخواهید  my-other-site.com. نیز همین وب سایت شما را باز کند.
    You want them both to go to the same place. In other words, when someone types either www.mysite.com or www.my-other-site.com they will go to the same page(s) on your website.
      اگر به دامنه اضافه نیاز دارید لازم است تا از طریق لینک دامنه های مورد نظر خود را سفارش دهید
   

Add-On Domains یا دامنه اضافه

    شما 2 دامنه دارید  mysite.com و my-other-site.com.
    شما می خواهید هر دامنه شما 2 وب سایت جدا گانه باشد
    اگر به دامنه اضافه نیاز دارید لازم است تا از طریق لینک دامنه های مورد نظر خود را سفارش دهید
    ممکن است روی برخی از سرویسهای میزانی قابلیت دامنه اضافه فعال نباشد . برای فعال سازی این قابلیت بایستی درخواست خود را از طریق ارسال تیکت پشتیبانی و با در هنگام ارسال سفارش مطرح نمائید.

نصب و فعال سازی Phyton 2.7 روی CentOS 6.2

$
0
0

CentOS 6.2 ships with Python 2.6.6 and depends on that specific version. Be careful not to replace it or bad things will happen. If you need access to a newer version of Python you must compile it yourself and install it side-by-side with the system version.

Here are the steps necessary to install Python 2.7.3. The procedure is exactly the same for installing Python 3.2.3, just make sure you use the command "python3.2 setup.py install" when you install distribute.

Execute all the commands below as root. Either log in as root temporarily or use sudo.

Install development tools

In order to compile Python you must first install the development tools:

# yum groupinstall "Development tools"

You also need a few extra libs installed before compiling Python or else you will run into problems later when trying to install various packages:

# yum install zlib-devel
# yum install bzip2-devel
# yum install openssl-devel
# yum install ncurses-devel

Download, compile and install Python

# wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
# tar xf Python-2.7.3.tar.bz2
# cd Python-2.7.3
# ./configure --prefix=/usr/local
# make && make altinstall

It is important to use altinstall instead of install, otherwise you will end up with two different versions of Python in the filesystem both named python.

After running the commands above your newly installed Python 2.7.3 interpreter will be available as /usr/local/bin/python2.7 and the system version of Python 2.6.6 will be available as /usr/bin/python and /usr/bin/python2.6.

Installing and configuring distribute (setuptools)

After installing Python 2.7.3 you also need to install distribute (setuptools) so you can easily install new packages in the right location.

# wget http://pypi.python.org/packages/source/d/distribute/distribute-0.6.27.tar.gz
# tar xf distribute-0.6.27.tar.gz
# cd distribute-0.6.27
# python2.7 setup.py install

The commands above will generate the script /usr/local/bin/easy_install-2.7. Use this script to install packages for your new Python version:

# easy_install-2.7 virtualenv

10 نکته در طراحی رابط کاربری

$
0
0

10 قانون طراحی رابط کاربری نرم افزار کارآمد

توضیح :

10 قاعده بسیار کلی و فراگیر طراحی رابط کاربری که به آنها قواعد اکتشافی گفته می شود در زیر آورده شده است ، اکتشافی برای اینکه آنها در طبیعت قوانین شصت انسان هستند تا یک قاعده کاربری ساده مشخص!

قابل روئیت بودن وضعیت سیستم: 

سیستم همیشه باید کاربر را از وضعیت فعلی خود مطلع سازد و پیامی مبنی بر رخداد در حال اجرا در سیستم در یک پیام مناسب و بازه زمانی قابل قبول نمایش دهد.

هماهنگی بین سیستم و دنیای واقعی :

سیستم بایستی به زبان کاربران سخن بگوید ، با کلمات ، عبارات و مفاهیمی که برای کاربران آشنا باشد ،بر خلاف قوائد سیستم محوری ، از قواعد دنیای واقعی پیروی نمائید، کاری کنید تا اطلاعات با یک ترتیب طبیعی و منطقی نمایش داده شوند

 

کنترل و آزادی کاربر

کاربران گاهی ممکن است عملکردهای سیستمی خاصی را ناخواسته و یا به اشتباه تغییر دهند ، همیشه نیاز استا تا یک راه خروج اضطراری به صورت شفاف برای اون وجودئ داشته باشد تا بتواند به راحتی از ظرایط تاخواسته ، بدون عبور از دیالوگ های طولانی خطا و پیام خارج شود ، پشتیبانی از Redo,Undo یکی از این گزینه ها می باشد.
      
     
سازگاری و استانداردها

کاربران نباید از
    Users should not have to wonder whether different words, situations, or actions mean the same thing. Follow platform conventions.
      
Error prevention
    Even better than good error messages is a careful design which prevents a problem from occurring in the first place. Either eliminate error-prone conditions or check for them and present users with a confirmation option before they commit to the action.
      
Recognition rather than recall
    Minimize the user's memory load by making objects, actions, and options visible. The user should not have to remember information from one part of the dialogue to another. Instructions for use of the system should be visible or easily retrievable whenever appropriate.
      
Flexibility and efficiency of use
    Accelerators -- unseen by the novice user -- may often speed up the interaction for the expert user such that the system can cater to both inexperienced and experienced users. Allow users to tailor frequent actions.
      
Aesthetic and minimalist design
    Dialogues should not contain information which is irrelevant or rarely needed. Every extra unit of information in a dialogue competes with the relevant units of information and diminishes their relative visibility.
      
Help users recognize, diagnose, and recover from errors
    Error messages should be expressed in plain language (no codes), precisely indicate the problem, and constructively suggest a solution.
      
Help and documentation
    Even though it is better if the system can be used without documentation, it may be necessary to provide help and documentation. Any such information should be easy to search, focused on the user's task, list concrete steps to be carried out, and not be too large.

- See more at: http://www.nngroup.com/articles/ten-usability-heuristics/#sthash.6XPwsaTU.dpuf

بهینه سازی و امنیت آپاچی در cPanel

$
0
0
کانفیگ امنیتی cPanel

در این مقاله ما بر اساس تجربیات خود در زمینه ارائه سرویسهای میزبانی وب اشتراکی لینوکس نکاتی را با شما به اشتراک می گذاریم تا بدانید چگونه میتوانید آپاچی را امن کنید و تا حدودی کارایی آن را افزایش دهید !

در این مطلب من به شما راهکارهایی کوچک را نشان خواهم دارد تا آپاچی را امن و بهینه نمائید. این مقاله فقط یک نقطه آغاز برای سری طولانی امنیت و بهینه سازی سرورهای cPanel می باشد.

مقالاتی که در آینده به آنها اشاره خواهیم نمود : امنیت PHP , تنظیمات CentOS

In this article I will share a few tips on how to optimize and secure Apache for cPanel servers. This article is the beginning of a long series of server security and optimization for cPanel.
Articles to come: PHP security, CentOS configuration for cPanel, mod security for apache, firewall configuration, cPanel optimization, and much more.

Building Apache:

In order to compile apache, php and other modules you can use “Easy Apache”, you can access it using this ways:
1. From cPanel WHM navigate to: Main >> Software >> EasyApache (Apache Update)
2. From a ssh session execute: /scripts/easyapache
I suggest using the web version, it is easier to read for beginners. Let’s begin:
Page1: Profile
Select: “PHP Security” and push: “Start customizing based on profile”
Page2: Apache Version
Select: “Apache 2.2″ and click “Next Step”
Page3: PHP Major Version
Select: “PHP 5″ and click “Next Step”
Page4: PHP Minor Version
Select: “PHP 5.2.12″ and click “Next Step” (PHP 5.3 is a bit different then 5.2 and has a lot of functions disabled/removed, select PHP 5.3 only if your scripts are compatible with this version).
Page5: Short Options List
Uncheck: Frontpage (this extension is not supported anymore)
Check: Anything that you might need and make sure that: Mod Security, Mod SuPHP and Suhosin for PHP remains checked.
After you are done click on: “Exhaustive Options List”
Page6: Exhaustive Options List
Check: Mod FCGID, Fileprotect, MPM Prefork, Mod SuPHP, Proxy, UniqueId, Mod Security, Suhosin for PHP, CGI, Fastcgi, SafeMode, Safe PHP CGI

Uncheck: Frontpage, Eaccelerator, POSIX, Path Info Check
Don’t forget to read the documentation before you activate any more extensions.
After you are done click “Save and build”.
The compilation process will take a while so be patient. After it is done you will be prompted with a form, select the following:
Default PHP Version (.php files) 5
PHP 5 Handler ***
PHP 4 Handler none
Apache suEXEC on
*** At this point you need to select the php handler, for now let’s stick with suPHP since it’s secure
I guess that you noticed fcgi was selected for compilation, I’ll explain in a future article how to securely configure fcgi as php handler, by default it’s a security risk and not stable at all. For suPHP you can’t enable Eaccelerator so make sure it’s disabled, when you wanna switch to fcgi you can enable it.
And click “Save New Configuration”

Configuring Apahce:

1. Navigate to: Main >> Security Center >> Apache mod_userdir Tweak
And check: “Enable mod_userdir Protection”

2. Navigate to: Main >> Service Configuration >> Apache Configuration >> Global Configuration
Now configure the options as bellow:
TraceEnable – Off
ServerSignature – Off
ServerTokens – ProductOnly
FileTag – None
MaxClients – 256
MaxRequestsPerChild – 1000
Click “Save” and in the following window click “Rebuild Configuration and Restart Apache”.
If you server is under heavy traffic then you should edit: /usr/local/apache/conf/httpd.conf
ServerLimit 1000
MinSpareServers 5
MaxSpareServers 10
</IfModule>
MaxClients 256
MaxRequestsPerChild 1000

And raise the valuse of “ServerLimit” and “MaxClients”, don’t raise too much the value of MaxClients, if your server ever gets attacked/ddos then it might hang if it runs out of memory, try and set it to under: 150 x RAM Memory (in GB).

3. Navigate to: Main >> Service Configuration >> Apache Configuration >> Memory Usage Restrictions
And click: “Proceed >>”

4. Navigate to: Main >> Service Configuration >> Apache Configuration >> Log Rotation
And check all files/logs, after click “Save”.

That’s it for now, stay tuned for more.

Viewing all 31 articles
Browse latest View live




Latest Images