Skip to content

Instantly share code, notes, and snippets.

Created February 28, 2018 13:11
Show Gist options
  • Save anonymous/1f4543312d6f82503f92999512c2d1de to your computer and use it in GitHub Desktop.
Save anonymous/1f4543312d6f82503f92999512c2d1de to your computer and use it in GitHub Desktop.
masuk ke mode root:
# sudo su
masuk ke folder www
# cd /var/www
buat folder nya (contoh cobaweb) :
# mkdir /var/www/cobaweb.com
buat file index.html nya :
# gedit /var/www/cobaweb.com/index.html
chown foldernya :
# chown -hR namauser:namauser /var/www/cobaweb.com
masuk ke folder apache2/sites-available:
# cd /etc/apache2/sites-available/
copy file 000-default.conf ke nama webnya:
# cp 000-default.conf cobaweb.conf
edit file yang barusan dicopy:
# gedit cobaweb.conf
hapus comment di bagian ServerName, dan edit www.example.com (misal jadi www.cobaweb.com)
lalu tambahkan dibawahnya:
ServerAlias www.cobaweb.com
edit DocumentRoot /var/www/html nya ke folder tadi (misal jadi /var/www/cobaweb.com)
save
lalu aktifasi sitenya:
# a2ensite cobaweb.conf
edit file hosts:
# gedit /etc/hosts
tambahkan di paling bawah:
127.0.0.1 cobaweb.com
127.0.0.1 www.cobaweb.com
lalu save.
restart service apachenya:
# sudo service apache2 reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment