Kategori arşivi: Debian

debian işletim sistemi hakkında bilgiler, debian yapılandırma örnekleri, debian güvenlik önlemleri ve performans iyileştirmeleri, güncel haberler

Hangi İşlemin Takas Alanını Kullandığını Öğrenmek

Bellek şişip uygulamanın takas alanına düşme durumları olabiliyor, bu gibi durumların tespiti ve takibi oldukça önemli, yapılandırma hatası veya performans sorunları olabilir.

for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less

Bu komutu swap kullanımı varken çalıştırıp hangi uygulamanın ne kadar takas alanı kullandığını rahatça görebilir buna göre düzeltme veya düzenleme işlem yapabilirsiniz.

Bu durumdan şikayetçiyseniz takas alanını sadece bellek kullanımı yükseldiğinde çalışması için ayarlayabilirsiniz, bu durumda sistemde kullanılacak boşta bellek olmadığında takas alanı kullanılır.

nano /etc/sysctl.conf
vm.swappiness=0
sysctl -p

Iptables Kullanarak DDoS Filtreleme Nasıl Yapılır?

Iptables üzerinde özellikle DDoS filtreleme ve kendi anti-DDoS kurallarınızı oluşturmanız için kullanabileceğiniz yöntemlerdir, saldırılar daha komplike ve farklı yöntemler ile geliyor ise çözüm olmayacağını unutmayınız. Konu ile ilgili profesyonel destek almaktan çekinmeyiniz.

Bu makalede TCP tabanlı saldırılara karşı kurallar yazacağız ve kötü amaçlı trafiğin büyük bir kısmını süzeceğiz. Ancak tamamen sorunlarınıza çözüm olmasını lütfen beklemeyiniz.

Geçersiz paketlerin engellenmesi

iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP

SYN‘siz gelen yeni TCP bağlantılarının engellenmesi

iptables -t mangle -A PREROUTING -p tcp ! --syn -m conntrack --ctstate NEW -j DROP

MSS değeri şüpheli olan TCP paketlerinin engellenmesi

iptables -t mangle -A PREROUTING -p tcp -m conntrack --ctstate NEW -m tcpmss ! --mss 536:65535 -j DROP

Sahte TCP bağlantılarının engellenmesi

iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,SYN FIN,SYN -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,RST FIN,RST -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,ACK FIN -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ACK,URG URG -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ACK,FIN FIN -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ACK,PSH PSH -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL ALL -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL NONE -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL FIN,PSH,URG -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL SYN,FIN,PSH,URG -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP

Sahte paketlerin engellenmesi(BOGUS gelen)

iptables -t mangle -A PREROUTING -s 224.0.0.0/3 -j DROP
iptables -t mangle -A PREROUTING -s 169.254.0.0/16 -j DROP
iptables -t mangle -A PREROUTING -s 172.16.0.0/12 -j DROP
iptables -t mangle -A PREROUTING -s 192.0.2.0/24 -j DROP
iptables -t mangle -A PREROUTING -s 192.168.0.0/16 -j DROP
iptables -t mangle -A PREROUTING -s 10.0.0.0/8 -j DROP
iptables -t mangle -A PREROUTING -s 0.0.0.0/8 -j DROP
iptables -t mangle -A PREROUTING -s 240.0.0.0/5 -j DROP
iptables -t mangle -A PREROUTING -s 127.0.0.0/8 ! -i lo -j DROP

DDoS saldırılarından daha az etkilenmenizi sağlayacak kernel parametrelerinin sisteme tanımlanması

Bu işlemi yaparken /etc/sysctl.conf içerisine aşağıdaki eklemeleri gerçekleştirin.

#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#

#kernel.domainname = mertcangokgoz.com
# Uncomment the following to stop low-level messages on console
kernel.printk= 4 4 1 7
kernel.yama.ptrace_scope= 1 2 3
kernel.kptr_restrict=2
kernel.core_uses_pid=1
kernel.panic=10 
kernel.sysrq=0 
kernel.shmmax=4294967296 
kernel.shmall=4194304

vm.max_map_count=1048576
vm.min_free_kbytes=65535
vm.overcommit_memory=1
vm.dirty_ratio=80 
vm.dirty_background_ratio=5 
vm.swappiness=0

fs.file-max=1048576
fs.nr_open=1048576
net.core.somaxconn=65535

