PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, September 20, 2022

[FIXED] how to access virtual host set in vagrant

 September 20, 2022     curl, php, vagrant, virtualhost     No comments   

Issue

I am having debian vagrant. I have done virtual host configuration in its apache as servername https:local-dev02.sitename.com. And used in my windows machine host file 127.0.0.1 local-dev02.sitename.com.

I can access my site in windows' browser as https://local-dev02.sitename.com:8443/. But I am unable to do

ping https://local-dev02.sitename.com
OR 
curl https://local-dev02.sitename.com
OR 
wget https://local-dev02.sitename.com

Solution

It is only possible to ping a hostname or IP address, but not an URL. So you need to put off the protocol like so

ping local-dev02.sitename.com

To reach your hosts via the hostnames, please add the IPs and hostnames to the /etc/hosts file.



Answered By - Markus Zeller
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,206,557

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing