apache VirtualHost not accessible from outside
I have two questions.
I'm trying to create a VirtualHost on VPS with CentOS 7. I've created a file eset.lo.conf in sites-available: Code:
'/etc/httpd/sites-available/eset.lo.conf' Code:
'/etc/httpd/sites-enabled/eset.lo.conf'. Code:
IncludeOptional sites-enabled/*.conf and added the hostnames in /etc/hosts: Code:
<IP> eset.lo www.eset.lo Code:
<VirtualHost *:80> Code:
"Hello, Here is html/eset" Code:
curl http://eset.lo/ Hello, Here is html/eset Ok. When I also do 'curl http://localhost/' I get the same output: Hello, Here is html/eset And the next question is: I want to access this VHost from my personal computer. I've added it's IP to my /etc/hosts: Code:
<IP> est.lo www.est.lo Code:
curl -v http://eset.lo/ Hello, Here is html/eset. What's wrong with my configuration? And why localhost inherited VirtualHost configuration? |
Quote:
If you have defined only one vhost, then that's also the default one, so vising your webserver either as localhost, or by its IP, you will get the default vhost, that in your case is eset.lo |
Thanks a lot. But, When I call "eset.lo" from my computer, Although I've binded the host and IP in /etc/hosts, Why I don't get access to the VHost? It's output is nothing as I shown in 'curl':
Quote:
|
Quote:
Quote:
|
Excuse me. I told badly. I meant when I open IP using browser. I've set the firewall rule before configure the VHost, And port 80 was open when the problem occurred.
|
Quote:
|
You need to buy the domain name you want for your VPS. In your example is www.eset.lo so the DNS server can reach your VPS thru a domain name.
domain name mapping inside /etc/hosts is good for local use and pings. |
All times are GMT -5. The time now is 08:05 AM. |