Tiadakan dirimu, maka Jatidirimu akan terungkap tanpa kata-kata.

Archive for the ‘Ubuntu’ Category

Install OpenLiteSpeed di Ubuntu 16.04 LTS MariaDB dan PHP WordPress

OpenLiteSpeed, is an open source web server developed by LiteSpeed Technology. It’s designed to be lightweight with a user friendly web interface to create and manage your websites easily… New webmasters who are managing their own websites should find this web server to be useful and convenient…

When it comes to WordPress, you’ll find countless tutorials on how to install it on Apache2 or Nginx or other web servers… this post shows you an alternative to those two web servers… You will learn how to install OpenLiteSpeed, MariaDB and PHP.. then shows you how to configure OpenLiteSpeed to make WordPress function.

This brief tutorial shows students and new users how to install WordPress on Ubuntu 16.04 LTS with OpenLiteSpeed, MariaDB and PHP support.

When you’re ready, continue with the steps below:

Step 1: Update The Ubuntu Server

Before installing OpenLiteSpeed and the other applications, please update Ubuntu server. To do that, run the commands below.

sudo apt update && sudo apt dist-upgrade && sudo apt autoremove

Step 2: Install OpenLiteSpeed Dependencies

After updating the server, install the packages below to install required dependencies for OpenLiteSpeed.

sudo apt install build-essential libexpat1-dev libgeoip-dev libpcre3-dev zlib1g-dev libssl-dev libxml2-dev rcs libpng-dev

Step 3: Download And Install OpenLiteSpeed

Now that all dependencies are installed, go and fetch the latest version of OpenLiteSpeed. The commands below will download version 1.4.27 to your server..

cd /tmp/ && wget http://open.litespeedtech.com/packages/openlitespeed-1.4.27.tgz

Next, run the commands below to extract the downloaded package.

tar -xvzf openlitespeed-1.4.27.tgz

Change into the directory extracted directory

cd openlitespeed-1.4.27/

Then run the commands below to install OpenLiteSpeed.

sudo ./configure
sudo make
sudo make install

After that OpenLiteSpeed should be installed and ready to use.

Step 4: Configure OpenLiteSpeed

Finally, configure the administrative password for the web interface. Run the commands below to do that.

sudo /usr/local/lsws/admin/misc/admpass.sh

Then create a web admin username and password.

Please specify the user name of administrator.
This is the user name required to login the administration Web interface.

User name [admin]: openlite

Please specify the administrator's password.
This is the password required to login the administration Web interface.

Password: new_password
Retype password: retype_password
Administrator's username/password is updated successfully!

After that, run the commands below to start the webserver.

sudo /etc/init.d/lsws start

Open your browser and browse to the server IP or hostname followed by 8088 to view the default page page.

http://192.168.1.2:8088

To access the admin backend portal, use the port 7078

https://192.168.1.2:7080

openlitespeed ubuntu

Step 5: Install MariaDB Server

To install MariaDB server run the commands below.

sudo apt-get install mariadb-server mariadb-client

After installing, the commands below can be used to stop, start and enable MariaDB service to always start up when the server boots.

sudo systemctl stop mysql.service
sudo systemctl start mysql.service
sudo systemctl enable mysql.service

After that, run the commands below to secure MariaDB server.

sudo mysql_secure_installation

When prompted, answer the questions below by following the guide.

  • Enter current password for root (enter for none): Just press the Enter
  • Set root password? [Y/n]: Y
  • New password: Enter password
  • Re-enter new password: Repeat password
  • Remove anonymous users? [Y/n]: Y
  • Disallow root login remotely? [Y/n]: Y
  • Remove test database and access to it? [Y/n]:  Y
  • Reload privilege tables now? [Y/n]:  Y

Restart MariaDB server

sudo systemctl restart mysql.service

Step 6: Create WordPress Database

WordPress needs a database… to create one, continue below..

Run the commands below to logon to the database server. When prompted for a password, type the root password you created above.

sudo mysql -u root -p

Then create a blank database called WP_database  you can use the same database name from the old server.

CREATE DATABASE WP_database;

Create a database user called wp_user with new password.  You can use the same username and password from the old server.

CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'type_password_here';

Then grant the user full access to the database.

GRANT ALL ON WP_database.* TO 'wp_user'@'localhost' IDENTIFIED BY 'type_user_password_here' WITH GRANT OPTION;

Finally, save your changes and exit.

FLUSH PRIVILEGES;
EXIT;

Step 7: Install WordPress

Now that OpenLiteSpeed is up, go and download WordPress content. To do that, run the commands below… you will download, extract and copy WordPress content to OpenLiteSpeed default document root.. The default Virtual Host Root is at /usr/local/lsws/Example.

cd /tmp && wget https://wordpress.org/latest.tar.gz
tar -zxvf latest.tar.gz
sudo mv wordpress /usr/local/lsws/Example/wordpress

Then run the commands below to set the correct permissions for WordPress root directory.

sudo chown -R nobody:nogroup /usr/local/lsws/Example/wordpress/
sudo chmod -R 755 /usr/local/lsws/Example/wordpress/

STEP 8: CONFIGURE WORDPRESS

Next, run the commands below to create WordPress wp-config.php file. This is the default configuration file for WordPress.

sudo mv /usr/local/lsws/Example/wordpress/wp-config-sample.php /usr/local/lsws/Example/wordpress/wp-config.php

Then run the commands below to open WordPress configuration file.

sudo nano /usr/local/lsws/Example/wordpress/wp-config.php

Enter the highlighted text below that you created for your database and save.

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'WP_database');

/** MySQL database username */
define('DB_USER', 'wp_user');

/** MySQL database password */
define('DB_PASSWORD', 'new_password_here');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

Save the file and you’re done.

After that, open your browser and browse to OpenLiteSpeed backend portal..

http://example.com:7080

Then go to Virtual Hosts on the left menu to bring up the virtualhost settings page.. then click the view button to view its settings..

When the settings page opens, click the General tab and edit the Document Root location.. we’ll want to change this to our WordPress folder.

openlite wordpress ubuntu

On the same General tab, edit the Index File section and add index.php to the list as shown below.

openlitespeed wordpress ubuntu

Next, select the Rewrite tab and turn on Rewrite Control

wordpress ubuntu openlitespeed

Next edit the Rweire Rules and replace the code with the one below, then save..

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

 

openlistspeed

Save and continue.

Finally, click on the Listeners from the left menu, then edit to change the current port from 8088 to 80. Save after that.

openlitespeed wordpress

Go to the Dashboard and restart the server from the top right corner

After restarting, open your browser and browse to the server hostname or IP address and you should see WordPress setup wizard.

http://example.com

ubuntu wordpress lets encrypt

Continue with the wizard until you’ve successfully configure WordPress.

Enjoy!

Sumber = https://websiteforstudents.com/install-openlitespeed-on-ubuntu-16-04-lts-with-mariadb-and-php-support/

