آموزش های عمومی

آموزش های عمومی سرور

حل مشکل Check SSH on non-standard port

سلام

برای اینکار کافی است در ssh تایپ شود

nano nano /etc/ssh/sshd_config

سپس پرت ۲۲ را به عدد دلخواه تغییر داد مثلا ۵۰۵۱

و بعد توسط ctr+x ذخیره کرد دکمه  y را زد تا تایید شود

حال باید sshd را ری استارت کرد

service sshd restart

یادتون نره که در فایروال پرت جدید را باز کنید

پایان

ادامه مطلب
محمد علی پور فتحکوهیحل مشکل Check SSH on non-standard port

حل مشکل Check MySQL LOAD DATA

برای رفع مشکل Check MySQL LOAD DATA disallows LOCAL

که خطای زیر را تولید میکند باید

ابتدا

nano /etc/my.cnf

پس در زیر [mysqld] کد زیر را قرار داد

local-infile=0

سپس مای اسکیوال ری استارت شود

service mysqld restart

ادامه مطلب
محمد علی پور فتحکوهیحل مشکل Check MySQL LOAD DATA

حل مشکل Check for DNS recursion restrictions

برای رفع خطای

    You have a local DNS server running but do not appear to have any recursion restrictions set. This is a security and performance risk and you should look at restricting recursive lookups to the local IP addresses only

فایل زیر را باز کنید

nano /etc/named.conf
و در داخل

options {
عبارت زیر را قرار دهید
allow-recursion { localnets; };
و نیم را ری استارت کنید
service named restart


ادامه مطلب
محمد علی پور فتحکوهیحل مشکل Check for DNS recursion restrictions

تمامی لاگ های Directadmin

DirectAdmin:
/var/log/directadmin/error.log
/var/log/directadmin/errortaskq.log
/var/log/directadmin/system.log
/var/log/directadmin/security.log
Apache:
/var/log/httpd/error_log
/var/log/httpd/access_log
/var/log/httpd/suexec_log
/var/log/httpd/fpexec_log
/var/log/httpd/domains/domain.com.error.log
/var/log/httpd/domains/domain.com.log
Proftpd:
/var/log/proftpd/access.log
/var/log/proftpd/auth.log
pop3/imap:
/var/log/maillog
/var/log/messages
Bind(named):
/var/log/messages
exim(smtp):
/var/log/exim/mainlog
/var/log/exim/paniclog
/var/log/exim/processlog
/var/log/exim/rejectlog
NOTEO: On FreeBSD there may be prefix “exim_”
MySQL:
 RedHat:
/var/lib/mysql/server.hostname.com.err
FreeBSD:
/usr/local/mysql/data/server.hostname.com.err
Cronlog:
/var/log/cron
ادامه مطلب
محمد علی پور فتحکوهیتمامی لاگ های Directadmin

نصب suphp در directadmin

سلام

برای این منظور باید حتما php توسط cgi کامپیال شود

cd /usr/local/directadmin/custombuild/
./build clean
./build update
./build set php5_cgi yes
./build set php5_cli no
./build all d
./build rewrite_confs

تقریبا تمام است

اما دقت کنید اگر خطای اینترنال دارید باید وب اپ های زیر را هم دوباره کاپایل کنید

./build roundcube
./build squirrelmail
./build phpmyadmin

دقت کنید که بعد از این کار هیچ پوشه و فایل شما نباید پرمیشن ۷۷۷ داشته باشد همه ی پوشه ها را ۷۵۵ و همه فایل را ۶۴۴ کنید

در غیر این صورت خطای ۵۰۰ internal server error خواهید داشت

ادامه مطلب
محمد علی پور فتحکوهینصب suphp در directadmin

نحوه نصب جاوا ۷ در لینوکس centos 6

برای اینکار مطابق دستور العمل زیر انجام بدید (دقت کنید که کدها به ترتیب در یک خط هستند و نباید بین آنها اینتر زده شود)

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" 
"http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.rpm"

 

حال دانلود جی دی کی ۷ دقت کنید که دستور زیر در یک خط است و برای جا شدن در صفحه در دو خط نوشته شده

 

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" 
"http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.rpm"

حال که اطلاعات دانلود شد با کد های زیر هر دو پکیج را نصب میکنیم

rpm -Uvh jdk-7u25-linux-x64.rpm

بعد کد زیر

rpm -Uvh jre-7u25-linux-x64.rpm

حال می توانید چک کنید که همه چیز موفق بوده است

java -version

و

 

javac -version

 

تمام نصب شد

 

ادامه مطلب
محمد علی پور فتحکوهینحوه نصب جاوا ۷ در لینوکس centos 6

رفع خطای IMAP needs to be compiled

برای برطرف کردن خطای IMAP needs to be compiled into PHP for this to function

مراحل زیر را در دایرکت ادمین طی کنید

۱)ابتدا پیش نیاز های زیر باید نصب شود

