Sintaks Linux - Apache Server

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 6

login as: sysadmin

sysadmin@192.168.148.131's password:
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-87-generic x86_64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage

164 packages can be updated.


73 updates are security updates.

Last login: Tue Aug 7 14:28:30 2018 from 192.168.148.1


sysadmin@vlab:~$ sudo su -
[sudo] password for sysadmin:
root@vlab:~# /etc/network/int
-su: /etc/network/int: No such file or directory
root@vlab:~# cd /etc/bind/
root@vlab:/etc/bind# vim db.kecoak
root@vlab:/etc/bind# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.148.131
root@vlab:/etc/bind# ping google.com
^C
root@vlab:/etc/bind# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=128 time=123 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=128 time=187 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=128 time=179 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=128 time=177 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=128 time=111 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=128 time=109 ms
^C
--- 8.8.8.8 ping statistics ---
7 packets transmitted, 6 received, 14% packet loss, time 6022ms
rtt min/avg/max/mdev = 109.944/148.320/187.530/33.518 ms
root@vlab:/etc/bind# vim named.conf.options
root@vlab:/etc/bind# service bind9 restart
root@vlab:/etc/bind# ping google.com
^C
root@vlab:/etc/bind# vim /etc/network/interfaces
root@vlab:/etc/bind# service networking restart
root@vlab:/etc/bind# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.148.131
nameserver 8.8.8.8
root@vlab:/etc/bind# vim /etc/network/interfaces
root@vlab:/etc/bind# service networking restart
root@vlab:/etc/bind# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.148.131
nameserver 192.168.148.129
nameserver 8.8.8.8
root@vlab:/etc/bind# ping google.com
PING forcesafesearch.google.com (216.239.38.120) 56(84) bytes of data.
64 bytes from 216.239.38.120: icmp_seq=1 ttl=128 time=53.4 ms
64 bytes from 216.239.38.120: icmp_seq=2 ttl=128 time=173 ms
64 bytes from 216.239.38.120: icmp_seq=3 ttl=128 time=182 ms
64 bytes from 216.239.38.120: icmp_seq=4 ttl=128 time=171 ms
64 bytes from 216.239.38.120: icmp_seq=5 ttl=128 time=61.4 ms
64 bytes from 216.239.38.120: icmp_seq=6 ttl=128 time=62.6 ms
^C
--- forcesafesearch.google.com ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 27173ms
rtt min/avg/max/mdev = 53.436/117.466/182.143/58.427 ms
root@vlab:/etc/bind# ping stikombali.com
PING stikombali.com (192.168.148.131) 56(84) bytes of data.
64 bytes from mail.stikombali.com (192.168.148.131): icmp_seq=1 ttl=64 time=0.015
ms
64 bytes from mail.stikombali.com (192.168.148.131): icmp_seq=2 ttl=64 time=0.030
ms
64 bytes from mail.stikombali.com (192.168.148.131): icmp_seq=3 ttl=64 time=0.031
ms
64 bytes from mail.stikombali.com (192.168.148.131): icmp_seq=4 ttl=64 time=0.031
ms
64 bytes from mail.stikombali.com (192.168.148.131): icmp_seq=5 ttl=64 time=0.042
ms
^C
--- stikombali.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4042ms
rtt min/avg/max/mdev = 0.015/0.029/0.042/0.011 ms
root@vlab:/etc/bind# ping kecoak.info
PING kecoak.info (192.168.148.131) 56(84) bytes of data.
64 bytes from mail.stikombali.com (192.168.148.131): icmp_seq=1 ttl=64 time=0.019
ms
64 bytes from mail.stikombali.com (192.168.148.131): icmp_seq=2 ttl=64 time=0.038
ms
64 bytes from mail.stikombali.com (192.168.148.131): icmp_seq=3 ttl=64 time=0.034
ms
64 bytes from mail.stikombali.com (192.168.148.131): icmp_seq=4 ttl=64 time=0.036
ms
64 bytes from mail.stikombali.com (192.168.148.131): icmp_seq=5 ttl=64 time=0.037
ms
^C
--- kecoak.info ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4023ms
rtt min/avg/max/mdev = 0.019/0.032/0.038/0.010 ms
root@vlab:/etc/bind# apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
apache2-bin apache2-data apache2-utils libapr1 libaprutil1
libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0 ssl-cert
Suggested packages:
www-browser apache2-doc apache2-suexec-pristine | apache2-suexec-custom
openssl-blacklist
The following NEW packages will be installed:
apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1
libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0 ssl-cert
0 upgraded, 10 newly installed, 0 to remove and 163 not upgraded.
Need to get 1,557 kB of archives.
After this operation, 6,436 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://kambing.ui.ac.id/ubuntu xenial/main amd64 libapr1 amd64 1.5.2-3 [86.0
kB]
Get:2 http://kambing.ui.ac.id/ubuntu xenial/main amd64 libaprutil1 amd64 1.5.4-
1build1 [77.1 kB]
Get:3 http://kambing.ui.ac.id/ubuntu xenial/main amd64 libaprutil1-dbd-sqlite3
amd64 1.5.4-1build1 [10.6 kB]
Get:4 http://kambing.ui.ac.id/ubuntu xenial/main amd64 libaprutil1-ldap amd64
1.5.4-1build1 [8,720 B]
Get:5 http://kambing.ui.ac.id/ubuntu xenial/main amd64 liblua5.1-0 amd64 5.1.5-
8ubuntu1 [102 kB]
Get:6 http://kambing.ui.ac.id/ubuntu xenial-updates/main amd64 apache2-bin amd64
2.4.18-2ubuntu3.9 [925 kB]
Get:7 http://kambing.ui.ac.id/ubuntu xenial-updates/main amd64 apache2-utils amd64
2.4.18-2ubuntu3.9 [81.8 kB]
Get:8 http://kambing.ui.ac.id/ubuntu xenial-updates/main amd64 apache2-data all
2.4.18-2ubuntu3.9 [162 kB]
Get:9 http://kambing.ui.ac.id/ubuntu xenial-updates/main amd64 apache2 amd64
2.4.18-2ubuntu3.9 [86.6 kB]
Get:10 http://kambing.ui.ac.id/ubuntu xenial/main amd64 ssl-cert all 1.0.37 [16.9
kB]
Fetched 1,557 kB in 22s (69.9 kB/s)
Preconfiguring packages ...
Selecting previously unselected package libapr1:amd64.
(Reading database ... 60044 files and directories currently installed.)
Preparing to unpack .../libapr1_1.5.2-3_amd64.deb ...
Unpacking libapr1:amd64 (1.5.2-3) ...
Selecting previously unselected package libaprutil1:amd64.
Preparing to unpack .../libaprutil1_1.5.4-1build1_amd64.deb ...
Unpacking libaprutil1:amd64 (1.5.4-1build1) ...
Selecting previously unselected package libaprutil1-dbd-sqlite3:amd64.
Preparing to unpack .../libaprutil1-dbd-sqlite3_1.5.4-1build1_amd64.deb ...
Unpacking libaprutil1-dbd-sqlite3:amd64 (1.5.4-1build1) ...
Selecting previously unselected package libaprutil1-ldap:amd64.
Preparing to unpack .../libaprutil1-ldap_1.5.4-1build1_amd64.deb ...
Unpacking libaprutil1-ldap:amd64 (1.5.4-1build1) ...
Selecting previously unselected package liblua5.1-0:amd64.
Preparing to unpack .../liblua5.1-0_5.1.5-8ubuntu1_amd64.deb ...
Unpacking liblua5.1-0:amd64 (5.1.5-8ubuntu1) ...
Selecting previously unselected package apache2-bin.
Preparing to unpack .../apache2-bin_2.4.18-2ubuntu3.9_amd64.deb ...
Unpacking apache2-bin (2.4.18-2ubuntu3.9) ...
Selecting previously unselected package apache2-utils.
Preparing to unpack .../apache2-utils_2.4.18-2ubuntu3.9_amd64.deb ...
Unpacking apache2-utils (2.4.18-2ubuntu3.9) ...
Selecting previously unselected package apache2-data.
Preparing to unpack .../apache2-data_2.4.18-2ubuntu3.9_all.deb ...
Unpacking apache2-data (2.4.18-2ubuntu3.9) ...
Selecting previously unselected package apache2.
Preparing to unpack .../apache2_2.4.18-2ubuntu3.9_amd64.deb ...
Unpacking apache2 (2.4.18-2ubuntu3.9) ...
Selecting previously unselected package ssl-cert.
Preparing to unpack .../ssl-cert_1.0.37_all.deb ...
Unpacking ssl-cert (1.0.37) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Setting up libapr1:amd64 (1.5.2-3) ...
Setting up libaprutil1:amd64 (1.5.4-1build1) ...
Setting up libaprutil1-dbd-sqlite3:amd64 (1.5.4-1build1) ...
Setting up libaprutil1-ldap:amd64 (1.5.4-1build1) ...
Setting up liblua5.1-0:amd64 (5.1.5-8ubuntu1) ...
Setting up apache2-bin (2.4.18-2ubuntu3.9) ...
Setting up apache2-utils (2.4.18-2ubuntu3.9) ...
Setting up apache2-data (2.4.18-2ubuntu3.9) ...
Setting up apache2 (2.4.18-2ubuntu3.9) ...
Enabling module mpm_event.
Enabling module authz_core.
Enabling module authz_host.
Enabling module authn_core.
Enabling module auth_basic.
Enabling module access_compat.
Enabling module authn_file.
Enabling module authz_user.
Enabling module alias.
Enabling module dir.
Enabling module autoindex.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module filter.
Enabling module deflate.
Enabling module status.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
Setting up ssl-cert (1.0.37) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
root@vlab:/etc/bind# cd /etc/apache2/
root@vlab:/etc/apache2# ls
apache2.conf conf-enabled magic mods-enabled sites-available
conf-available envvars mods-available ports.conf sites-enabled
root@vlab:/etc/apache2# cat /etc/host
host.conf hostname hosts hosts.allow hosts.deny
root@vlab:/etc/apache2# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 vlab

