Laravel installation on windows part 2 — Virtual Host

hasan rosidi
1 min readApr 22, 2020

--

  1. After basic on part1 , we can set up a virtual host on xampp.

short stories why we use an virtual host instead of using artisan server, because we need to set up this project on production server later.

2. Open the windows explorer and go to the xampp>apache>conf>extra folder. Find the “ httpd-vhosts.conf “ file. Open with your text editor and copy down from the commanded example ( marked by ## ) make some changes.

##<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host2.example.com
##DocumentRoot "/xampp/htdocs/dummy-host2.example.com"
##ServerName dummy-host2.example.com
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
##</VirtualHost>
<VirtualHost *:80>
ServerAdmin johnDoe
DocumentRoot "D:/xampp/htdocs/project_folder/public"
ServerName project_folder.local
<Directory "D:/xampp/htdocs/project_folder/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>

3. Go to C:\Windows\System32\drivers\etc folder you will see “ hosts “ file. Open hosts as Administrator. Add “ project_folder.local “ your hosts file and save and restart the apache service on xampp control panel.

# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
127.0.0.1 project_folder.local

4. Finally we can run “ project_folder.local ” from the browser

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

hasan rosidi
hasan rosidi

Written by hasan rosidi

0 Followers

Simply Developer, Malang , Jawa Timur, Indonesia

No responses yet

Write a response