Yang Perlu Dilakukan Setelah Memasang Server Ubuntu

Pendahuluan

Saat pertama memasang server Ubuntu 16.04, ada beberapa konfigurasi yang mesti dilakukan di awal. Langkah-langkah ini akan membantu meningkatkan keamanan dan kegunaan dari server kita sehingga memberikan dasar yang baik bagi kehidupan aplikasi yang akan dipasang di server tersebut.

Langkah Pertama — Root Login

Untuk masuk ke server yang telah dipasang, kita perlu tahu alamat IP publiknya. Kita juga perlu tahu password, atau jika memasang SSH key, maka kita juga perlu memiliki private key untuk user “root”.

To log into your server, you will need to know your server’s public IP address. You will also need the password or, if you installed an SSH key for authentication, the private key for the “root” user’s account.

Jika belum masuk, maka lakukanlah terlebih dahulu dengan user `root menggunakan perintah berikut ini:

ssh root@your_server_ip

Tentang Root

User root merupakan user administrator di lingkungan Linux dengan kemampuan tak terhingga. Karena kemampuannya yang tak ada batas dan dapat melakukan sesuatu yang amat berbahaya (meskipun tanpa sengaja), maka penggunaan user root tidak disarankan dikehidupan sehari-hari.

Langkah berikutnya ialah kita akan membuat akun user baru dengan kemampuan yang dibatasi untuk pekerjaan sehari-hari.

Langkah Kedua — Membuat User Baru

Setelah masuk sebagai user root, kita sekarang sudah siap untuk membuat akun user baru sebagai penggantinya. Contoh di bawah ini kita akan membuat user baru dengan akun “sammy”, namun kita perlu menggantinya dengan username yang disukai:

adduser sammy

Akan ada beberapa pertanyaan yang mesti di jawab dan dimulai dengan memasukkan password baru.

Berikan password yang kuat, dan isi informasi-informasi yang dianggap penting. Pertanyaan yang wajib diisi hanya password, sisanya dapat dilewati dengan menekan tombol ENTER bila diinginkan.

Langkah Ketiga — Root Privileges

Sekarang, kita telah memiliki akun user baru dengan hak biasa. Namun, terkadang kita masih perlu melakukan aksi yang hanya bisa dilakukan oleh administrator.

Daripada keluar dari akun user biasa lalu masuk lagi dengan akun root, kita akan menyiapkan sesuatu yang dikenal dengan istilah “superuser” atau hak root (alias root privileges) ke akun user biasa yang telah kita buat. Dengan demikian akun user biasa kita dapat menjalankan perintah-perintah root menggunakan kata kunci sudo.

Untuk menambah hak ini, kita perlu memasukkan akun tadi ke grup “sudo”. Di Ubuntu 16.04. apabila seorang user dimasukkan ke dalam grup “sudo” maka ia dapat melakukan perintah sudo.

Login dulu sebagai root, lalu jalankan perintah berikut untuk menambahkan akun user tadi ke grup “sudo”:

usermod -aG sudo sammy

Sekarang user baru yang sudah kita buat dapat menjalankan perintah-perintah administrator.

Langkah Keempat — Menambahkan Public Key Authentication

Langkah berikutnya untuk mengamankan server Ubuntu baru ialah dengan menambahkan public key authentication untuk user tadi. Pengaturan ini akan meningkatkan keamanan server yang akan meminta private SSH tiap kali login.

Membuat sebuah Key Pair

Jika belum memiliki sebuah SSH key pair yang terdiri dari key publik dan private, maka kita perlu membuatnya terlebih dahulu. Jika sudah ada, lewati ke langkah berikutnya.

Untuk membuat key pair baru, masukkan perintah di bawah ini di komputer lokal dan bukan di server :

ssh-keygen

Bila user di komputer lokal bernama “localuser”, kita akan melihat hasil yang seperti ini:

ssh-keygen outputGenerating public/private rsa key pair.
Enter file in which to save the key (/Users/localuser/.ssh/id_rsa):

Tekan enter untuk menerima (atau masukkan nama baru untuk filenya).

Kemudian, kita akan diminta memasukkan sebuah passphrase, semacam password untuk mengamankan key tadi. Kita boleh tidak mengisi passphrase-nya (lebih baik jika diisi).

Catatan: Jika dikosongkan, kita tidak akan dimintai passphrase saat melakukan koneksi nantinya menggunakan private key. Lalu, jika diberikan passphrase, saat melakukan koneksi kita juga akan dimintai apa passphrase yang dimasukkan. Mengamankannya dengan passphrase akan lebih baik dibanding tidak. Akan tetapi keduanya masih tetap lebih baik dibanding melakukan otentikasi password biasa.

Perintah di atas akan membuat private key baru, id_rsa, dan sebuah public key, id_rsa.pub, di dalam direktori .ssh di direktori home user bernama localuser. Selalu ingat untuk tidak berbagi private key kepada orang-orang yang tidak seharusnya memiliki akses.

Salin Public Key

Setelah membuat sebuah SSH key pair, kita kemudian perlu membuat salinan public key ke server. Ada dua cara yang dapat dilakukan.

Opsi 1: Gunakan ssh-copy-id

Jika komputer kita memiliki skrip ssh-copy-id, kita bisa memakainya untuk memasang public key ke server.

Jalankah skrip ssh-copy-id dengan memberikan akun dan alamat IP dari server yang ingin dipasangkan:

ssh-copy-id sammy@your_server_ip

Setelah memberikan password yang diminta, public key kita akan ditambahkan ke file .ssh/authorized_keys. Private key yang satunya lagi sekarang bisa dipakai untuk masuk ke server.

Opsi 2: Memasang Key Secara Manual

Lakukan perintah berikut untuk membaca isi file id_rsa.pub:

cat ~/.ssh/id_rsa.pub

Perintah di atas akan mencetak public SSH key dengan hasil seperti berikut:

id_rsa.pub contentsssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBGTO0tsVejssuaYR5R3Y/i73SppJAhme1dH7W2c47d4gOqB4izP0+fRLfvbz/tnXFz4iOP/H6eCV05hqUhF+KYRxt9Y8tVMrpDZR2l75o6+xSbUOMu6xN+uVF0T9XzKcxmzTmnV7Na5up3QM3DoSRYX/EP3utr2+zAqpJIfKPLdA74w7g56oYWI9blpnpzxkEd3edVJOivUkpZ4JoenWManvIaSdMTJXMy3MtlQhva+j9CgguyVbUkdzK9KKEuah+pFZvaugtebsU+bllPTB0nlXGIJk98Ie9ZtxuY3nCKneB+KjKiXrAvXUPCI9mWkYS/1rggpFmu3HbXBnWSUdf localuser@machine.local

Salin dulu kode yang dihasilkan.

Jika masuk sebagai root, ganti dulu ke user biasa dengan perintah di bawah:

su - sammy

Sekarang kita seharusnya sudah ada di direktori home user sammy (atau user yang sudah dibuat).

Buat direktori baru bernama .ssh dan atur permission-nya menjadi:

mkdir ~/.ssh
chmod 700 ~/.ssh

Sekarang buat/buka sebuah file di direktori .ssh bernama authorized_keysdengan sebuah editor, misalnya nano:

nano ~/.ssh/authorized_keys

Tempelkan/paste kode public key yang tadi dihasilkan.

Tekan CTRL-x untuk keluar dari nano, lalu tekan tombol y untuk menyimpan perubahan. Tekan ENTER untuk konfirmasi.

Selanjutnya atur lagi permission authorized_keys dengan perintah berikut:

chmod 600 ~/.ssh/authorized_keys

Tulis perintah berikut untuk kembali menjadi root:

exit

Sekarang public key sudah terpasang dan kita sudah bisa terhubung ke server menggunakan SSH key sebagai user biasa.

Langkah Kelima — Disable Password Authentication

Karena user biasa sudah bisa masuk menggunakan SSH key, kita dapat meningkatkan keamanan server lebih lanjut dengan men-disable otentikasi password bawaan. Dengan demikian hanya orang-orang yang memiliki SSH key yang dapat masuk.

Catatan: Pastikan sudah bisa melakukan koneksi menggunakan SSH key. Jika tidak langkah selanjutnya akan membuat kita tidak dapat masuk ke server.

Langkah pertama, sebagai root atau user baru dengan perintah sudo , buka konfigurasi SSH daemon:

sudo nano /etc/ssh/sshd_config

Cari baris yang mengatur PasswordAuthentication, hapus tanda #, lalu tambahkan nilai “no” seperti pada contoh di bawah:

sshd_config — Disable password authentication

PasswordAuthentication no

Berikut adalah dua pengaturan lainnya yang penting bagi proses otentikasi menggunakan SSH key saja. Jika belum pernah mengubahnya, kita tidak perlu otak-atik dua baris ini:

sshd_config — Important defaults

PubkeyAuthentication yes
ChallengeResponseAuthentication no

Jika sudah selesai, simpan file dan tutup nano dengan cara yang sama dengan sebelumnya (CTRL-X, lalu Y, lalu ENTER).

Ketikkan perintah berikut untuk me-restart SSH daemon:

sudo systemctl reload sshd

Otentikasi menggunakan password sekarang telah di-disable. Sekarang kita hanya bisa masuk ke server menggunakan SSH key.

Langkah Keenam — Test Log In

Sekarang, sebelum keluar dari server, kita perlu menguji pengaturan yang telah dilakukan. Jangan keluar dulu sampai sudah bisa login lewat SSH.

Buka jendela terminal baru di komputer lokal, kemudian login ke server menggunakan akun user yang sudah kita buat. Untuk melakukannya, gunakan perintah berikut (ganti dengan username dan alamat IP yang dimiliki):

ssh sammy@your_server_ip

Jika pengaturan otentikasi menggunakan public key yang sudah dilakukan benar, maka kita akan masuk ke server. Jika tidak, maka kita akan diminta untuk memasukkan password user.

Catatan: Jika saat membuat key pair pembaca memasukkan sebuah passphrase, maka saat melakukan koneksi kita akan dimintai passphrase tadi. Jika dikosongkan, maka kita akan masuk ke server tanpa passphrase.

Jika berhasil masuk tanpa diminta password user sammy (atau user yang sudah dibuat sendiri), maka artinya proses tadi sudah berhasil.

Langkah Ketujuh — Mengatur Firewall

Server Ubuntu 16.04 dapat diatur dengan firewall UFW untuk memastikan bahwa hanya koneksi ke beberapa service yang diijinkan. Kita dapat mengatur sebuah firewall dasar menggunakan aplikasi ini.

Aplikasi-aplikasi lain nanti dapat ditambahkan profilenya ke UFW saat pemasangan. Profile ini akan mengijinkan UFW untuk mengatur aplikasi tadi berdasarkan nama. OpenSSH, sebuah service yang membuat kita dapat terhubung ke server sekarang, memiliki profile yang terdaftar di UFW. Kita dapat melihatnya dengan perintah:

sudo ufw app list
OutputAvailable applications:
  OpenSSH

Kita perlu memastikan firewall mengijinkan koneksi SSH sehingga kita dapat masuk ke server di koneksi berikutnya. Lakukan hal ini dengan perintah:

sudo ufw allow OpenSSH

Lalu kita dapat mengaktifkan firewall dengan perintah:

sudo ufw enable

Tekan “y” lalu ENTER untuk melanjutkan. Kita dapat melihat koneksi SSH masih diijinkan dengan memasukkan perintah:

sudo ufw status
OutputStatus: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)

Jika memasang dan mengatur service baru, kita mungkin perlu mengatur lagi konfigurasi firewall untuk mengijinkan traffic masuk.

Penutup

Sampai di sini, kita sudah memiliki fondasi dasar yang baik bagu server baru kita. Kita sudah dapat memasang software-software lain yang dibutuhkan.

 

Sumber = https://www.codepolitan.com/yang-perlu-dilakukan-setelah-memasang-server-ubuntu-1604-59e632bf00c74

Cara Mengamankan Apache Web Server dengan Let’s Encrypt di Ubuntu 16.04

Pendahuluan

Tutorial ini akan mengajak pembaca untuk mengatur sertifikat TLS/SSL dari Let’s Encrypt di server Ubuntu 16.04 yang menjalankan Apache sebagai server webnya. Kita juga akan membahas bagaimana mengotomasi proses perbaruan sertifikat.

Sertifikat SSL dipakai di dalam server web untuk mengenkripsi traffic antara server dan klien dengan memberikan tambahan lapisan keamanan bagi user yang mengakses aplikasi web kita. Let’s Encrypt memberikan cara mudah untuk mengambil dan memasang sertifikat terpercaya tanpa biaya.

Prasyarat

Untuk menyelesaikan tutorial ini kita akan membutuhkan:

Jika sudah siap untuk move on, login ke server dengan akun user biasa.

Langkah 1 — Pasang Klien Let’s Encrypt

Sertifikat Let’s Encrypt dapat diunduh lewat software klien yang berjalan di server kita. Klien resmi untuk Let’s Encrypt bernama Certbot dan sudah memiliki repositori Ubuntu sendiri dengan versi terbaru. Karena pengembangannya yang sangat aktif, maka kita dapat langsung memasang Certbot terbaru dari repositorinya sendiri daripada menggunakan repositori Ubuntu.

Pertama, tambahkan dulu repositorinya:

sudo add-apt-repository ppa:certbot/certbot

Tekan ENTER untuk menerima. Lalu, jalankan perintah di bawah:

sudo apt-get update

Terakhir, pasang Certbot dengan perintah:

sudo apt-get install python-certbot-apache

Software klien certbot Let’s Encrypt sekarang sudah siap dipakai.

Langkah 2 — Mempersiapkan Sertifikat SSL

Membuat sertifikat SSL untuk Apache menggunakan Certbot cukup mudah. Klien secara otomatis akan mengambil dan memasang sertifikal SSL baru yang valid untuk domain yang diberikan sebagai parameter saat menjalankannya.

Untuk menjalankan pemasangan interaktif dan mengambil sertifikat untuk satu domain, jalankan perintah certbot sebagai berikut, alamat example.com dapat diganti dengan domain sendiri:

sudo certbot --apache -d example.com

Jika ingin menggunakan satu sertifikat valid untuk beberapa domain atau subdomain, kita bisa menambahkannya setelah domain utama. Domain yang pertama yang diberikan akan menjadi base domain untuk membuat sertifikatnya. Oleh karena itu sangat direkomendasikan untuk menggunakan top-level domain sebagai parameter pertama baru diikuti oleh subdomain atau alias yang lain:

sudo certbot --apache -d example.com -d www.example.com

Di contoh ini, base domainnya adalah example.com.

Setelah dependensi terpasang, kita akan dimintai beberapa data yang diperlukan untuk pembuatan sertifikat. Kita akan dimintai alamat email untuk melakukan recovery key serta pemberitahuan dan kita juga dapat mengatur untuk mengaktifkan http dan https sekaligus atau memaksa semua request ke https. Cara paling aman ialah dengan menggunakan https saja, kecuali jika memang membutuhkan ada traffic yang hanya dilakukan dengan http.

dan jika anda ingin mengaktifkan SSL pada subdomain anda , anda bisa menjalankan script berikut ini :

Selanjutnya anda akan diminta memasukkan alamat email anda , seperti gambar dibawah ini :

Cara Install Let's Encrypt

Jika sudah selanjutnya anda diminta untuk Agree Term Of Service mereka , ketik A untuk melanjutkan , seperti gambar dibawah ini :

Let's Encrypt

Selanjutnya anda ditanyakan apakah anda ingin share alamat email anda ke Electronic Frontier Foundation , ketik N untuk menolak , ketik Y untuk melanjutka , seperti gambar dibawah ini :

Cara Install Let's Encrypt

Selanjutnya anda akan diminta pengaturan install SSL untuk virtual host anda , ketik No 1 Mengizinkan HTTP dan HTTPS mengakses Website , ketik No 2 untuk mengatur keseluruhan ke Secure (HTTPS), jika sudah maka SSL let’s Encrypt sudah selesai di setup ke Virtual Host anda , seperti gambar dibawah ini :

Cara Install Let's Encrypt

Untuk Virtual host yang lain anda bisa memasang dengan cara diatas , tetapi anda hanya diminta memasukkan pengaturan install SSL saja , karena informasi seperti memasukan email dan accept term of service sudah di awal dilakukan.

 

Setelah pemasangan selesai, kita dapat melihat sertifikat yang dibuat di etc/letsencrypt/live. Kita juga dapat melakukan verifikasi status sertifikat SSL melalui tautan berikut: (jangan lupa untuk mengganti example.com dengan basedomain):

https://www.ssllabs.com/ssltest/analyze.html?d=dicloud-vm.tk&latest

Seharusnya sekarang kita sudah bisa mengakses website dengan https.

Langkah 3 — Mengatur Perbaruan Otomatis

Sertifikat Let’s Encrypt hanya valid selama 90 hari. Pengguna disarankan untuk mengotomatiskan proses perbaruan sertifikatnya. Kita perlu menyiapkan perintah yang akan berjalan secara otomatis untuk memeriksa tanggal kadaluarsa sebuah sertifikat dan memperbaruinya.

Untuk menjalankan proses di atas kita akan menggunakan cron, service sistem standar untuk melakukan pekerjaan yang berulang. Kita akan memberitahu cron apa yang harus dilakukan dengan membuka dan mengubah isi file bernama crontab.

sudo crontab -e

Tambahkan baris berikut ke dalam crontab:

crontab

. . .
15 3 * * * /usr/bin/certbot renew --quiet

Bagian 15 3 * * * dari perintah di atas artinya “jalankan perintah ini setiap hari jam 3:15 pagi.

Perinath renew akan memberitahu Certbot untuk memeriksa semua sertifikat yang terpasang di sistem dan memperbarui setiap sertifikat yang akan kadaluarsa dalam 30 hari. Opsi quiet memberitahu Certbot untuk tidak menampilkan informasi apapun atau menunggu masukan pengguna.

Sistem cron akan menjalankan perintah ini setiap hari. Karena kita memasang sertifikat dengan menggunakan --apache, maka Apache juga akan direstart untuk menggunakan sertifkat yang baru.

=============

15 3 * * * /usr/bin/certbot renew –quiet
17 3 * * * /etc/init.d/apache2 restart

============================

Penutup

Di tutorial ini, kita telah belajar bagaimana memasang sertifikat SSL gratis dari Let’s Encrypt untuk mengamankan website yang menggunakan Apache. Kami sarankan pembaca untuk memeriksan blog resmi Let’s Encrypt untuk info terbaru serta membaca dokumentasi Certbot untuk detail lebih lengkap mengenai klien yang tadi kita gunakan.

 

Sumber = https://www.codepolitan.com/cara-mengamankan-apache-web-server-dengan-lets-encrypt-di-ubuntu-1604-59e6ec9237efe

Sumber = https://www.dicloud.id/tutorial/articles/panduan-cara-install-lets-encrypt-pada-virtual-host-di-ubuntu-16-04

Sumber = https://stackoverflow.com/questions/28498400/restart-apache-service-automatically-using-cron-12am-daily

Cara Menambah Keamanan PHP dengan SuPHP

Salah satu cara untuk menambah keamanan PHP adalah dengan menginstall suPHP. Kalau anda baru mendengar suPHP, maka disini saya akan sedikit menjelaskan serta memberikan cara instalasinya.

SuPHP adalah tool yang digunakan untuk memperkuat keamanan server kita, bagi yang menggunakan PHP tentunya. Dengan adanya suPHP ini maka setiap skrip PHP tidak dapat dijalankan tanpa perizinan dari pemiliknya. SuPHP ini terdiri dari modul Apache (mod_suphp) dan setuid root binary (suphp) yang digunakan oleh modul Apache untuk mengubah uid dari proses eksekusi PHP.

Menambah Keamanan PHP dengan SuPHP

Berikut adalah cara instalasi suPHP dengan menggunakan apt-get:

Instalasi

apt-get install libapache2-mod-suphp

Disable modul PHP

a2dismod php5

Me-restart Apache

/etc/init.d/apache2 restart

Testing SuPHP

1
2
3
<?php
system('id');
?>

Jika anda menggunakan direktori selain /var/www sebagai lokasi penyimpanan web anda, maka anda juga harus mengubah  /etc/suphp/suphp.conf sebagai berikut:

;Path all scripts have to be in
docroot=/var/www/ -> ubah ke tempat lokasi penyimpanan web anda. Semoga bermanfaat.

 

Sumber = https://azuharu.net/php/tutorial-install-suphp/

Meningkatkan Keamanan Apache Web Server Ubuntu

 

Meningkatkan Keamanan Apache Web Server Ubuntu

Apache adalah salah satu web server populer dan paling banyak digunakan didunia, dan mencakup hampir 40% server didunia. Jika anda adalah seorang webmaster atau administrator yang menggunakan apache server, penting untuk anda tahu bagaimana mengamankan Apache dan mencegah dari tindakan peretasan. Pada artikel ini saya akan mendeskripsikan beberapa tips dan triks sederhana yang dapat anda gunakan untuk mengamankan apache server anda.

Note: saya menggunakan ubuntu 14.04 LTS

Install dan update apache

Pertama, anda perlu untuk mengupdate dan meninstall apache ke dalam komputer anda. Untuk melakukan hal ini dapat mengikuti perintah berikut:
$ sudo apt-get update
$ sudo apt-get install apache2
Jika berhasil terinstall maka saat anda mengakses localhost ataupun alamat IP melalui browser akan tampak halaman Apache seperti yang tampak dibawah ini.
Meningkatkan Keamanan Apache Web Server Ubuntu

Hide apache version

Secara default, apache menampilkan versi dari apache server yang terinstall pada komputer dengan nama dari sistem operasi server yang anda gunakan.
Meningkatkan Keamanan Apache Web Server Ubuntu
Pada gambar diatas anda dapat melihat versi apache dan sistem operasi yang terinstall pada komputer server anda. Ini bisa menjadi masalah keamanan utama untuk web server anda. Untuk menyembunyikan informasi ini, anda perlu mengedit file konfigurasi utama Apache (“/etc/apache2/conf-enabled/security.conf”).
$ sudo nano /etc/apache2/conf-enabled/security.conf
ServerSignature Off
ServerTokens Prod
$ sudo service apache2 restart

Berikut hasil yang didapatkan, tampak berbeda dari gambar sebelumnya.

Meningkatkan Keamanan Apache Web Server Ubuntu

Menonaktifkan akses direktori dan symbolic links

Daftar direktori telah aktif dalam Apache server secara default. Daftar direktori menampilkan seluruh direktori dengan filenya yang ada di apache server. Jika ini diaktifkan, seorang attacker dapat dengan mudah melihat macam-macam file, menganalisanya dan mencuri informasi sensitif dari aplikasi yang digunakan. Anda dapat melihat contoh daftar direktori yang tertampil pada gambar dibawah.
Meningkatkan Keamanan Apache Web Server Ubuntu
Anda dapat menonaktifkannya dengan mengedit file konfigurasi apache.
$ sudo nano /etc/apache2/apache2.conf Options -FollowSymLinks AllowOverride None Require all granted
Note: kode diatas mengasumsikan kalau halaman web anda berasal dari folder “/var/www/html”. jika anda telah mengubah lokasi sesuai yang anda tentukan, ubah path direktori dalam kode diatas.
Baris Options -FollowSymLinks juga menonaktifkan symbolic links. Jika anda ingin untuk tetap mengaktifkan symbolic links, hapus tanda “-” didepan FollowSymLinks, sehingga menjadi Options FollowSymLinks.
Simpan dan restart apache server. Setelah itu coba kembali mengakses web server melalui browser, anda akan mendapatkan error seperti gambar dibawah.
Meningkatkan Keamanan Apache Web Server Ubuntu

Menonaktifkan modul yang tidak diperlukan

Apache terinstall dengan beberapa modul aktif yang tidak diperlukan untuk penggunaan normal. Sangat direkomendasikan untuk menonaktifkan modul-modul yang tidak perlukan itu. Anda dapat melihat daftar modul aktif yang digunakan pada server anda dengan perintah berikut:
$ sudo ls /etc/apache2/mods-enabled/
Meningkatkan Keamanan Apache Web Server Ubuntu
Untuk dapat menonaktifkan modul-modul tersebut menggunakan perintah berikut, contohnya:
$ sudo a2dismod autoindex status$ sudo /etc/init.d/apach2 restart

Memanfaatkan ModSecurity

Mod security adalah modul apache gratis yang digunakan untuk melindungi web server anda dari berbagai macam serangan seperti SQL injection, cross site scripting, session hijacking, brute force dan jenis exploit lainnya. Dengan ini anda juga dapat memonitor trafik dengan basis real-time.
Anda dapat menginstall mod security dengan perintah berikut:
$ sudo apt-get install libapache2-modsecurity
Untuk mengecek apakah mod_security modul sudah berjalan, gunakan perintah berikut:
$ sudo apachectl -M | grep –color security
Gambar yang tertampil dibawah mengindikasikan kalau modul sudah dimuat dalam apache.
Meningkatkan Keamanan Apache Web Server Ubuntu
Untuk mengaktifkan mod_security rules, anda perlu untuk mengubah nama dan mengedit file mod security yang direkomendasikan dan menyetel opsi SecRuleEngine menjadi On. Lakukan dengan perintah berikut.
$ sudo mv /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.conf
$ sudo nano /etc/modsecurity/modsecurity.conf
SecRuleEngine On
Simpan dan restart untuk melihat hasilnya.
Ada banyak security rules yang dimiliki ModSecurity (dikenal dengan Core Rule Set) yang berada pada direktori “/usr/share/modesecurity-crs”. Sekarang anda perlu untuk mengaktifkan rule-rule ini untuk dapat bekerja dengan apache. Lakukan dengan perintah berikut.
$ sudo nano /etc/apache2/mods-enabled/security2.conf
IncludeOptional /etc/modsecurity/*.conf
IncludeOptional “/usr/share/modsecurity-crs/*.conf”
IncludeOptional “/usr/share/modsecurity-crs/base_rules/*.conf
Simpan dan restart apache.

Menonaktifkan server side includes dan CGI execution

Disarankan untuk menonaktifkan server side includes dan CGI execution jika tidak diperlukan. Untuk melakukan hal ini anda perlu mengedit file konfigfurasi utama apache
$ sudo nano /etc/apache2/apache2.conf Options -FollowSymLinks -Includes -ExecCGI AllowOverride None Require all granted
Anda juga dapat melakukan hal ini untuk direktori tertentu, misalnya untuk menonaktifkan server side includes dan cgi file execution untuk direktori “/var/www/html/webdir1”.
Options -Includes -ExecCGI

Simpan dan restart apache.

Membatasi besaran request

Apache tidak memiliki batasan size dari HTTP request secara defaultnya. Ini akan membebaskan seorang attacker mengirim jumlah data yang besar. Apache memiliki beberapa intruksi yang memperbolehkan anda untuk mengatur request size. Ini akan dapan melindungi web server anda dari serangan DDoS.
Anda dapat memasang nilai dari 0 (unlimited) hingga 2147483647 (2GB) dalam konfigurasi utama apache. Misalnya membatasi request size untuk direktori “/var/www/html/webdir1” menjadi 200K.
$ sudo nano /etc/apache2/apache2.conf
LimitRequestBody 204800
Simpan dan restart apache.

Menolak akses diluar document root

Direkomendasikan untuk apache dapat diakses hanya dari direktori document root. Anda bisa mengamankan direktori root (/) dengan pengaturan berikut.
$ sudo nano /etc/apache2/apache2.conf Options None Order deny,allow Deny from all

Keterangan:
– Options None: Ini akan menonaktifkan semua opsi
– Order deny, allow: Urutan di mana membolehkan dan menolak perintah diterapkan.
– Deny from all: ini akan menolak sebuah request dari semua ke direktori root

 

Simpan dan restart apache.

Beberapa langkah diatas adalah merupakan konfigurasi yang sangat sederhana dalam penggunakan Apache Web Server. Masih banyak macam konfigurasi yang bisa digunakan tentunya sesuai dengan kebutuhan yang diinginkan. Selamat mencoba.
Sumber = https://billnode.blogspot.com/2016/03/meningkatkan-keamanan-apache-web-server.html

Cara Setting ModSecurity untuk keamanan web server di ubuntu 14.04

Introduction

ModSecurity is a free web application firewall (WAF) that works with Apache, Nginx and IIS. It supports a flexible rule engine to perform simple and complex operations and comes with a Core Rule Set (CRS) which has rules for SQL injection, cross site scripting, Trojans, bad user agents, session hijacking and a lot of other exploits. For Apache, it is loaded as an additional module which makes it easy to install and configure.

Prerequisites

To follow this tutorial, you will need:

  • A Ubuntu 14.04 or Debian 8 Droplet.
  • A standard user account with sudo privileges, which you can set up by following the initial server setup tutorial for Ubuntu 14.04 or Debian 8.
  • A LAMP stack, which you can install by following the tutorial for Ubuntu 14.04 or Debian 8.

Step 1 — Installing ModSecurity

In this step, we will install ModSecurity.

First, update the package index files.

  • sudo apt-get update

Then, install ModSecurity.

  • sudo apt-get install libapache2-mod-security2 -y

You can verify that the ModSecurity module was loaded using the following command.

  • sudo apachectl -M | grep –color security2

If the output reads security2_module (shared), this indicates that the module was loaded.

ModSecurity’s installation includes a recommended configuration file which has to be renamed.

  • sudo mv /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.conf

Finally, reload Apache.

  • sudo service apache2 reload

A new log file for ModSecurity will be created in the Apache logs directory at /var/log/apache2/modsec_audit.log.

Step 2 — Configuring ModSecurity

Out of the box, ModSecurity doesn’t do anything because it needs rules to work. In this step, we will first enable some configuration directives.

To find and replace the configuration directives in this step, we will be using sed, a stream editor. You can read the sed tutorial series to learn more about the tool.

Basic Directives to Enable

The default ModSecurity configuration file is set to DetectionOnly, which logs requests according to rule matches and does not block anything. This can be changed by editing the modsecurity.conf file and modifying the SecRuleEngine directive. If you are trying this out on a production server, change this directive only after testing all your rules.

  • sudo sed -i “s/SecRuleEngine DetectionOnly/SecRuleEngine On/” /etc/modsecurity/modsecurity.conf

The SecResponseBodyAccess directive configures whether response bodies are buffered (i.e. read by ModSecurity). This is only necessary if data leakage detection and protection are required. Therefore, leaving it on will use up Droplet resources and also increase the logfile size, so we will turn it off.

  • sudo sed -i “s/SecResponseBodyAccess On/SecResponseBodyAccess Off/” /etc/modsecurity/modsecurity.conf

Optional Directives to Modify

There are other directives you may want to customize by editing /etc/modsecurity/modsecurity.conf. The SecRequestBodyLimit and SecRequestBodyNoFilesLimit directives limit the maximum data that can be posted to your web application.

In particular, the SecRequestBodyLimit directive specifies the maximum POST data size. If anything larger is sent by a client the server will respond with a 413 Request Entity Too Large error. If your web application does not have any file uploads, this value can be left as it is. The pre-configured value specified in the configuration file is 13107200 bytes (12.5MB). If you want to change this value, look for the following line modsecurity.conf:

Optional `modsecurity.conf` directive change
SecRequestBodyLimit 13107200

Similarly, the SecRequestBodyNoFilesLimit limits the size of POST data minus file uploads. This value should be set as low as possible to reduce susceptibility to denial of service (DoS) attacks when someone is sending request bodies of very large sizes. The pre-configured value in the configuration file is 131072 bytes (128KB). If you want to change this value, look for the following line modsecurity.conf:

Optional `modsecurity.conf` directive change
SecRequestBodyNoFilesLimit 131072

A directive that affects server performance is SecRequestBodyInMemoryLimit. This directive is pretty much self-explanatory; it specifies how much of “request body” data (POSTed data) should be kept in the memory (RAM), anything more will be placed in the hard disk (just like swapping). Because Droplets use SSDs, this is not much of an issue. However, this can be changed if you have RAM to spare. The pre-configured value for this directive is 128KB. If you want to change this value, look for the following line modsecurity.conf:

Optional `modsecurity.conf` directive change
SecRequestBodyInMemoryLimit 131072

Step 3 — Testing an SQL Injection

Before configuring some rules, we will create a PHP script which is vulnerable to SQL injection to test ModSecurity’s protection.

Note: this is a basic PHP login script with no session handling or form sanitation. It is just used as an example to test the SQL injection and ModSecurity’s rules. It will be removed before the end of the tutorial.

First, access the MySQL prompt.

  • mysql -u root -p

Here, create a MySQL database called sample and connect to it.

  • create database sample;
  • connect sample;

Then create a table containing some credentials — the username sammy and the password password.

  • create table users(username VARCHAR(100),password VARCHAR(100));
  • insert into users values(‘sammy’,’password’);

Finally, exit the MySQL prompt.

  • quit;

Next, create the login script in Apache’s document root.

  • sudo nano /var/www/html/login.php

Paste the following PHP script into the file. Be sure to change the MySQL password in the script below to the one you set earlier so the script can connect to the database:

/var/www/html/login.php

<html>
<body>
<?php
    if(isset($_POST['login']))
    {
        $username = $_POST['username'];
        $password = $_POST['password'];
        $con = mysqli_connect('localhost','root','your_mysql_password','sample');
        $result = mysqli_query($con, "SELECT * FROM `users` WHERE username='$username' AND password='$password'");
        if(mysqli_num_rows($result) == 0)
            echo 'Invalid username or password';
        else
            echo '<h1>Logged in</h1><p>This is text that should only be displayed when logged in with valid credentials.</p>';
    }
    else
    {
?>
        <form action="" method="post">
            Username: <input type="text" name="username"/><br />
            Password: <input type="password" name="password"/><br />
            <input type="submit" name="login" value="Login"/>
        </form>
<?php
    }
?>
</body>
</html>

This script will display a login form. Open your browser and navigate to http://your_server_ip/login.php to see it. If you enter the correct pair of credentials, e.g. sammy in the Username field and password in the Password field, you will see the message This is text that only gets displayed when logged in with valid credentials. If you navigate back to the login screen and use incorrect credentials, you will see the message Invalid username or password.

The next job is to try an SQL injection to bypass the login page. Enter the following for the username field.

SQL injection username
' or true -- 

Note that there should be a space after -- for this injection to work. Leave the password field empty and hit the login button. The script shows the message meant for authenticated users! In the next step, we will prevent this.

Step 4 — Setting Up Rules

In this step, we will set up some ModSecurity rules.

Enabling the CRS

To make things easier, there are a lot of rules which are already installed along with ModSecurity. These are called the CRS (Core Rule Set) and are located in the /usr/share/modsecurity-crs directory. To load these rules, we need to configure Apache to read .conf files in these directories, so open the security2.conf file for editing.

sudo nano /etc/apache2/mods-enabled/security2.conf

Add the two following directives, highlighted in red, inside before the last line in the file (</IfModule>).

Updated security2.conf
        IncludeOptional /etc/modsecurity/*.conf
        IncludeOptional "/usr/share/modsecurity-crs/*.conf"
        IncludeOptional "/usr/share/modsecurity-crs/activated_rules/*.conf"
</IfModule>

Save and close the file.

Excluding Directories/Domains (Optional)

Sometimes it makes sense to exclude a particular directory or a domain name if it is running an application, like phpMyAdmin, as ModSecurity will block SQL queries. It is also better to exclude admin backends of CMS applications like WordPress. If you’re following this tutorial on a fresh server, you can skip this step.

To disable ModSecurity for a complete VirtualHost, place the following directives inside the <VirtualHost>[...]</VirtualHost> block in its virtual host file.

<IfModule security2_module>
    SecRuleEngine Off
</IfModule>

For omitting a particular directory (for example, /var/www/wp-admin):

<Directory "/var/www/wp-admin">
    <IfModule security2_module>
        SecRuleEngine Off
    </IfModule>
</Directory>

If you don’t want to completely disable ModSecurity in a directory, use the SecRuleRemoveById directive to remove a particular rule or rule chain by specifying its ID.

<LocationMatch "/wp-admin/update.php">
    <IfModule security2_module>
        SecRuleRemoveById 981173
    </IfModule>
</LocationMatch>

Activating the SQL Injection Rule

Next, we will activate the SQL injection rule file. The required rule files should be symlinked to activated_rules directory, which is similar to Apache’s mods-enabled directory. Change to the activated_rules directory.

  • cd /usr/share/modsecurity-crs/activated_rules/

Then create a symbolic link from the modsecurity_crs_41_sql_injection_attacks.conf file.

  • sudo ln -s ../base_rules/modsecurity_crs_41_sql_injection_attacks.conf .

Finally, reload Apache for the rules to take effect.

  • sudo service apache2 reload

Now open the login page we created earlier and try using the same SQL injection query on the username field. Because we changed the SecRuleEngine directive to On in step 2, a 403 Forbidden error is displayed. (If SecRuleEngine was left to the DetectionOnly option, the injection will be successful but the attempt would be logged in the modsec_audit.log file.)

Because this PHP login script is only meant to test ModSecurity, you should remove it now that the test is done.

  • sudo rm /var/www/html/login.php

Step 5 — Writing Your Own Rules

In this section, we’ll create a rule chain which blocks the request if certain words commonly associated with spam are entered in a HTML form.

First, we’ll create an example PHP script which gets the input from a text box and displays it back to the user. Open a file called form.php for editing.

  • sudo nano /var/www/html/form.php

Paste the following code:

/var/www/html/form.php
<html>
    <body>
        <?php
            if(isset($_POST['data']))
                echo $_POST['data'];
            else
            {
        ?>
                <form method="post" action="">
                        Enter something here:<textarea name="data"></textarea>
                        <input type="submit"/>
                </form>
        <?php
            }
        ?>
    </body>
</html>

Custom rules can be added to any of the configuration files or placed in ModSecurity directories. We’ll place our rules in a separate new file called modsecurity_custom_rules.conf.

sudo nano /etc/modsecurity/modsecurity_custom_rules.conf

Paste the following in this file. The two words we’re blocking are blockedword1 and blockedword2.

modsecurity_custom_rules.conf
SecRule REQUEST_FILENAME "form.php" "id:'400001',chain,deny,log,msg:'Spam detected'"
SecRule REQUEST_METHOD "POST" chain
SecRule REQUEST_BODY "@rx (?i:(blockedword1|blockedword2))"

The syntax for SecRule is SecRule VARIABLES OPERATOR [ACTIONS]. Here we used the chain action to match variables REQUEST_FILENAME with form.phpREQUEST_METHOD with POST, and REQUEST_BODY with the regular expression (@rx) string (blockedword1|blockedword2). The ?i: does a case insensitive match. On a successful match of all these three rules, the ACTION is to deny and log with the msg "Spam detected." The chain action simulates the logical AND to match all the three rules.

Save the file and reload Apache.

sudo service apache2 reload

Open http://your_server_ip/form.php in the browser. If enter text containing blockedword1 or blockedword2, you will see a 403 page.

Because this PHP form script is only meant to test ModSecurity, you should remove it now that the test is done.

  • sudo rm /var/www/html/form.php

Conclusion

In this tutorial, you have learned how to install and configure ModSecurity, and add custom rules. To learn more, you can check out the official ModSecurity documentation.

 

Sumber = https://www.digitalocean.com/community/tutorials/how-to-set-up-modsecurity-with-apache-on-ubuntu-14-04-and-debian-8

Setting SNMP Client di Linux Ubuntu

Setelah kemaren saya menuliskan tutorial instalasi salah satu network monitoring system atau aplikasi cacti, sekarang saya akan menuliskan langkah-langkah konfigurasi pada host yang akan di monitoring serta bagaimana caranya memasukkan host yang akan dimonitoring jaringannya ke dalam aplikasi cacti.

Perlu anda ketahui, aktifitas monitoring ini sebenarnya memanfaatkan komunikasi SNMP atau Simple Network Management Protocol. Mungkin lain kali akan saya bahas juga tenang cara kerja SNMP seperti yang saya maksud.

Untuk sistem operasi host yang akan dimonitoring, saya menggunakan Ubuntu Server, mungkin lain waktu saya juga akan menulis cara memonitoring host yang menggunakan sistem operasi windows.

Sebelum host tersebut bisa dimonitoring, maka host tersebut perlu diinstall beberapa aplikasi yaitu:

  • snmp
  • snmpd
  • snmp-mibs-downloader

melalui perintah:

 sudo apt-get install snmp snmpd snmp-mibs-downloader

setelah berhasil diinstall ketiganya, saya perlu melakukan beberapa konfigurasi, yang pertama adalah di file /etc/snmp/snmp.conf melalui perintah:

 sudo vim /etc/snmp/snmp.conf

saya cari bagian:

 mibs :

lalu ubah menjadi:

 #mibs :

simpan, lalu buka lagi konfigurasi berikutnya yang di lokasi /etc/smp/snmpd.conf melalui perintah:

 sudo vim /etc/snmp/snmpd.conf

kemudian cari bagian:

 agentAddress  udp:127.0.0.1:161

ubah menjadi:

 #agentAddress  udp:127.0.0.1:161

lalu cari selanjutnya bagian:

 #agentAddress udp:161,udp6:[::1]:161

ubah menjadi:

 agentAddress udp:161,udp6:[::1]:161

setelah itu pada bagian:

 #rocommunity public localhost
 rocommunity public  default    -V systemonly
 rocommunity6 public  default   -V systemonly 

menjadi:

 rocommunity server  localhost
 # rocommunity public  default    -V systemonly
 # rocommunity6 public  default   -V systemonly

dan terakhir pada bagian:

 #rocommunity secret  10.0.0.0/16

menjadi:

 rocommunity server  192.168.0.0/24

Keteranganalamat host yang akan saya monitoring memiliki alamat IP 192.168.0.249 dengan netmask 255.255.255.0.

Setelah berhasil diubah sesuai dengan konfigurasi di atas maka selanjutnya bisa anda save.

Kemudian langkah selanjutnya adalah saya akan restart layanan snmp dengan perintah:

 sudo service snmpd restart
setelah itu, saya mengetest apakah layanan snmp sudah berjalan dengan baik dengan menjalankan perintah:

 

 snmpwalk -v 2c -c server localhost system

jika layanan snmp berjalan dengan normal maka akan terlihat keluaran yang mirip seperti tampilan berikut:

 

jika anda mendapati keluaran seperti gambar di atas, anda telah berhasil melakukan konfigurasi host client untuk dimonitoring cacti. Langkah selanjutnya adalah konfgurasi di aplikasi cacti untuk memasukkan client tersebut untuk di monitoring.
Apa saja yang bisa di monitoring di aplikasi cacti? Setahu saya ada bermacam-macam salah satunya adalah trafik jaringan si klien, atau sumber daya si klien seperti kapasitas storage, penggunaan memory dan CPU dan lain-lain.
Sumber = https://www.newbienote.com/2017/11/tutorial-konfigurasi-cacti-client.html

Cara Setting Server NTP di Ubuntu

Assalamualaikum.wr.wb. Salam Sejahtera untuk anda semua. Okey pada kesempatan kali ini saya ingin mesharing lagi tentang Ubuntu Server 12. Jika, pada postingan sebelumnya saya sudah mensharing tentang Konfigurasi Router Ubuntu Server 12.04, tapi kali ini saya akan memposting tentang Konfigurasi NTP di Ubuntu Server 12.04. Okey kita langsung konfig aja .


Apa sih NTP? Network Time Protocol (NTP) adalah sebuah protokol untuk sinkronisasi jam-jam sistem komputer di atas paket-switching, variabel-latency jaringan data. NTP menggunakan UDP pada port 123 sebagai lapisan transport. Ini dirancang khusus untuk melawan efek variabel laten dengan menggunakan jitter buffer. NTP juga mengacu pada referensi implementasi software yang didistribusikan oleh Proyek Pelayanan Publik NTP. Okey langsung kita konfig aja bang.

1. Pertama pastikan Ubuntu Server anda terhubung ke internet.

ping google.com

 

2. Kemudian install ntp.

apt-get install ntp

 

3. Kemudian edit ntp.conf

nano /etc/ntp.conf

Edit server 0.Ubuntu.pol.ntp.org menjadi server 0.id.pool.ntp.org
Dan ganti networknya sesuai yang anda gunakan.

server 0.id.pool.ntp.org iburst
server 1.id.pool.ntp.org iburst
server 2.id.pool.ntp.org iburst
server 3.id.pool.ntp.org iburst
restrict 192.168.3.0 mask 255.255.255.0 nomodify notrap

4. Kemudian restart ntp servernya

/etc/ini.d/ntp restart

5. Kemudian install ntpdate

apt-get install ntpdate

 

6. Kemudian setting di client nya.

7. Kemudian ping dari client ke ip server nya.

ping 192.168.3.112

 

8. Untuk mengeceknya diclient nya silahkan ke Change date and time settings>Internet Time>Changes Setting>Masukkan ip address server anda> kemudian update.


Nantinya time and date client akan secara otomatis menyesuaikan dengan date anda time Server Ubuntu anda.

 

Sumber = http://danu-zard.blogspot.com/2015/09/konfigurasi-ntp-server-ubuntu-server.html

Daftar Repository Indonesia Ubuntu 17.04 Zesty Zapus

deb http://buaya.klas.or.id/ubuntu/ zesty main restricted
deb http://buaya.klas.or.id/ubuntu/ zesty-updates main restricted
deb http://buaya.klas.or.id/ubuntu/ zesty universe
deb http://buaya.klas.or.id/ubuntu/ zesty-updates universe
deb http://buaya.klas.or.id/ubuntu/ zesty multiverse
deb http://buaya.klas.or.id/ubuntu/ zesty-updates multiverse
deb http://buaya.klas.or.id/ubuntu/ zesty-backports main restricted universe multiverse
deb http://buaya.klas.or.id/ubuntu/ zesty-security main restricted
deb http://buaya.klas.or.id/ubuntu/ zesty-security universe
deb http://buaya.klas.or.id/ubuntu/ zesty-security multiverse

Sumber = https://www.anakinformatika.tk/2017/07/daftar-repository-indonesia-ubuntu-1704.html

Mengaktifkan Mode Rewrite di Apache2 Ubuntu 17.04

First, we need to activate mod_rewrite. It’s available but not enabled with a clean Apache 2 installation.

  • sudo a2enmod rewrite

This will activate the module or alert you that the module is already enabled. To put these changes into effect, restart Apache.

  • sudo systemctl restart apache2

mod_rewrite is now fully enabled. In the next step we will set up an .htaccess file that we’ll use to define rewrite rules for redirects.

Tambahkan juga ini di di atas text ini:

# Available loglevels: trace8, …, trace1, debug, info, notice, warn,

pada file :

/etc/apach2/site-available/nama file virtualisasi.conf

<== START ==>

<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory “/usr/lib/cgi-bin”>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

<== END ==>

Sumber = https://www.digitalocean.com/community/tutorials/how-to-rewrite-urls-with-mod_rewrite-for-apache-on-ubuntu-16-04