Binaryfolks 2020 Dev Assignment
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
ad_hitech
Posts : 7
Join date : 2020-07-26
Age : 25

Server not loading after creating the ServerName but loading from local host Empty Server not loading after creating the ServerName but loading from local host

Mon Jul 27, 2020 9:15 am
Laravel server gets opened from localhost via XAMPP but not through my own created sever.
sujoy98
sujoy98
Posts : 19
Join date : 2020-07-25
Age : 25

Server not loading after creating the ServerName but loading from local host Empty Server issue.

Mon Jul 27, 2020 9:51 am
1. Creating local domain for your project:
In this case we will access our Laravel project “laravel-gkb” with a domain
Code:
“http:/laravel-gkb.dev/”
so you need to modify the hosts file of Windows located in
Code:
C:\Windows\System32\drivers\etc\hosts.
Note: Remember to edit the hosts file using an editor with administrator rights, otherwise you won't be able to save the changes
Then add the host using a custom host on your system, in this case we will add the 127.0.0.2 host that will be accesible as well with an alias of “laravel-gkb.dev”.
Code:
# Test Host  - Gkb labs
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# 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
# ::1 localhost
127.0.0.2 laravel-gkb.dev

2. Configure Virtual Host
The entry point of a laravel application is the index.php inside the public folder, so the desired directory for our application will be the absolute path to your project in the public folder as shown in the following example.
The virtual host needs to point out the same host declared in the hosts file of windows (in this case 127.0.0.2) at the port 80. You can create this virtual host appending the following snippet at the end of the content of the
Code:
httpd-vhosts.conf
file located in the xampp folder \xampp\apache\conf\extra:
Code:
<VirtualHost 127.0.0.2:80>
DocumentRoot “D:\laravel-gkb\public”
DirectoryIndex index.php
ServerName laravel-gkb.test
<Directory “D:\laravel-gkb\public”>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
Require all granted
</Directory>
</VirtualHost>

3. Open your project from the browser
Do not forget to restart your xampp Apache web server.
Finally, by visiting either laravel-gkb.dev or 127.0.0.2 in your browser will show the entry point of your Laravel application. Now you can start to work on your project without worrying about the local server configuration.

ad_hitech likes this post

avatar
ad_hitech
Posts : 7
Join date : 2020-07-26
Age : 25

Server not loading after creating the ServerName but loading from local host Empty Re: Server not loading after creating the ServerName but loading from local host

Mon Jul 27, 2020 11:01 am
Thanks I got it fixed by simply naming the domain from .dev to .test.An update in the chrome cause this bug

sujoy98 likes this post

Sponsored content

Server not loading after creating the ServerName but loading from local host Empty Re: Server not loading after creating the ServerName but loading from local host

Back to top
Permissions in this forum:
You cannot reply to topics in this forum