net.core.rmem_default = 1048576
net.core.rmem_max = 16777216
net.core.wmem_default = 1048576
net.core.wmem_max = 16777216
net.core.optmem_max = 65536
net.ipv4.tcp_rmem = 4096 1048576 2097152
net.ipv4.tcp_wmem = 4096 65536 16777216

net.ipv4.tcp_timestamps=1 
net.ipv4.conf.all.rp_filter=1
net.ipv4.tcp_syncookies=1
net.ipv4.tcp_sack=1 
net.ipv4.tcp_fack=1 
net.ipv4.tcp_ecn=2 
net.ipv4.tcp_tw_recycle=0 
net.ipv4.tcp_tw_reuse=1 

net.core.netdev_max_backlog = 100000
net.core.netdev_budget = 50000
net.core.netdev_budget_usecs = 5000

net.ipv4.conf.default.rp_filter = 1

net.ipv4.tcp_rfc1337=1
net.ipv4.tcp_max_orphans=1048576
net.ipv4.tcp_max_syn_backlog=20480
net.ipv4.tcp_max_tw_buckets=400000
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_window_scaling=1

net.ipv4.tcp_synack_retries=2
net.ipv4.tcp_syn_retries=2
net.ipv4.tcp_fastopen=3
net.ipv4.tcp_fin_timeout=10
net.ipv4.tcp_slow_start_after_idle=0

net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
net.ipv4.tcp_notsent_lowat=16384

net.ipv4.udp_rmem_min=8192
net.ipv4.udp_wmem_min=8192

net.ipv4.tcp_keepalive_time=60
net.ipv4.tcp_keepalive_intvl=10
net.ipv4.tcp_keepalive_probes=6

net.ipv4.ip_no_pmtu_disc=1 
net.ipv4.route.flush=1 
net.ipv4.tcp_mtu_probing=1
net.ipv4.conf.default.log_martians=1
net.ipv4.conf.all.log_martians=1

net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv6.conf.default.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0

net.ipv4.icmp_ignore_bogus_error_responses=1
net.ipv4.icmp_echo_ignore_broadcasts=1

Kaynak IP adresi bağışına bağlantıları 10 ile limitleme

iptables -A INPUT -p tcp -m connlimit --connlimit-above 10 -j REJECT --reject-with tcp-reset  

Saniye bazında TCP bağlantılarını sınırlamak

iptables -A INPUT -p tcp -m conntrack --ctstate NEW -m limit --limit 120/s --limit-burst 30 -j ACCEPT 
iptables -A INPUT -p tcp -m conntrack --ctstate NEW -j DROP

Port taraması tespiti ve engellenmesi

iptables -N PORTSCANNING
iptables -A PORTSCANNING -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s --limit-burst 2 -j RETURN 
iptables -A PORTSCANNING -j DROP

Logların aktif edilmesi

iptables -A INPUT -j LOG --log-prefix "PORT DENIED: " --log-level 5 --log-ip-options --log-tcp-options --log-tcp-sequence

Bunlar dışında kullanabileceğiniz Iptables’da Örnekler ve Kalıcı Kurallarını inceleyiniz. Ayrıca saldırı anında Anti-DDOS betiğinden faydalanabilirsiniz.

Bunlar dışında kullanmak isterseniz NGINX üzerinde Lua Anti-DDoS modülünden faydalanabilirsiniz.

Configure OpenSSH to Tunnel Through Another Server Using Jump Host

Within your local ssh configuration file which is stored in .ssh/config create a SSH host entry for the server you are going to tunnel through.

Host                    ssh-proxy
HostName                proxy.mertcangokgoz.com

The host ssh-proxy server node will need the netcat package installed which
provides the nc binary.

apt install netcat

Now create another SSH host entry for the final destination server. In order
to SSH to this server, you have to SSH to the ssh-proxy node, create a
tunnel then SSH through that tunnel.

Host                    prod
HostName                ankara.mertcangokgoz.com
ProxyCommand            ssh -q -A ssh-proxy 'nc %h %p'

The important line in the final configuration item is the ProxyCommand

ProxyCommand specifies the command to use to connect to the server. %h is substituted for the hostname which is defined by the HostName directive. %p is substituted for the SSH destination port defaults to 22.

Now SSH indirectly to ankara.mertcangokgoz.com Use -v to see SSH bounce off the ssh-proxy server node.

ssh -v ankara.mertcangokgoz.com

