How to change localhost to realistic domain using Virtual Host

Asked By 0 points N/A Posted on -
qa-featured

Hi,

I’ve tried my best to set the Apache configuration so that I can use a real domain name in the web address instead of “localhost” although I’m working on a standalone computer. I’m using Virtual Host configuration, but doesn’t work. What I miss or someone here can give me some advice? Thank you all.

I put some picture to make what I mean clear.

1) Access my web server using localhost

2) Set the Virtual Host on file “httpd-vhosts. conf”

<VirtualHost *: 80>

    DocumentRoot "<PATH-TO-DIRECTORY>"
    ServerName mysite. loc: 80

          <Directory ""<PATH-TO-DIRECTORY>">

                   Options Indexes FollowSymLinks Includes ExecCGI

                   AllowOverride All

                   Order allow,deny

                   Allow from all

          </Directory>

</VirtualHost>

3) Access my web server using realistic domain instead of “localhost” but doesn’t work

realistic domain instead of “localhost”

 

This webpage is not available

SHARE
Answered By 0 points N/A #120105

How to change localhost to realistic domain using Virtual Host

qa-featured

If you want to access your computer from an outside means, then you will have to buy a domain. That is the only solution. Try to go to Godaddy or any other company and register the website name. They will charge you on a per month basis. That is the only and best solution. Until then you can access your website only from your own computer. Or otherwise, if you have a static IP address , then note down the IP address and then type that in your browser's address bar and then point to the file you want to go to. Try that from any other computer and you can access that by making small changes in your code.

Cheers.

Related Questions