Mengubah enp0s17 menjadi eth0 pada ubuntu 16.04

Pada ubuntu versi ini ketika kita ketik ifconfig maka yang keluar selain localhost atau lo juga enp0s17 dan bukan eth0, di artikel ini kita akan coba mengubah kembali ke yang lama dari enp0s17 ke eth0 supaya kita mudah seting karena sudah terbiasa.
[code]
root@localhost:~# ifconfig
enp0s17 Link encap:Ethernet HWaddr 08:00:27:f7:44:f1
inet addr:192.168.2.3 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3085 errors:0 dropped:0 overruns:0 frame:0
TX packets:2838 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3831133 (3.8 MB) TX bytes:226243 (226.2 KB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:11840 (11.8 KB) TX bytes:11840 (11.8 KB)

root@localhost:~#

root@localhost:~# dmesg | grep -i eth
[ 3.874367] e1000 0000:00:11.0 eth0: (PCI:33MHz:32-bit) 08:00:27:f7:44:f1
[ 3.875394] e1000 0000:00:11.0 eth0: Intel(R) PRO/1000 Network Connection
[ 3.883459] e1000 0000:00:11.0 enp0s17: renamed from eth0
root@localhost:~#
[/code]
kita bisa lihat bahwa eth0 diubah menjadi enp0s17 melalui perintah dmesg, selanjutnya kita akan mengubah menjadi ethX kembali dengan cara edit grub
[code]
root@localhost:~# nano /etc/default/grub
GNU nano 2.5.3 File: /etc/default/grub

# If you change this file, run ‘update-grub’ afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n ‘Simple configuration’

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=””
GRUB_CMDLINE_LINUX=””
[/code]

cari pada baris GRUB_CMDLINE_LINUX=”” yang kosong menjadi GRUB_CMDLINE_LINUX=”net.ifnames=0 biosdevname=0″
Selanjutnya kita simpan dan kita generate grub yang baru dari perubahan yang sudah kita lakukan.
[code]
root@localhost:~# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file …
Found linux image: /boot/vmlinuz-4.4.0-57-generic
Found initrd image: /boot/initrd.img-4.4.0-57-generic
Found linux image: /boot/vmlinuz-4.4.0-21-generic
Found initrd image: /boot/initrd.img-4.4.0-21-generic
done
root@localhost:~#
[/code]
Jika setingan jaringannya dhcp maka ubah seperti contoh berikut:
root@localhost:~# nano /etc/network/interfaces

Dari
[code]
auto enp0s17
iface enp0s17 inet dhcp
iface enp0s17 inet6 auto
[/code]
Menjadi
[code]
auto eth0
iface eth0 inet dhcp
iface eth0 inet6 auto
[/code]

apabila static diubah seperti cotoh berikut:
root@localhost:~# nano /etc/network/interfaces

kita ubah dari :
[code]
auto enp0s17
iface enp0s17 inet static
address 192.168.2.3
netmask 255.255.255.0
dns-nameservers 192.168.2.1
gateway 192.168.2.1
[/code]
Menjadi
[code]
auto eth0
iface eth0 inet static
address 192.168.2.3
netmask 255.255.255.0
dns-nameservers 192.168.2.1
gateway 192.168.2.1
[/code]
Selanjutnya kita restart dengan cara ketik

root@localhost:~# reboot
setelah selesai kita login kembali dan ketik ifconfig dan hasilnya adalah:

[code]
root@localhost:~# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:f7:44:f1
inet addr:192.168.2.3 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:143 errors:0 dropped:27 overruns:0 frame:0
TX packets:85 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:16337 (16.3 KB) TX bytes:14380 (14.3 KB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:11840 (11.8 KB) TX bytes:11840 (11.8 KB)

root@localhost:~#
[/code]

Sekian Semoga bermanfaat

Install Nginx and Php Mysql on Ubuntu 16.04

Kali ini saya akan sharing cara install Nginx+php+mysql di ubuntu 16.04 64bit. Disini kita asumsikan sudah siap linux ubuntu versi 16.04.

Update terlebih dahulu:

~# apt-get update
Tunggu sampai selesai, dilanjutkan dengan install nginx
~# apt-get install nginx

setelah selesai coba akses http://localhost/
sampai muncul :
Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

================================
Cek status firewall jika aktif maka perlu di allow port http nya sehingga bisa di buka online:

~# ufw status
Status: inactive
~#
~# ufw allow 'Nginx HTTP'
Rules updated
Rules updated (v6)
~#

Langkah selanjutnya kita akan install mysql server

~# apt-get install mysql-server

Masukkan password dan konfirmasi password untuk mysql servernya.

Langkah selanjutnya adalah dengan menginstall php, disini saya akan menginstall versi php 5.6 yang saat ini masih kompatible untuk script lama dan yang baru karena alasan tidak akan mengganti script lama terlebih dahulu. Akan tetapi apabila ingin menggunakan versi yang lebih baru bisa mengikuti instalasi php default yang akan secara otomatis menginstall versi php 7.0


~# add-apt-repository ppa:ondrej/php
~# apt-get update
~# apt-get install php5.6-fpm php5.6-mysql
~# nano /etc/php/5.6/fpm/php.ini

cari cgi.fix_pathinfo
;cgi.fix_pathinfo=1
menjadi
cgi.fix_pathinfo=0
Restart untuk mereload perubahan
~# systemctl restart php5.6-fpm
~# nano /etc/nginx/sites-available/default

tambahkan index.php dibelakang index sehingga bentuknya sebagai berikut:

server_name 127.0.0.1

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php5.6-fpm.sock;
}

location ~ /\.ht {
deny all;
}

location / {
try_files $uri $uri/ /index.php?$args;
}

cek apakah setingan sudah benar:

~# nginx -t
Jika tampil seperti berikut berarti sudah benar.
~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
~#
~#systemctl reload nginx

Kita test apakah php sudah diload oleh nginx dengan cara membuat file php info karena alasan keamanan maka saya beri nama filenya a.php

~# nano /var/www/html/a.php

isi dengan code berikut:
[code][/code]

lalu kita test dengan cara akses ke http://localhost/a.php
sampai tahap ini kita telah selesai menginstall php+nginx+mysql di linux ubuntu 16.04

silahkan tambahkan setingan lain atau plugin lain, misalnya saya menginstall phpmyadmin juga saya install zip dan rar.

~# apt-get install unzip unrar php5.6-zip php5.6-mbstring php5.6-bz2 php5.6-mcrypt php5.6-mysql php5.6-gd php5.6-common