Debian:
apt-get install libc-client-dev

CentOS, fedora
yum install libc-client libc-client-devel

 CentOS 64-bit
yum install krb5-appl-clients.x86_64
yum install krb5-appl-servers.x86_64

۱) سپس باید محل فایل کانفیک php را پیدا کنیم

به مسیر زیر بروید و سپس خط بعدی را اجرا کنید

cd /usr/local/directadmin/custombuild/
./build used_configs

خروجی محل نصب تنظیمات php را نشان می دهد

Apache configuration file: /usr/local/directadmin/custombuild/configure/ap2/configure.apache
suPHP configuration file: /usr/local/directadmin/custombuild/configure/suphp/configure.suphp
PHP5 configuration file: /usr/local/directadmin/custombuild/configure/suphp/configure.php5
ProFTPD configuration file: /usr/local/directadmin/custombuild/configure/proftpd/configure.proftpd

مثلا اگر suphp  نصب باشد مسیر زیر خواهد بود

/usr/local/directadmin/custombuild/configure/suphp/configure.php5

حال آن را با ویرایشگر باز می کنیم ویرایشگر محبوب من nano است

nano  /usr/local/directadmin/custombuild/configure/suphp/configure.php5

در خط آخر آن عبارت زیر را اضافه کنید

--with-imap=/usr/lib/dovecot/imap \
--with-imap-ssl

دقت کنید که فقط اخرین خط نباید \ داشته باشد برای قبلی \ قرار دهید

حال باید php را دوباره بسازیم

./build php n

تمام

////////////////////////////////////

اگر روش بالا برای شما جواب نداد روش مهم زیر را طی کنید

This documentation deals with building php with imap support on directadmin servers:

Section 1:This installation documentation is based on RHEL or Centos based server.

Section 2: Installing manually on centos 6(64 bit) servers (deals with Cannot find imap library (libc-client.a) )

Section3 : Installation using automated script on CentOS and FreeBSD servers

You can try any section .For FreeBSD users you may need to use section 3.

SECTION 1:

This section deals with building PHP with imap support for CentOS+Directadmin server.

# yum install libc-client libc-client-devel

(C-client is a common API for accessing mailboxes. It is used internally by the popular PINE mail reader, the University of Washington’s IMAP server and PHP.)

# yum install krb5-devel krb5-libs

(Kerberos is a network authentication system. The krb5-devel package contains the header files and libraries needed for compiling Kerberos 5 programs and The krb5-libs package contains the shared libraries needed by Kerberos 5)

Now edit the file:

/usr/local/directadmin/custombuild/configure/ap2/configure.php5 and add the following two lines.

–with-imap \
–with-imap-ssl

With suphp installed add the following lines in /usr/local/directadmin/custombuild/configure/suphp/configure.php5 this with quotes :

“- With-imap-ssl \”
“- with-imap \”

Difference between following files:

/usr/local/directadmin/custombuild/configure/ap2/configure.php5 is used for PHP5-CLI (mod_php)
/usr/local/directadmin/custombuild/configure/suphp/configure.php5 is used for PHP5-CGI (mod_suphp)