If the bounce host, in this example being proxy.mertcangokgoz.com, was a SOCKS5 host and not a server running SSH we would use a different ProxyCommand directive.

Host                    web-server
HostName                ankara.mertcangokgoz.com
ProxyCommand            connect -R both -S proxy.mertcangokgoz.com:1080 %h %p 

The ProxyCommand above uses the connect binary which creates a connection
to a SOCKS4/5 proxy. Our SSH client will then tunnel over this SOCKS4/5 tunnel to the remote server.

Notes: Details have not been added for security reasons.

Iptables’da Örnekler ve Kalıcı Kurallar

Yeni bir web sunucusu kurduğunuzda ilk önemli olan düzgün bir şekilde yapılandırılmış güvenlik duvarıdır. Bu gibi konularda referans olması amacıyla aşağıdaki kuralları direk olarak kullanabilirsiniz.

iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -m multiport --dports 80,443,123,52176 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -s 94.55.146.xxx --dport 22 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -s 94.55.146.xxx --dport 3306 -j ACCEPT
iptables -A INPUT -i eth0 -m conntrack -j ACCEPT  --ctstate RELATED,ESTABLISHED
iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -j LOG --log-prefix "PORT DENIED: " --log-level 5 --log-ip-options --log-tcp-options --log-tcp-sequence
iptables -A INPUT -j DROP

# Dışa bağlantıyı açalım.
iptables -A OUTPUT -o lo -j ACCEPT
iptables -I OUTPUT -o eth0 -d 0.0.0.0/0 -j ACCEPT
iptables -A OUTPUT -j DROP

Iptables Bütün Kuralları Kaldırma

Bir yanlışlık olur ve sunucuya artık bağlantı sağlayamazsanız.

# Flush All
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -F
iptables -t mangle -F
iptables -F
iptables -X

Kullanarak bütün kuralları kaldırabilirsiniz.

Kuralları Kalıcı Hale Getirme

apt install iptables-persistent

Ardından aşağıdaki komutlar verilmesi yeterlidir.

# Save All
iptables-save > /etc/iptables/rules.v4
ip6tables-save > /etc/iptables/rules.v6

UFW Eski Chainlerin Kaldırılması

UFW uygulamasını silip iptables kullanmak istediğinizde ufw’ye ait kural zinciri kalıyor, aşağıdaki komutlar aracılığı ile kalan bu artıklardan kalıcı olarak kurtulabilirsiniz.

for i in `iptables -L INPUT --line-numbers |grep '[0-9].*ufw' | cut -f 1 -d ' ' | sort -r `; do iptables -D INPUT $i ; done
for i in `iptables -L FORWARD --line-numbers |grep '[0-9].*ufw' | cut -f 1 -d ' ' | sort -r `; do iptables -D FORWARD $i ; done
for i in `iptables -L OUTPUT --line-numbers |grep '[0-9].*ufw' | cut -f 1 -d ' ' | sort -r `; do iptables -D OUTPUT $i ; done
for i in `iptables -L | grep 'Chain .*ufw' | cut -d ' ' -f 2`; do iptables -X $i ; done

Configure Dnsmasq To Query Different Nameservers For Different Domains

When connecting to a VPN you may have a DNS server which serves for a particular domain. For example when connected to your companies VPN, your local DNS config in /etc/resolv.conf is updated with: nameserver 192.168.1.1

The DNS server 192.168.1.1 is your companies internal DNS server which resolves admin.example.org to 192.168.1.100 You need to access admin.example.org on 192.168.1.100 but don’t necessarily want to have all DNS queries go to 192.168.1.1 You also don’t want manage /etc/hosts entries which can become stale over time.

dnsmasq a lightweight DNS and DHCP service can help. Simply install dnsmasq, starting off with a simple config.

listen-address=127.0.0.1
bind-interfaces
conf-dir=/etc/dnsmasq.d/

Create /etc/dnsmasq.d/example.org.conf

address=/vpn.example.org/198.51.100.100
server=/example.org/192.168.1.1
  • line one returns 198.51.100.100 for the host vpn.example.org
  • line two specifies 192.168.1.1 as the upstream DNS server for all other example.org queries such as admin.example.org

Reload the dnsmasq service.

systemctl restart dnsmasq

And finally update /etc/resolv.conf

nameserver 127.0.0.1

Now your local resolver clients will use dnsmasq as a DNS server with dnsmasq only forwarding queries for example.org to the upstream DNS server 192.168.1.1

