Postingan

Menampilkan postingan dari Februari, 2017

Setup FTP Server di Ubuntu dengan vsftpd dan xinetd

Pertama-tama install vfstpd dan xinetd
sudo apt install vsftpd
sudo apt install xinetd



Kemudian buat konfigurasi file di /etc/xinted.d/vsftpd
sudo nano /etc/xinetd.d/vsftpd

Isinya:
service ftp
{
        disable                 = no
        socket_type             = stream
        wait                    = no
        user                    = root
        server                  = /usr/sbin/vsftpd
        per_source              = 5
        instances               = 200
        no_access               = 10.1.1.10
        banner_fail             = /etc/vsftpd.busy
        log_on_success          += PID HOST DURATION
        log_on_failure          += HOST
}


Setelah selesai simpan. Tekan Ctrl+X untuk save and close.
Selanjutnya ubah konfigurasi di vsftpd.

sudo nano /etc/vsftpd.conf
edit:
listen=YES
menjadi:
listen=NO





Selanjutnya matikan service vfstpd yang sedang berjalan dan restart service xinetd
sudo service vsftpd stop
sudo service xinetd restart


Sumber: https://linuxconfig.org/how-to-setup-and-use-ftp-se…

Simple Linux Service

Buat file misalkan namanya coba. Buat di /etc/init.d/coba. Isinya:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          coba
# Required-Start:
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: daemon to balance interrupts for SMP systems
### END INIT INFO
# coba script
# January 2017
# Yudha Rachmat Hidayat

NAME=Coba
DESC="Python Bottle Daemon"
PIDFILE="/var/run/${NAME}.pid"
LOGFILE="/var/log/${NAME}.log"

# PHP binary path
DAEMON="/usr/bin/python"

# Path of your python script
DAEMON_OPTS="/usr/share/bottle/http.py"

START_OPTS="--start --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} ${DAEMON_OPTS}"
STOP_OPTS="--stop --pidfile ${PIDFILE}"

test -x $DAEMON || exit 0

set -e

case "$1" in
start)
echo -n "Starting ${DESC}: "
start-stop-daemon $START_OPTS >> $LOGFILE
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon $STOP_OPTS
echo &q…

Proxy pass pada location di nginx

location /gis/ { rewrite ^/gis(/.*)$ $1 break; proxy_pass http://127.0.0.1:8080/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect off; }

Apache Multiple Domain CORS

Tambah ini di VirtualHost:
<IfModule mod_headers.c>   SetEnvIfNoCase Origin "https?://(www\.)?(yudha\.web\.id|apabae\.com)(:\d+)?$" ACAO=$0   Header set Access-Control-Allow-Origin %{ACAO}e env=ACAO </IfModule>
Contoh:
<VirtualHost *:80>    ServerName api.yudha.id     DocumentRoot /var/www/html/api <IfModule mod_headers.c>       SetEnvIfNoCase Origin "https?://(www\.)?(yudha\.web\.id|apabae\.com)(:\d+)?$" ACAO=$0       Header set Access-Control-Allow-Origin %{ACAO}e env=ACAO   </IfModule></VirtualHost> Catatan:
Kadangkala module headers belum aktif, untuk mengaktifkan ketik di terminal:
a2enmod headers