How to Create Virtual Host on LocalHost

In this tutorial i’m going to describe how to create virtual host in Laravel in easy way mentioned below.

Virtualhost :- Virtual Host is a hosting multiple domain names on a single server.

Every time running a Laravel project with the command “php artisan serve” may be painful. Virtual hosts in xampp to handle multiple projects because that’s easier than accesing the direct path with the localhost URL.

Please follow some easy steps mentioned below.

first stop your xampp ?

1step-> Go to

C:\xampp\htdocs

ds-admin-ms is my project folder name

ds-admin-ms

2nd step go to

C:\xampp\apache\conf\extra

3rd step Open this file -> httpd-vhosts.conf

4th step Copy below code ??

<VirtualHost *:80>	DocumentRoot "C:\xampp\htdocs\ds-admin-ms\public"	ServerName ds-admin-ms	ServerAlias ds-admin-ms	<Directory "c:/xampp/htdocs/ds-admin-ms/public">	Order allow,deny	Allow from all	</Directory></VirtualHost>

Next step go to

C:\Windows\System32\drivers\etc

Open this file -> hosts

Note: Remember to edit the hosts file using an editor with administrator rights, otherwise you won’t be able to save the changes.

Simply copy below code ?

127.0.0.1 		ds-admin-ms::1

Paste here in C:\Windows\System32\drivers\etc and open this file ? hosts

Lets go to xampp and start run

and go to folder -> C:\xampp\htdocs\ds-admin-ms

and open terminal and run

php artisan serve

Next go to browser and paste this

http://ds-admin-ms/
Thanks ??
Hi I am Amit Experienced Web Developer with a demonstrated history of working in the information technology and services industry.

Related Posts

Blade in Laravel

Blade is the simple,yet powerful templating engine that is included with laravel. Blade does not restrict you from using plain php code in your templates. Blade templates…

Read More

CRUD USING QUIRY BUILDER IN LARAVEL.

We are performing crud opertion using quiry builder in laravel STEP : 1 Create Laravel project by running this command in terminal CMND :– Laravel new project_name…

Read More

Controller In Laravel

Controllers can group related request handling logic into a single class, Instead of defining all of your request handling logic as closure in route files ,you may…

Read More

LARAVEL ROUTING

All Laravel routes are define in route files , which are located in the route directory ,These file are automatically loaded by the framework. The most basic…

Read More

MVC (MODEL VIEW CONTROLLER)

MVC stands for Model–view–controller. The MVC is an architectural pattern model that seprates an applications into three logical components.(Model , View, Controller) MVC was first introduce in…

Read More

ReflectionException : Class BlogsTableSeeder does not exist

When i type php artisan db:seed command. It’s showing this type of errors. [ReflectionException]Class UserTableSeeder does not exist Here is my BlogsTableSeeder <?phpuse Illuminate\Database\Seeder;class BlogsTableSeeder extends Seeder{…

Read More
Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Hairstyles
4 years ago

Somebody essentially lend a hand to make significantly posts I would state. This is the very first time I frequented your web page and to this point? I amazed with the analysis you made to make this particular submit extraordinary. Wonderful process!

1
0
Would love your thoughts, please comment.x
()
x