Yeni kullanıcılar İçin Varsayılan Kullanıcı Kimliği (UID) Değerlerini Düzenleme

Debian’da, /etc/login.defs dosyasında ayarlayacağınız 2 değere göre sistem kullanıcılarına atanacak UID değerlerini kısıtlayabilirsiniz. Bu ayarladığınız sayıya görede UID atamaları değişir.

# Super User
SUB_UID_MIN                60000
SYS_UID_MAX                70000

# Normal User
UID_MIN                500
UID_MAX                60000

Yeni sistem kullanıcılarına atayacağı en düşük değeri değiştirmek için UID_MIN değerini değiştirin. UID_MAX değerinin değiştirilmesi de ayrıca verilecek maximum değeri belirler.

Asterisk ile TCP üzerinden SIP Kullanma

SIP genellikle UDP üzerinden çalışmaya ayarlıdır ve devamlı UDP kullanır, ancak kimi zaman bu durumu değiştirmemiz gerekir TCP kullanmak SIP için daha iyidir

/etc/asterisk/sip.conf Dosyası içerisinde aşağıdaki değişikliği gerçekleştiriyorsunuz.

[general]
tcpenable=yes
tcpbindaddr=0.0.0.0

Client yapılandırmasında transport ayarını da ayrıca transport=tcp olarak ayarlıyoruz ki bağlantı bu şekilde sağlansın.

[client100]
callerid="Client 100" <100>
username=client100
secret=password
type=friend
host=dynamic
context=internal
canreinvite=yes
mailbox=100@default
transport=tcp
disallow=all
allow=alaw
nat=route
dtmfmode=inband

SIP konsol aracılığı ile sip reload yeniden başlatmayı unutmayın. Ardından 5060 portu aracılığı ile TCP üzerinden bağlantı kurduğunu görebilirsiniz.

netstat -tlpn | grep 5060
tcp        0      0 0.0.0.0:5060            0.0.0.0:*               LISTEN      17414/asterisk  

Debian 10 Üzerine ConfigServer Security Firewall Nasıl Kurulur?

Genelde cPanel, Directpanel gibi sunucu yönetim araçları içerisinde yer alan firewall yönetimi için kullanılan bir eklentidir, iptables yönetimini basitleştirip işlevselleştirmesi ve yönetim arayüzü olmasıyla bilinir, ayrıca pek çok kendine has özelliği de bulunur.(Blacklist kontrolü ve özel listeler vs)

Unutmayın, yapacağınız yanlış bir yapılandırma sunucunuza erişimi kalıcı olarak kesecektir. Atacağınız adımları dikkatlice atınız.

Bağımlılıkların kurulması

apt-get install e2fsprogs dnsutils libwww-perl install libio-socket-ssl-perl libcrypt-ssleay-perl libnet-libidn-perl libio-socket-inet6-perl libsocket6-perl

ConfigServer dosyalarının indirilmesi ve kurulması

cd /opt/
wget http://download.configserver.com/csf.tgz
tar xzf csf.tgz
cd /opt/csf
sh install.sh

Her şey doğru bir şekilde çalıştığına emin olabilmemizi sağlayan perl /usr/local/csf/bin/csftest.pl test betiğini çalıştırıyoruz. Çıktısı aşağıdaki gibi olmalı

Testing ip_tables/iptable_filter...OK
Testing ipt_LOG...OK
Testing ipt_multiport/xt_multiport...OK
Testing ipt_REJECT...OK
Testing ipt_state/xt_state...OK
Testing ipt_limit/xt_limit...OK
Testing ipt_recent...OK
Testing xt_connlimit...OK
Testing ipt_owner/xt_owner...OK
Testing iptable_nat/ipt_REDIRECT...OK
Testing iptable_nat/ipt_DNAT...OK

RESULT: csf should function on this server

Yapılandırma dosyası içerisindeki bütün alarmların kapatılmasını şiddetle öneriyorum, yoksa durup dururken yaptığı her engelleme işleminde mail atacaktır.

