(ask) cara menambah virtualhost di nginx

Diskusi tentang Ubuntu Server baik webserver, database server, samba server dan service lainnya serta jaringan menggunakan Sistem Operasi Ubuntu.
User avatar
metalic
Posts: 61
Joined: 28 Oct 2013, 10:47
Location: bandung,indonesia

(ask) cara menambah virtualhost di nginx

Postby metalic » 13 Aug 2014, 19:34

buat para master ubuntu...

saya menggunakan ubuntu 12.04 dengan web server nginx, saya sudah buat domain di bind9 dengan nama vhost1.kasep.com, nah yang saya bingung buat virtualhostnya, udah coba searching2 masih tetep gk bisa..
mohon bantuannya buat para master.
trims..
User avatar
sr_aja
Posts: 597
Joined: 10 Dec 2012, 11:21
Location: Jakarta

Re: (ask) cara menambah virtualhost di nginx

Postby sr_aja » 13 Aug 2014, 19:46

virtualhost pada webserver ya?
coba ikuti stepnya di;https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3
User avatar
metalic
Posts: 61
Joined: 28 Oct 2013, 10:47
Location: bandung,indonesia

Re: (ask) cara menambah virtualhost di nginx

Postby metalic » 13 Aug 2014, 19:52

ko malah tmpil bacaan "Oh no! It seems the page you were looking for has been eaten by Sammy."
hehehee
User avatar
metalic
Posts: 61
Joined: 28 Oct 2013, 10:47
Location: bandung,indonesia

Re: (ask) cara menambah virtualhost di nginx

Postby metalic » 13 Aug 2014, 19:59

oh sip2 mas dah ketemu tapi yang saya bingung ko file default di sites-enable nya di delete ?
berarti kalau di search pake localhost gk akan ktemu dong ? sama disitu ada var/www/ kan itu di apache2 karena default nya di hapus,,, atau gimna saya kurang paham hehe
User avatar
sr_aja
Posts: 597
Joined: 10 Dec 2012, 11:21
Location: Jakarta

Re: (ask) cara menambah virtualhost di nginx

Postby sr_aja » 13 Aug 2014, 20:38

wahh ngak bs ngebayangin bray.. kudu cek langsung.. :D
coba pelan2 aje.. bikin kopi dulu... break sejenak.. nanti juga ketemu ;)
User avatar
metalic
Posts: 61
Joined: 28 Oct 2013, 10:47
Location: bandung,indonesia

Re: (ask) cara menambah virtualhost di nginx

Postby metalic » 14 Aug 2014, 08:46

iyah nih :D
woke di sambil ngopi aja dah..
heheh
User avatar
sr_aja
Posts: 597
Joined: 10 Dec 2012, 11:21
Location: Jakarta

Re: (ask) cara menambah virtualhost di nginx

Postby sr_aja » 22 Aug 2014, 10:47

@metalic;
sharing lah di marih, cara membuat virtualhost di Nginx :D
User avatar
metalic
Posts: 61
Joined: 28 Oct 2013, 10:47
Location: bandung,indonesia

Re: (ask) cara menambah virtualhost di nginx

Postby metalic » 22 Aug 2014, 11:09

oh siap tapi mas aku takut salah nih, sejauh ni work sih :D
User avatar
sr_aja
Posts: 597
Joined: 10 Dec 2012, 11:21
Location: Jakarta

Re: (ask) cara menambah virtualhost di nginx

Postby sr_aja » 22 Aug 2014, 13:12

kalau salah kan, bisa di koreksi bareng2
lagian semua org beda kebutuhan kok
jadi walaupun di tempat metalic stabil,belon tentu di tempat yg lain stabil begitu juga sebailknya..
kalau ngak banyak yg nyobain config ente.. jadi ngak pernah tau kurangnya di mana
User avatar
metalic
Posts: 61
Joined: 28 Oct 2013, 10:47
Location: bandung,indonesia

Re: (ask) cara menambah virtualhost di nginx

Postby metalic » 22 Aug 2014, 14:32

yang aku gini mas,,kurang lebihnya mohon di maafkan :D

Misalnya kita member nama domain vhost1.sikasep.com
1. Langkah pertama dalam menciptakan virtualhost adalah membuat direktori baru dimna kita menyimpan web tersebut :
sudo mkdir -p /var/www/vhost1.sikasep.com/public_html

2. ubah kepemlilikan direktori yang tadi kita buat :
sudo chown -R www-data:www-data /var/www/vhost1.sikasep.com/public_html

Terus ubah kepemilikan /var/www:
sudo chmod 755 /var/www

3. buat index.html baru di direktori yang tadi kita buat :
sudo nano /var/www/vhost1.sikasep.com/index.html

Daleman index.html punya saya seperti ini :


vhost1.sikasep.com


Success: You Have Set Up a Virtual Host



4. masuk pada file /etc/nginx/sites-available :
sudo nano /etc/nginx/sites-available/default
masukan konfigurasi berikut paling atas :
server {
listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6

root /var/www/vhost1.sikasep.com/public_html;
index index.html index.htm;

# Make site accessible from http://localhost/
server_name vhost1.sikasep.com;
}
5. restart nginx
sudo /etc/init.d/nginx restart
User avatar
sr_aja
Posts: 597
Joined: 10 Dec 2012, 11:21
Location: Jakarta

Re: (ask) cara menambah virtualhost di nginx

Postby sr_aja » 22 Aug 2014, 23:10

thanks om metalic
ente udh mau berbagi
User avatar
metalic
Posts: 61
Joined: 28 Oct 2013, 10:47
Location: bandung,indonesia

Re: (ask) cara menambah virtualhost di nginx

Postby metalic » 25 Aug 2014, 14:27

ko om si mas, aku kan masih kecil :D
iya sama2 :D
User avatar
sr_aja
Posts: 597
Joined: 10 Dec 2012, 11:21
Location: Jakarta

Re: (ask) cara menambah virtualhost di nginx

Postby sr_aja » 26 Aug 2014, 20:58

@metalic
wahh saah yahh tante.. hahahahah... ( piss dulu ahhh )

Return to “Ubuntu Server”

Who is online

Users browsing this forum: No registered users and 1 guest