Model Andre (1)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

NAMA : ANDREDI SETIAWAN

NIM:230401366
MATKUL: PRATIKUM SO

Installasi Web Server


langkah pertama update linuxnya terdahulu dengan perintah
sudo apt update

Perintah diatas digunakan untuk mengecek, apakah ada upgrade yang dibutuhkan pada
sistem linux yang sedang digunakan. Jika ada lanjutkan beritah untuk mengupgrade linux.
sudo apt upgrade

lanjut dengan peritnah berikut.


sudo apt install apache2

Langkah selanjutnya restart apache dan cek status dengan perintah seperti
perintah berikut sudo systemctl status apache2

sudo ufw app list


sudo ufw app info "Apache Full"
sudo ufw allow in "Apache Full"
sudo ufw app info "Apache"
. Installasi MySql
sudo apt install mysql-server mysql-client

selanjutnya restart mysql dan sekaligus mengecek statusnya dengan perintah tersebut
dibawah ini :
sudo systemctl status mysql

Jalankan mysql dengan perintah berikut :


sudo mysql -u root -p
sudo mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD PLUGIN can be used to test passwords


and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy:

LOW Length >= 8


MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file

Please enter 0 = LOW, 1 = MEDIUM and 2 =


STRONG: 0 Please set the password for root here.

New password:

Re-enter new password:

Estimated strength of the password: 25


Do you wish to continue with the password provided?(Press y|Y for Yes, any other key
for No) : y By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a
production environment.

Remove anonymous users? (Press y|Y for Yes, any other key
for No) : y Success.

Normally, root should only be allowed to connect


from 'localhost'. This ensures that someone cannot
guess at the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for
No) : y Success.

By default, MySQL comes with a database named


'test' that anyone can access. This is also intended
only for testing, and should be removed before
moving into a production environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...
Success.

- Removing privileges on test database...


Success.

Reloading the privilege tables will ensure that all


changes made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for
No) : y Success.

All done!

sudo mysql

SELECT user,authentication_string,plugin,host FROM mysql.user;

Setelah dilakukan gecekan pada tabel untuk user root tidak memiliki password seperti
gambar dibawah
Langkah selanjutnya ketikkan perintah berikut
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY
‘ko12#doK'; FLUSH PRIVILEGES;
Installasi php
masukan perintah dibawah ini.
sudo apt-get install php libapache2-mod-php php-mysql php-curl php-gd php-json php-zip

Setelah proses installasi selesai, langkah selanjutnya kita akan mengecek apakah php
sudah terinstall atau belum, caranya dengan membuat satu file dengan nama info.php. File
ini diletakkan di folder varwww/html dengan menggunakan editor kesayangan. Pembaca
silahkan mengguganakn editor kesayangannya ya, kami menggunakan nano karena
memang saya lebih suka dengan nano tersebut, selain gampang juga simple.
sudo nano /var/www/html/info.php

Setelah terbentang halaman kososng silahkan ketikkan perintah berikut dibawah ini.
<?php
phpinfo();
?>
Langkah selanjutnya silahkan restart apache2 yang sudah terinstall..
sudo systemctl restart apache2

Setelah selesai, simpan kemudian buka browser dan ketikkan localhost/info.php, maka
akan tampil seperti gambar 13.4 dibawah ini.

<IfModule mod_dir.c>
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
inde$ </IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Sekarang kita pindahkan index.php ke depan seperti berikut, sudah beritu saja.
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml
inde$ </IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

setelah itu masukan perintah dibawah ini.


sudo apt install php libapache2-mod-php php-mysql

. Installasi phpMyAdmin
silahkan ketik di terminal seperti perintah tersebut.
sudo apt update
sudo apt install phpmyadmin php-mbstring php-gettext
sudo phpenmod mbstring
sudo systemctl restart apache2

selanjutnya buka browser dan ketikkan perintah localhost/phpmyadmin.

You might also like