07
05
2019

Php 7 için php 5 mysql fonksiyonları eklemek

Kategorisi : Mysql,Php

cd ext/
git clone https://github.com/php/pecl-database-mysql mysql –recursive

phpize
./configure
make
make install

ile derledikten sonra, kullandığımız php.ini dosyasına aşağıdaki satırı ekliyoruz.

extension = /kurduğumuz klasör/mysql.so

apache servisini baştan başlatınca çalışıyor.

service apache2 restart


29
04
2019

How many files are in each directory under current directory

Kategorisi : Linux

for i in $(find . -maxdepth 1 -type d) ; do
echo -n $i”: ” ;
(find $i -type f | wc -l) ;
done


12
04
2019

Django projesini Apache Wsgi ile çalıştırmak

Kategorisi : Apache,Django

SETTINGS.PY AYARLARI

#in settings.py add static dir

STATIC_ROOT = os.path.join(BASE_DIR, ‘static’)

#collect static to dir

python3 manage.py collectstatic

————————————-

DEPENDENCIES KURULUM

sudo apt-get -y install apache2 libapache2-mod-wsgi-py3 python3-django
sudo a2enmod wsgi
sudo service apache2 restart
sudo a2dissite 000-default
sudo service apache2 restart

——————————————

VIRTUALHOST AYARI

<VirtualHost *:80>
ServerName mysite
WSGIDaemonProcess ubuntu user=ubuntu group=ubuntu threads=5 python-path=”/var/www/html/mysite/mysite”
WSGIScriptAlias / /var/www/html/mysite/mysite/wsgi.py
Alias /static/ /var/www/html/mysite/static/
<Directory /var/www/html/mysite/static>
Require all granted
</Directory>

<Directory /var/www/html/mysite/mysite/>
WSGIProcessGroup ubuntu
WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading On
Require all granted
</Directory>
</VirtualHost>

——————————————

WSGI.PY AYARLARI

import os,sys
sys.path.append(‘/var/www/html’)
sys.path.append(‘/var/www/html/mysite’)

os.environ.setdefault(“DJANGO_SETTINGS_MODULE”, “mysite.settings”)

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()


03
09
2018

PHPMailer: SMTP Error: Could not connect to SMTP host

Kategorisi : Php

Self signed sertifika varsa; bu parametreyi ekleyin.

$phpmailer->SMTPOptions = array(
‘ssl’ => array(
‘verify_peer’ => false,
‘verify_peer_name’ => false,
‘allow_self_signed’ => true
)
);


07
06
2018

Empty all files of a directory

Kategorisi : Linux

Bir linux klasöründeki tüm dosyaların içini boşaltmak için :

find . -type f -exec sh -c ‘> {}’ \;


06
02
2018

Monit: Monitor BIND 9 (named) Name Server and Auto Restart

Kategorisi : Debian,Linux

apt-get install monit -y

vi /etc/monit/monitrc

## bind
check process named with pidfile /var/lib/named/var/run/bind/run/named.pid
 start program = "/etc/init.d/bind9 start"
 stop program = "/etc/init.d/bind9 stop"
 if failed host 127.0.0.1 port 53 type tcp protocol dns then restart
 if failed host 127.0.0.1 port 53 type udp protocol dns then restart
 if 5 restarts within 5 cycles then timeout

23
11
2017

Automatically restart MySQL

Kategorisi : Mysql

#!/bin/bash
PATH=/usr/sbin:/usr/bin:/sbin:/bin
if [[ ! “$(/usr/sbin/service mysql status)” =~ “start/running” ]]
then
echo ” The MySQL service on the server has been stopped. It has now been restarted.” | mail -s ” MySQL has been restarted” 111@111.com
sudo service mysql start
fi


27
09
2017

sql.gz dosyasını açmadan import etmek – konsol

Kategorisi : Mysql

gunzip < sql.gz | mysql -u  -p –default-character-set=utf8 dbname


29
06
2017

Plesk mailbox truncate

Kategorisi : Linux,Plesk
find /var/qmail/mailnames/$DOMAIN/$MAILBOX/Maildir/new/ -type f -exec rm -rf {} \;

rm -rf /var/qmail/mailnames/$DOMAIN/$MAILBOX/Maildir/cur/

rm -rf /var/qmail/mailnames/$DOMAIN/$MAILBOX/Maildir/new/

16
06
2017

Text dosyasının içini boşaltmak – Linux

Kategorisi : Linux
> hello.txt


photo

Php, ajax, jquery, mootools web programlama. Linux, apache, lamp sunucu yönetimi. Cpanel, plesk, lxadmin panel kurulumlari.

25 / 06 / 2019, 20:11:57
Web yazilim, grafik
barbetto.com

Tunalioglu.org - 2015