Now build the php using the following

# ./build php 5

After compilation completes sucessfully.You may please check whether imap extension is enabled in php.You can check it by using command:

# php -m | grep imap
NOTE:If you are having 64 bit server make sure to enable a soft link as follows:

# ln -s /usr/lib64/libc-client.a /usr/lib/libc-client.a

SECTION 2:

configure: error: Cannot find imap library (libc-client.a). Please check your c-client installation.

If you centOS installation is 6 then you may get these errors:

I installed the libc-client and libc-client-devel packages, but unlike the CentOS 5.x libc-client-devel package, the same rpm in CentOS 6 does not have the libc-client.a static library.

How to overcome this issue:

problem: on centos, the libc-client package is compiled with a low “FD_SETSIZE” limit (I assume 256). when adding imap support to php, compiling against the default libc-client RPMs, this will cause Apache to segfault if Apache has over 256 open file descriptors. All active apache logs count against this limit so its easy to hit on a shared hosting server.
solution: download latest imap c-client and compile from scratch:

Download and extract

Code:

cd /usr/local/src/
wget http://files.directadmin.com/services/da_imap-2007e.tar.gz
tar xvf da_imap-2007e.tar.gz
cd imap-2007e
edit source files

edit src/osdep/unix/os_art.c and src/osdep/unix/os_sv2.c in an editor,

find this:

Code:
#define FD_SETSIZE 256
change it to:

Code:
#define FD_SETSIZE 32768

OR Replace using command:

/bin/sed -i ‘s/FD_SETSIZE\t256/FD_SETSIZE\t32768/’ src/osdep/unix/os_art.c

/bin/sed -i ‘s/FD_SETSIZE\t256/FD_SETSIZE\t32768/’ src/osdep/unix/os_sv2.c

Openssl symlink

you should already have openssl and openssl-dev packages installed, but no /usr/local/ssl directory. run:

Code:
ln -s /usr/lib64/openssl/engines/ /usr/local/ssl
ln -s /usr/include/ /usr/local/ssl/include

compile imap c-client

Code:

For 64-Bit system:

# make slx

For 32-Bit system

# make slx EXTRACFLAGS=-fPIC
Make directory lib and include put files as mentioned below:

Code:

mkdir /usr/local/php-imap
mkdir /usr/local/php-imap/lib
mkdir /usr/local/php-imap/include
cd /usr/local/php-imap/
cp /usr/local/src/imap-2007e/c-client/*.c lib/
cp /usr/local/src/imap-2007e/c-client/*.h include/
cp /usr/local/src/imap-2007e/c-client/c-client.a lib/libc-client.a

recompile php

Code:

cd /usr/local/directadmin/custombuild
if you don’t already have a custom configure.php;

Code:

mkdir -p custom/ap2
cp configure/ap2/configure.php5 custom/ap2
cp -rv configure/suphp custom/

add these lines to your custom/ap2/configure.php5 file and custom/suphp/configure.php5:

Code:
–with-imap=/usr/local/php-imap \
–with-imap-ssl \

now run

./build php n

Refer : http://www.directadmin.com/imap.txt

 

 SECTION 3:

USING AUTOMATIC SCRIPT FOR INSTALLING IMAP ON CentOS / FeeBSD Servers:

# cd /usr/local/src/
# wget http://thedirectadmin.com/files/imap-php.sh
# sh imap-php.sh

Run the script, then add the following lines to:

/usr/local/directadmin/custombuild/configure/ap2/configure.php5

Code:
–with-imap=/usr/local/php-imap \
–with-imap-ssl \

and

/usr/local/directadmin/custombuild/configure/suphp/configure.php5

code:
“- With-imap-ssl \”
“- with-imap=/usr/local/php-imap \”

And rebuild PHP.

./build php 5

ادامه مطلب
محمد علی پور فتحکوهیرفع خطای IMAP needs to be compiled