Membangun website linux ubuntu bag. 1
1. Install apache2
Langkah pertama adalah menginstal aplikasi
webserver apache.
$ sudo apt-get install
apache2
Jika tidak
berhasil install apache, linux ubuntu harus di update
$ sudo apt-get update
Ulangi
lagi perintah instal apache2
$ sudo apt-get install
apache2
Mencoba
hasil install webserver apache, jalankan aplikasi browser (misalkan mozila)
buka dengan alamat web http://localhost
Maka akan
muncul :
It works!
This is the default web page for this
server.
The web server software is running but no content has been added, yet.
Membuat website
The web server software is running but no content has been added, yet.
Membuat website
Secara
default untuk membuat website disimpan pada direktory /var/www/, misalkan kita
akan membuat web tkj, untuk memudahkan buat direktory tkj untuk manpung
file-file web yang akan dibuat.
Membuat
direktory tkj :
$ sudo mkdir /var/www/tkj
Membuat
file index.html pada /var/www/tkj/ :
$ sudo gedit
/var/www/tkj/index.html
Ketik
contoh html :
<html>
<title>web tkj</title>
<body>
selamat datang
<br>
<br>
website tkjri
<br>
<br>
web ini disimpan dilokasi /var/www/tkj/
</html>
<title>web tkj</title>
<body>
selamat datang
<br>
<br>
website tkjri
<br>
<br>
web ini disimpan dilokasi /var/www/tkj/
</html>
Mencoba
memanggil web tkj dengan aplikasi web browsing dengan alamat : http://localhost/tkj/
Akan tampil sebagai berikut :
Selamat datang
Website
tkjri
Web ini
disimpan dilokasi /var/www/tkj/
jika tidak muncul seperti diatas, rubah atribut tkj :
jika tidak muncul seperti diatas, rubah atribut tkj :
$ sudo chmod 755 /var/www/tkj
$ sudo chmod 755 /var/www/tkj/index.html
$ sudo chmod 755 /var/www/tkj/index.html
Ulangi
lagi memanggil web tkj.
Perintah
– perintah lainnya untuk webserver:
$ sudo /etc/init.d/apache2 start => menjalankan apache /webserver
$ sudo /etc/init.d/apache2 stop => menghentikan apache /webserver
$ sudo /etc/init.d/apache2 restart => menjalankan ulang apache /webserver
$ sudo /etc/init.d/apache2 start => menjalankan apache /webserver
$ sudo /etc/init.d/apache2 stop => menghentikan apache /webserver
$ sudo /etc/init.d/apache2 restart => menjalankan ulang apache /webserver

0 komentar: