Ip adreslerini dosyadan ayırmak
grep -Eo ‘([0-9]{1,3}\.){3}[0-9]{1,3}’ maillog | sort | uniq
grep -Eo ‘([0-9]{1,3}\.){3}[0-9]{1,3}’ maillog | sort | uniq
Aşağıdaki komutla birden fazla satır veri olan dosyanızı tek satır haline çevirebilirsiniz.
tr -d ‘\n’ < dosyaniz.txt
Cloudlinux sunucunuzda kurulu olan tüm php versiyonları için ortak tek dosyada bir kereliğine php ayarlarını değiştirebilirsiniz.Üstelik bu,güncellemelerden etkilenmeyecektir.Çünkü her paket güncellemesinde paket içersinndeki php.ini dosyası sizin dosyasınızın üzerine yazılmaktadır.
Bunu yapmak için öncelikle ssh login olup /etc/cl.selector/ dizinine geçin.
global_php.ini isimli dosyayı nano veya vi gibi bir editorle açın.
[Global PHP Settings] tagı altında tıpkı php.ini standart formatında olduğu gibi kendi direktiflerinizi yazın.Örneğin date.timezone veya disable_functions gibi.Altta sizin için bir örnek;
[Global PHP Settings]
disable_functions= proc_open,escapeshellcmd,escapeshellarg, show_source,
posix_mkfifo, ini_restore, mysql_list_dbs, get_current_user, getmyuid,pconnect, link, symlink, fin, exec, fileread, shell_exec, pcntl_exec, leak, apache_child_terminate, ch
own, posix_kill, posix_setpgid, posix_setsid, posix_setuid, proc_terminate, syslog, fpassthru, execute, shell, chgrp, stream_select, passthru, socket_select, socket_create,
socket_create_listen, socket_create_pair, socket_listen, socket_accept, socket_bind, socket_strerror, pcntl_fork, pcntl_signal, pcntl_waitpid, pcntl_wexitstatus, pcntl_wif
exited, pcntl_wifsignaled, pcntl_wifstopped, pcntl_wstopsig, pcntl_wtermsig, openlog, apache_get_modules, apache_get_version, apache_getenv, apache_note, apache_setenv, vir
tual, eval, allow_url_fopen, pconnect, p_connect,posix_getpwuid,fileowner,sym
Dosyanızı kaydedip editorden çıkın.Tekrar konsola geldiğinizde şu komutla işlemi onaylayın.
[root@srv ~]# selectorctl –apply-global-php-ini
Bunu dilerseniz herhangi bir web hosting altına yükleyebileceğiniz phpinfo ile yaptığınız değişiklikleri görebilirsiniz.
Son dönemde ortaya çıkan openssl ve zayıf şifreleme methodlarını kapatın.Özellikle bankalardan sanal pos talep etmeden önce sunucunuzda uygulamanızı tavsiye ederim.
Centos sunucular için
/etc/httpd/conf.d/ssl.conf dosyasının en altına aşağıdaki satırları yerleştirin.Httpd servisini yeniden başlatın.Nispeten güncellenmemiş sunucular için yum update yapmanızı öneriririm.
<IfModule mod_ssl.c>
SSLProtocol +TLSv1 +TLSv1.1 +TLSv1.2 -SSLv2 -SSLv3
</IfModule>
<IfModule mod_ssl.c>
#SSLCipherSuite HIGH:!aNULL:!MD5:!RC4-SHA:!RC4
#SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RS
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5::!RC4
</IfModule>
Linux tabanlı herhangi bir web sunucunuzda websitenize atak yapan saldırgan botları engellemek için aşağıdaki adımları uygulayın.
/etc/rc.local dosyanızı açın.İçine uygun bi yere şu satırları yerleştirin.
iptables -F
for x in $(cat /root/bad_bot.txt)
do
iptables -A INPUT -p tcp -s $x –dport 80 -j DROP
iptables -A INPUT -p tcp -s $x –dport 443 -j DROP
done
daha sonra kaydedip çıkın.bu sefer yukarıdaki döngüde satır satır okumasını istediğimiz dosyayı oluşturun
nano /root/bad_bot.txt
Son olarak /etc/rc.local olarak çağırdığınızda ve her sunucu açılışında bu ip adreslerinin web sunucu portlarınıza erişimi engellenecektir.
Redhat/Centos/Fedora:
sudo yum clean all
sudo yum -y install tzdata*2016g*
sudo zdump -c 2016,2017 -v “Europe/Istanbul”
sudo date
Debian ve türevleri:
sudo apt-get update
sudo apt-get install tzdata tzdata-java
sudo zdump -c 2016,2017 -v “Europe/Istanbul”
sudo date
Kaynak: http://www.musabyardim.com/linux-timezone-degisikligi/
Php 5.6 versiyonunda phpmailer tabanlı scriptleri çalışmaz hale geldi.Problem yaşayanlar için alttaki metin faydalı olabilir.
php 5.6 versiyonunda phpmailer scriptiniz çalışmaz çünkü;
phpmailer bu durum için 5.2.10 sürümünde bunun için bir istisna hazırlamış.alttaki linkte sertifika doğrulaması ile ilgili parametleri alt betikte iptal edebiliyorsunuz.
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#php-56-certificate-verification-failure
bu arada phpmailer sürümü eski olanlarda bu özellik olmayabilir ama zaten şu genel güvenkik açığı sebebiyle phpmailerinizi son sürüme güncellesiniz bence iyi olur.
Ayrıca durumunuza göre aşağıdaki smtpautotls ayarını da değiştirmeniz meseleyi çözüme kavuşturabilir.
https://phpmailer.github.io/PHPMailer/classes/PHPMailer.html#property_SMTPAutoTLS
Size çok tuhaf gelebilecek, pek yaygın olmayan, aslında bizim gibi farklı dil ve bölgesel ayarları kullanan ülkelerde çıkma olasılığı yüksek problemlerden biridir.
Bir linux hosting sunucunuza ftp bağlantısı yapılabilmesi için haliyle bir ftp sunucu kurarsınız ki bu genelde proftp veya pureftp olur.
Ftp servisi çalışmadığında yapacağınız ilk şey proftp hata loguna bakmak olur.Proftp paketiyle beraberinde gelen proftpd.conf dosyasının hemen hemen her satırı hata vermektedir.Satırları kapatıp başınızdan atabilirsiniz veya okumaya devam edip soruna kökten bir çözüm bulabilirsiniz.
Diğer yandan sunucunuzda her paket kurduğunuzda veya bir binary veya perl scripti çalıştırdığınızda ekran şuna benzer hatalar çıkmakta.Son zamanlarda peydahlanan bu hatayı görmezden gelmektesiniz.
perl: warning: Falling back to the standard locale (“C”).
locale: Cannot set LC_CTYPE to default locale: No such file or directory
perl: warning: Setting locale failed.
Locale sözünü gördüğünüzde sizi duyar gibiyim.Evet o problem.Yılların eskitemediği,bitti sandığınız ama asla bitmeyecek olan dil probleminin ta kendisi.Bitmedi.sanırım bitmeyecekte.
Bütün konu,bilgisayarın ilk zamanlarında oluşturulan standartlar,GNU C,POSIX ASCII ve utf8 karakter seti ,farklı diller,yerelleştirme ve hız ile ilgili.Merak eden nette okur araştırır.
Siz bunları merak etmiyorsanız kısaca çözüme geçin
/etc/xinetd.d/ftp_psa dosyasını açın.
ftp{} bölümünde şu satırları ekleyin.
“env = LC_ALL=C LANG=C”
Ardından xinetd servisini yeniden başlatın.Artık proftp ve tüm modülleriyle mutlu mesut yaşayabilirsiniz.
Php destekli bir apache web sunucunda kapatılması gerekli php fonksiyonları
mail,system, dl, array_compare, array_user_key_compare, passthru, cat, popen, proc_close, proc_get_status, proc_nice, proc_open,escapeshellcmd,escapeshellarg, show_source, posix_mkfifo, ini_restore, mysql_list_dbs, get_current_user, getmyuid,pconnect, link, symlink, fin, exec, fileread, shell_exec, pcntl_exec, leak, apache_child_terminate, chown, posix_kill, posix_setpgid, posix_setsid, posix_setuid, proc_terminate, syslog, fpassthru, execute, shell, chgrp, stream_select, passthru, socket_select, socket_create, socket_create_listen, socket_create_pair, socket_listen, socket_accept, socket_bind, socket_strerror, pcntl_fork, pcntl_signal, pcntl_waitpid, pcntl_wexitstatus, pcntl_wifexited, pcntl_wifsignaled, pcntl_wifstopped, pcntl_wstopsig, pcntl_wtermsig, openlog, apache_get_modules, apache_get_version, apache_getenv, apache_note, apache_setenv, virtual, eval, allow_url_fopen, pconnect, p_connect,posix_getpwuid,fileowner,symlink,readlink
This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.
OKLearn moreWe may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.
Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.
These cookies are strictly necessary to provide you with services available through our website and to use some of its features.
Because these cookies are strictly necessary to deliver the website, refuseing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.
We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.
We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.
We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.
Google Webfont Settings:
Google Map Settings:
Google reCaptcha Settings:
Vimeo and Youtube video embeds:
You can read about our cookies and privacy settings in detail on our Privacy Policy Page.
Gizlilik İlkeleri ve Kullanım Şartları