sed -i 's/LF_EMAIL_ALERT = "1"/LF_EMAIL_ALERT = "0"/g' /etc/csf/csf.conf
sed -i 's/LF_PERMBLOCK_ALERT = "1"/LF_PERMBLOCK_ALERT = "0"/g' /etc/csf/csf.conf
sed -i 's/LF_NETBLOCK_ALERT = "1"/LF_NETBLOCK_ALERT = "0"/g' /etc/csf/csf.conf
sed -i 's/LF_DISTFTP_ALERT = "1"/LF_DISTFTP_ALERT = "0"/g' /etc/csf/csf.conf
sed -i 's/LF_DISTSMTP_ALERT = "1"/LF_DISTSMTP_ALERT = "0"/g' /etc/csf/csf.conf
sed -i 's/LT_EMAIL_ALERT = "1"/LT_EMAIL_ALERT = "0"/g' /etc/csf/csf.conf
sed -i 's/CT_EMAIL_ALERT = "1"/CT_EMAIL_ALERT = "0"/g' /etc/csf/csf.conf

Değişikliklerin geçerli olması amacıyla yeniden başlatma işlemini yapalım

systemctl restart csf 
systemctl restart lfd

Web Arayüzünün Aktif Edilmesi

Yönetim arayüzü ön tanımlı olarak kapalı gelmektedir, aktif etmek amacıyla aşağıdaki işlemleri gerçekleştirin.

nano /etc/csf/csf.conf

dosyasının içerisinde 1995. satırın hemen altında yer alan aşağıdaki ayarları kendinize göre değiştiriniz.

###############################################################################
# SECTION:Integrated User Interface
###############################################################################
# Integrated User Interface. This feature provides a HTML UI to csf and lfd,
# without requiring a control panel or web server. The UI runs as a sub process
# to the lfd daemon
#
# As it runs under the root account and successful login provides root access
# to the server, great care should be taken when configuring and using this
# feature. There are additional restrictions to enhance secure access to the UI
#
# See readme.txt for more information about using this feature BEFORE enabling
# it for security and access reasons
# 
# 1 to enable, 0 to disable
UI = "1"

# Set this to the port that want to bind this service to. You should configure
# this port to be >1023 and different from any other port already being used
#
# Do NOT enable access to this port in TCP_IN, instead only allow trusted IP's
# to the port using Advanced Allow Filters (see readme.txt)
UI_PORT = "7156"

# Optionally set the IP address to bind to. Normally this should be left blank
# to bind to all IP addresses on the server.
#
# If the server is configured for IPv6 but the IP to bind to is IPv4, then the
# IP address MUST use the IPv6 representation. For example 1.2.3.4 must use
# ::ffff:1.2.3.4
#
# Leave blank to bind to all IP addresses on the server
UI_IP = "::ffff:94.130.96.165"

# This should be a secure, hard to guess username
# 
# This must be changed from the default
UI_USER = "mertcan"

# This should be a secure, hard to guess password. That is, at least 8
# characters long with a mixture of upper and lowercase characters plus 
# numbers and non-alphanumeric characters
#
# This must be changed from the default
UI_PASS = "Str0n9_PasSw0rD"

Ardından giriş yapabilmek için IP adresinizi sisteme kayıt edin

sudo echo "<ip_address>" >> /etc/csf/ui/ui.allow

sudo systemctl restart lfd komutu ile yeniden başlatıp web arayüzüne giriş yapabilirsiniz.

configserver firewall web ui, csf firewall güvenlik duvarı, csf ön tanımlı web arayüz

Debian 10 Üzerine Discourse Nasıl Kurulur?

Discourse açık kaynak kodlu, Ruby ve Javascript dilleri ile yazılmış İnternet forumu yazılımı. GNU Genel Kamu Lisansı ile dağıtılan Discourse, Ruby on Rails ile Ember.js çatıları kullanılarak geliştirilmektedir.

Gerekli olan Rails Bağımlılıklarının kurulması işlemini aşağıdaki bash script aracılığı ile yapıyoruz.

cd ~ && wget https://git.io/RailsInstall -O RailsInstall.sh
chmod +x RailsInstall.sh
./RailsInstall.sh

Ardından en güncel repoyu sisteminize git vasıtası ile dahil ediyoruz.

git clone https://github.com/discourse/discourse.git ~/discourse

Veritabanı işlemleri için PostgreSQL üzerinde aşağıdaki işlemleri gerçekleştirmeyi ihmal etmiyoruz.

sudo -u postgres psql

CREATE DATABASE <db_name>;
CREATE USER <db_operator_name> WITH encrypted PASSWORD '<password>';
ALTER USER <db_operator_name> SET client_encoding TO 'utf8';
ALTER USER <db_operator_name> SET default_transaction_isolation TO 'read committed';
ALTER USER <db_operator_name> SET TimeZone TO 'Europe/Istanbul';
GRANT ALL PRIVILEGES ON DATABASE <db_name> TO <db_operator_name>;
REVOKE CONNECT ON DATABASE <db_name> FROM PUBLIC, <db_operator_name>;

