Jump to content
☺☺☺

Nak Create Subdomain

Recommended Posts

aku x tau camner nak create subdomain mcm ni

mobile.domain.com

aku dah baca bnyk tutorial kat web / google tapi masih blom berjaya.

kat httpd.conf aku mcm ni
 

NameVirtualHost *:80

<VirtualHost *:80>
     ServerAdmin email@domain
     ServerName mobile.domain.com
     DocumentRoot /home/www/public_html/mobile
     ErrorLog logs/error_log
</VirtualHost>

kalau aku taip www.domain.com & www.domain.com/mobile boleh takde masalah, tapi bile nak taip mobile.domain.com x kluar.

help!

Edited by ☺☺☺

Share this post


Link to post
Share on other sites
Ada add dekat hosts file tak?

Aku buat untuk localhost so aku add line bawah ni dalam hosts file.
127.0.0.1   mobile.localhost

Then add code bawah ni dalam httpd.conf
 
<VirtualHost *:80>
 ServerName mobile.localhost
 DocumentRoot "/path/to/folder"
 DirectoryIndex index.html
</VirtualHost>

So everytime bila nak ke mobile.localhost aku kena taip http://mobile.localhost. Kalau tak dia pergi Google mende tu. lol

Share this post


Link to post
Share on other sites

Ada add dekat hosts file tak?

Aku buat untuk localhost so aku add line bawah ni dalam hosts file.

127.0.0.1   mobile.localhost

Then add code bawah ni dalam httpd.conf
 
<VirtualHost *:80>
 ServerName mobile.localhost
 DocumentRoot "/path/to/folder"
 DirectoryIndex index.html
</VirtualHost>

So everytime bila nak ke mobile.localhost aku kena taip http://mobile.localhost. Kalau tak dia pergi Google mende tu. lol

 

 

terima kasih @ahaksz!, aku dah masukkan kat host file mcm yg ko cakap tu.. /etc/hosts tapi masih x boleh?

 

tapi bila ping dapat plak?

> ping mobile.domain.com

ni bukan kat localhost.. ni kat live server.. ada idea?

 

Share this post


Link to post
Share on other sites

server apa ni? kalau ubuntu/debian ada 'quirks' sikit, nak kena symlink kat sites-enabled

 

aku guna debian bro.. ok aku dah symlink kan 2 folder ni:

$ ln -s /home/www/public_html /home/www/public_html/mobile

tapi masih sama.. dia tetap direct ke www.domain.com

 

DNS host kat mana? dah create CNAME record untuk subdomain?

mobile.domain.com.     1800     CNAME     www.domain.com


nak kena install dns ke? pelik aku sbb skang ni x pakai dns. www.domain.com jalan ok?

$ service named status
named is stopped

tapi mcm mane bile ping subdomain ngan root dua-dua ada reply?

Edited by ☺☺☺

Share this post


Link to post
Share on other sites

mungkin sebab memang dah wujud domain & subdomain tu kat internet. cuba unplug network tengok.

cuba semak dns client punya setting


yeeess.. akhirnya berjaya.. rupanya setting kat godaddy menjadi penyebab nya..
aku remove wildcard subdomain & catchall kat godaddy.. dlm sehari camtu subdomain aku dah berfungsi seperti yg aku mahu :3:

tengkiu abang-abang @umarzuki, @mohdfadly @@ahaksz! kerana membantu.. jasa kalian akan kukenang..  

blanjer sikit :159: ->


 http://www.youtube.com/watch?v=2OSOkm0fA-0

Edited by ☺☺☺

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...