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'
and linked to it in
Code:
'/etc/httpd/sites-enabled/eset.lo.conf'.
Also added the line
Code:
IncludeOptional sites-enabled/*.conf
to httpd.conf
and added the hostnames in /etc/hosts:
Code:
<IP> eset.lo www.eset.lo
the eset.lo.conf is like this:
Code:
<VirtualHost *:80>
ServerName eset.lo
ServerAlias eset.lo *.eset.lo
DocumentRoot "/var/www/html/eset"
<Directory /var/www/html/eset/>
AllowOverride All
Options All
#Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
also added the index.html in /var/www/html/eset with content:
Code:
"Hello, Here is html/eset"
Now, This site is available in VPS itself when I do curl:
Code:
curl http://eset.lo/
output:
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
But it's not accessible. The 'curl -v
http://eset.lo/' is:
Code:
curl -v http://eset.lo/
* Trying <IP>...
* TCP_NODELAY set
* Connected to eset.lo (<IP>) port 80 (#0)
> GET / HTTP/1.1
> Host: eset.lo
> User-Agent: curl/7.54.1
> Accept: */*
>
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
and when I open the IP of VPS, I get the same output again:
Hello, Here is html/eset.
What's wrong with my configuration?
And why localhost inherited VirtualHost configuration?