- ad_hitech
- Posts : 7
Join date : 2020-07-26
Age : 25
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
- Posts : 19
Join date : 2020-07-25
Age : 25
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
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”.
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
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.
In this case we will access our Laravel project “laravel-gkb” with a domain
- Code:
“http:/laravel-gkb.dev/”
- Code:
C:\Windows\System32\drivers\etc\hosts.
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
- 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
- ad_hitech
- Posts : 7
Join date : 2020-07-26
Age : 25
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
Permissions in this forum:
You cannot reply to topics in this forum
|
|