# The following lines are desirable for IPv6 capable hosts


::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
root@vlab:/etc/apache2# cd /var/www/html/
root@vlab:/var/www/html# ls
index.html
root@vlab:/var/www/html# mv index.html index.html.asli
root@vlab:/var/www/html# ls
index.html.asli
root@vlab:/var/www/html# vim index.html
root@vlab:/var/www/html# ls
index.html index.html.asli
root@vlab:/var/www/html# exit
logout
sysadmin@vlab:~$ ls
linux pelatihan training training linux
sysadmin@vlab:~$ mkdir stikombali
sysadmin@vlab:~$ vim stikombali/index.html
sysadmin@vlab:~$ sudo su -
[sudo] password for sysadmin:
root@vlab:~# cd /etc/apache2/sites-available/
root@vlab:/etc/apache2/sites-available# ls
000-default.conf default-ssl.conf
root@vlab:/etc/apache2/sites-available# cp 000-default.conf 000-default.conf.asli
root@vlab:/etc/apache2/sites-available# vim 000-default.conf
root@vlab:/etc/apache2/sites-available# sudo su -
root@vlab:~# cd /etc/apache2/sites-available/
root@vlab:/etc/apache2/sites-available# vim 000-default.conf
root@vlab:/etc/apache2/sites-available# vim /etc/apache2/apache2.conf
root@vlab:/etc/apache2/sites-available# cp /etc/apache2/apache2.conf
/etc/apache2/apache2.conf.asli
root@vlab:/etc/apache2/sites-available# vim /etc/apache2/apache2.conf
root@vlab:/etc/apache2/sites-available# service apache2 restart
root@vlab:/etc/apache2/sites-available# exit
logout
root@vlab:/etc/apache2/sites-available# exit
logout
sysadmin@vlab:~$ ls
linux pelatihan stikombali training training linux
sysadmin@vlab:~$ mkdir kecoak
sysadmin@vlab:~$ ls
kecoak linux pelatihan stikombali training training linux
sysadmin@vlab:~$ ls -l
total 24
drwxrwxr-x 2 sysadmin sysadmin 4096 Aug 7 17:20 kecoak
drwxrwxr-x 2 sysadmin sysadmin 4096 Aug 3 02:13 linux
drwxrwxr-x 2 sysadmin sysadmin 4096 Aug 3 01:14 pelatihan
drwxrwxr-x 2 sysadmin sysadmin 4096 Aug 7 17:08 stikombali
drwxrwxr-x 3 sysadmin sysadmin 4096 Aug 4 00:36 training
drwxrwxr-x 2 sysadmin sysadmin 4096 Aug 3 01:17 training linux
sysadmin@vlab:~$ cp stikombali/index.html kecoak/index.html
sysadmin@vlab:~$ vim kecoak/index.html
sysadmin@vlab:~$ sudo su -
root@vlab:~# cd /etc/apache2/
root@vlab:/etc/apache2# cp sites-available/000-default.conf sites-
available/kecoroot@vlab:/etc/apache2# vim sites-available/kecoak.info.conf
root@vlab:/etc/apache2# ls sites-available/
000-default.conf 000-default.conf.asli default-ssl.conf kecoak.info.conf
root@vlab:/etc/apache2# ls sites-enabled/
000-default.conf
root@vlab:/etc/apache2# a2
a2disconf a2dismod a2dissite a2enconf a2enmod a2ensite a2query
root@vlab:/etc/apache2# a2en
a2enconf a2enmod a2ensite
root@vlab:/etc/apache2# a2ensite kecoak.info.conf
Enabling site kecoak.info.
To activate the new configuration, you need to run:
service apache2 reload
root@vlab:/etc/apache2# ls sites-enabled/
000-default.conf kecoak.info.conf
root@vlab:/etc/apache2# service apache2 restart
root@vlab:/etc/apache2# ls /home/sysadmin/kecoak/
index.html
root@vlab:/etc/apache2# vim /home/sysadmin/kecoak/index.html
root@vlab:/etc/apache2# vim sites-available/kecoak.info.conf
root@vlab:/etc/apache2# service apache2 restart
root@vlab:/etc/apache2# vim apache2.conf
root@vlab:/etc/apache2# service apache2 restart
root@vlab:/etc/apache2#

437-103-997

You might also like