Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

im currently lost as to why i can't properly map my website.. here is the situation..

my website is currently hosted on a local webserver running as Guest OS on Virtual Box. im running a CentOS 6.5.. now, here is the details for that OS,

CentOS IP Addr = 192.168.0.102

my HTTPD.CONF on CentOS

Listen *:80

  NameVirtualHost *:80

  <VirtualHost *:80>
     ServerAdmin root@localhost
     DocumentRoot /var/www/html/test/public
      ServerName laravel.localhost.com
     ServerAlias laravel.localhost.com
     ErrorLog /var/www/html/logs/erro_log
     CustomLog /var/www/html/logs/access_log common
  </VirtualHost>

my /etc/hosts

   127.0.0.1 localhost.localdomain localhost
   127.0.0.1 laravel.localhost.com
   192.168.0.102 laravel.localhost.com
   laravel.localhost.com               192,168.0.102
   ::1             localhost6.localdomain6 localhost6

now for my Host OS, which is running on win7, and when i access my website @ laravel.locahost.com.. it can't seem to find my site.. but when i access through 192.168.0.102.. it goes directly to my site.. what seems to be the problem here? can anyone point it out to me.. im already oout of ideas and been googline it for some time.. all of them give me the same workaround but my problem still persist..

=== UPDATE ====

here is my updated /etc/hosts file

127.0.0.1               localhost.localdomain localhost
127.0.0.1               localhost laravel.localhost.com
192.168.0.102           localhost laravel.localhost.com
::1             localhost6.localdomain6 localhost6
share|improve this question

1 Answer 1

up vote 1 down vote accepted
127.0.0.1 localhost.localdomain localhost
127.0.0.1 laravel.localhost.com
192.168.0.102 laravel.localhost.com
laravel.localhost.com 192,168.0.102
::1 localhost6.localdomain6 localhost6

Remove the 4th line. I think the comma (,) in the IP address is causing the problem. And another thing is that hosts file should be in the format

<ip-address> <hostname> <alias> ...

and not

<hostname> <ip-address>

Reference: https://en.wikipedia.org/wiki/Hosts_(file)

Edit: You need to add this line

192.168.0.102           localhost laravel.localhost.com

to your host machine's hosts file i.e. Windows 7 hosts file

share|improve this answer
    
hmmm okay update my /etc/hosts file.. please see my updates.. and still problem persists.. whenever i access this url localhost.laravel.com it can't find my site –  lemoncodes Mar 9 at 13:25
    
I've updated the answer. I think you didn't map your local domain in your host OS's hosts file. –  ASRM Mar 9 at 13:30
    
do i need to restart my host machine??.. it seems that i still can't access localhost.laravel.com –  lemoncodes Mar 9 at 13:35
    
If I'm not wrong, then I think it was laravel.localhost.com –  ASRM Mar 9 at 13:37
    
ohhh man.. wait wait gonna fix my naming.. got it messed up.. will feedback u in a bit.. –  lemoncodes Mar 9 at 13:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.