Anda di halaman 1dari 4

Cara Membuat Subdomain Godday dan VPS

Albert Anthony

Setting pada godaddy


1. Login ke http://godaddy.com/
Username: sw2975
Password: 58300851yukepoS

2. Klik menu Kelola pada domain

3. Pilih pada domain yang diinginkan -> setting -> kelola DNS

4. Pada table Catatan pilih button Tambah, lalu isi form seperti berikut
Cara Membuat Subdomain Godday dan VPS
Albert Anthony

Tipe: A
Host: isi dengan subdomain yang diinginkan, (contoh: jika ingin dev.yukepo.com maka isi host
dengan dev)
Mengarahkan ke: Isi dengan ip dari server public
TTL: 1 Jam
Kemudian klik simpan

5. Cek dengan ping ke subdomain tersebut

Setting pada server


1. Login ke server public (188.166.209.158) dengan menggunakan putty
Username: root
Password: 123456789yuk

2. Buat file config pada nginx, biasakan nama file tersebut sama dengan nama subdomainnya
dengan menggunakan command di bawah ini

3. Isi dengan potongan config dibawah ini


server {
#listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;

root /var/www/dev;
index index.php index.html index.htm;

# Make site accessible from http://localhost/


server_name dev.yukepo.com;

location / {
Cara Membuat Subdomain Godday dan VPS
Albert Anthony

# First attempt to serve request as file, then


# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?$query_string;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}

location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

# Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests


#location /RequestDenied {
# proxy_pass http://127.0.0.1:8080;
#}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html


#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /usr/share/nginx/html;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000


#
#location ~ \.php$ {
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
# fastcgi_pass unix:/var/run/php5-fpm.sock;
# fastcgi_index index.php;
# include fastcgi_params;
#}
Cara Membuat Subdomain Godday dan VPS
Albert Anthony

# deny access to .htaccess files, if Apache's document root


# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

4. Kemudian buat shortcut softlink untuk site-enabled dengan menggunakan command dibawah
ini

Pastikan pada folder /etc/nginx/site-enabled/ mempunyai shortcut yang mengarah ke


/etc/nginx/site-availabe/dev. Cara cek nya bisa menggunakan command seperti dibawah ini

5. Kemudian tes apakah config anda sudah benar atau belum dengan menggunakan command
dibawah ini

6. Kemudian buat file php pada folder root yang sudah dimasukin pada file config tersebut

7. Isi dengan potongan code php dibawah ini


<?php
echo ‘Hello World’;

8. Kemudian restart service nginx tersebut agar config tersebut bisa jalan

9. Jika berhasil coba tes pada web browser anda dengan subdomain yang sudah anda buat tadi

Anda mungkin juga menyukai