Welcome to WebmasterWorld Guest from 188.8.131.52
It sounds like you've done some work and your files are in /etc/hosts, you'll need to have the main page be in www.example.com/index, if all your site files are in www.example.com/etc/hosts then nobody can see them.
Thats my best advice based on what you've written here.
This means, I set IP like vi /etc/hosts, in my local linux terminal command.
Then i can see it in my firefox, but for someone who doest set it in /etc/hosts in their own pc, then they still can view it but that is not the exact site I want to see (because we meet the same domain name)
So now, how can I do that?
- can do any alias to point to it, but how to do it? any idea?
is only local to your machine.
Your domain registrar may provide DNS services, if not then you will either need a third-party DNS service or run a DNS server yourself. Then you configure your domain name to use your nameservers, which in turn send requests to your IP address. Those requests are handled by the Apache installation on your server.
I would recommend first seeing if your domain registrar can set this up for you.