Senin, 17 Juni 2013

Lapres Modul 2 Kelompok B12 (Part 2)

DMZ akan digunakan sebagai Web server. Terdapat 2 buah webbsite yang ditangani oleh web server ini yaitu ip_anda:90, ip_anda:8080. Kemudian pada website ip_anda:80 terdapat subdirektori /admin yang mana sebenarnya file-filenya terletak  di /home/admin, berbeda dengan file-file yang terletak di /var/www. Ketika mengakses ip_anda:8080 user harus menginput username dan password (menggunakan .httpaccess). Semua website tidak boleh menampilkan list directori. Jadi jika ada file index (index.html, index.php, default.asp) maka daftar file dan subdirectori yang ada tidak akan tampil. Ketika kita mengakses ip_anda:80/example maka akan diarahkan ke ip_anda:80/example/example.html

  1. Ketik "nano /etc/apache2/sites-available/default" dan ketik sesuai yang ada di bawah ini

    <VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /home/admin

    <Directory />
    Options FollowSymLinks
    AllowOverride None
    <Directory>

    <Directory /home/admin/>
    Options -Indexes FollowSymLinks MultiViews
    ErrorDocument 403 /example/example.html
    AllowOverride None
    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
    Loglevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc"
    <Directory "/usr/share/doc">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0::1/128
    </Directory>
    </VirtualHost>

    #agar dapat melakukan koneksi ke post:8080
    LISTEN 8080
    <VirtualHost *:8080>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    </Directory>
    <Directory /var/www/>
    Options -Indexes FollowSymLinks MultiViews
    AllowOverride AuthConfig
    Order allow,deny
    allow from all
    </Directory>
    </VirtualHost>

    Lalu simpan
  2. Ketik "cd /home/ && mkdir admin/" lalu enter dan ketik lagi "cd admin/ && nano index.html" dan ketik sesuai berikut ini

    <html>
    <body>
    <h1>It works!
    </h1>
    <p>This is default page for this server 80</p>
    </body>
    </html>

    lalu simpan
  3. Lalu ketik "mkdir public_html && nano example.html" lalu ketik sesuai beriku ini

    <html>
    <body>
    <h1>It works!
    </h1>
    <p>This is the directed page for this server 8080</p>
    </body>
    </html>

    lalu simpan
  4. Lalu ketik "cd /var/www/ && nano .htaccess" dan ketik sesuai beriku ini

    AuthName "Siapa namamu"
    AuthType Basic
    AuthUserFile /var/www/.htpasswd
    Require valid-user

    lalu simpan
  5. Ketik "htpasswd -c .htpasswd b12" dan ketik sesuai berikut ini

    NewPassword: b12
    RetypePassword: b12
  6. Tes hasil settingan tadi dengan cara berikut ini:
    1. Ketik "lynx 180.12.0.1:80"(untuk port 80) atau ketik "lynx 180.12.0.1:8080"(untuk port 8080) di client
    2. Jika muncul tulisan berikut ini maka settingan anda berhasil
      • untuk port 80
        "It works!
        This is the defaul page for this server 80"
      • Untuk port 8080
        maka akan muncul perintah untuk memasukan username dan password dengan mengetik "b12" dan muncul tulisan
        "It works!
        This is the directed page for this server 8080"

Tidak ada komentar:

Posting Komentar