Gereken diğer işlemler için PostgreSQL Üzerinde Kullanıcı, Veritabanı Oluşturma ve Yetkilendirme makalesine göz atmayı unutmayınız.

Nihayet her şey hazır olduğuna göre, kuruluma geçiş yapıyoruz.

cd ~/discourse
source ~/.bashrc
bundle install
bundle exec rake db:create 
bundle exec rake db:migrate
RAILS_ENV=prod bundle exec rake db:create db:migrate

Veritabanı oluşturup, migrate işlemi yaptıktan hemen sonra uygulama özelliklerini çalıştırmayı deniyoruz

bundle exec rake autospec

Sunucuyu başlatıyoruz.

bundle exec rails server

Başlattıktan sonra http://localhost:3000 portundan çalışmaya başlayacak, buna erişebilmek amacıyla NGINX üzerinde yapılandırmamızı yapıyoruz.

server {
        listen 80;
        server_name discourse.mertcangokgoz.com;
        return 301 https://discourse.mertcangokgoz.com$request_uri;
}
server {
        listen 443 ssl http2; 
        server_name discourse.mertcangokgoz.com;
        ssl_certificate /path/to/signed_cert_plus_intermediates;
        ssl_certificate_key /path/to/private_key;
        ssl_session_timeout 1d;
        ssl_session_cache shared:MozSSL:10m; 
        ssl_session_tickets off;

        ssl_protocols TLSv1.3;
        ssl_prefer_server_ciphers off;

        location / {
                proxy_pass      http://localhost:3000/;
                proxy_read_timeout      90;
        }
}

Bu kurulum yöntemi bir yana, direk olarak Docker aracılığı ile kurulumu gerçekleştirebilirsiniz.

sudo -s
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse

./discourse-setup komutu ile gerekli yapılandırmayı oluşturuyoruz. app.yml adında bir dosya oluşturacak bununla birlikte kurulum otomatik olarak başlar, bir değişiklik yapmak isterseniz tekrar aynı komutu vermeniz yeterlidir.


Kaynak:

PHP’ye PHPKoru Eklentisi Nasıl Kurulur?

Ücretsiz kullanabilen bir PHP eklentisi olan ve kaynak kodunu aynı ionCube Loader gibi şifreleyen bir yazılımdır, debian 10 üzerinde eklentiyi kurmak için ise aşağıdaki adımları yapmanız yeterlidir.

PHP 7.2 İçin PHPKoru Kurulumu

wget https://cdn.phpkoru.com/loaders/phpkoru_loader_v1.0.2_lin_7.2.so
cp phpkoru_loader_v1.0.2_lin_7.2.so /etc/php/7.2/fpm/extensions/PHPKoru/
bash -c 'echo "extension=/etc/php/7.2/fpm/extensions/PHPKoru/phpkoru_loader_v1.0.2_lin_7.2.so" > /etc/php/7.2/fpm/conf.d/30-phpkoru.ini'
systemctl restart php7.2-fpm.service

PHP 7.3 İçin PHPKoru Kurulumu

wget https://cdn.phpkoru.com/loaders/phpkoru_loader_v1.0.2_lin_7.3.so
cp phpkoru_loader_v1.0.2_lin_7.3.so /etc/php/7.3/fpm/extensions/PHPKoru/
bash -c 'echo "extension=/etc/php/7.3/fpm/extensions/PHPKoru/phpkoru_loader_v1.0.2_lin_7.3.so" > /etc/php/7.3/fpm/conf.d/30-phpkoru.ini'
systemctl restart php7.3-fpm.service

PHP 7.4 İçin PHPKoru Kurulumu

wget https://cdn.phpkoru.com/loaders/phpkoru_loader_v1.0.2_lin_7.4.so
cp phpkoru_loader_v1.0.2_lin_7.4.so /etc/php/7.4/fpm/extensions/PHPKoru/
bash -c 'echo "extension=/etc/php/7.4/fpm/extensions/PHPKoru/phpkoru_loader_v1.0.2_lin_7.4.so" > /etc/php/7.4/fpm/conf.d/30-phpkoru.ini'
systemctl restart php7.4-fpm.service