Issue
Hi I have an exchange project developed in laravel and I want to deploy it locally for 1 or 2 pc basically sometimes it is one pc what is the efficient way to deploy it for end-user in my case end-user is not educated that much to start laravel artisan server and so on Thanks in Advance. I use Wamp for apche and mysql
Solution
Use xampp if windows. And set it to auto run on lauch and boot so there will be no user interaction required. And use the vhost configuration of apache inside xampp to make the laravel project available to everyone.
You can edit the VHost file located in xampp/apache/conf/extra
Now add this line to the very bottom of the file:
<VirtualHost *:80>
DocumentRoot “C:/xampp/htdocs/yourProject”
DirectoryIndex index.php
ServerName laravel-gkb.test
<Directory “C:/xampp/htdocs/yourProject/public”>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
In the example above, “yourProject” is the folder of your project and you can change the path of your project. Normally you’d put the project folder in htdocs folder located inside xampp folder. The “*” is just telling that this should be accessible through the machines IP address and it is pointing to the projects public folder where the index.php (main index) file is located. So now if you write your machines IP, it should technically run your application. Read on how to install and setup xampp here
Goodluck
Update
If the users are not that experienced to run artisan serve command, write a bat file in windows which will allow them to run the serve command and keep the project in one pc so everyone can access the project using that machines IP. If for some reason you’re not able to access the IP, check firewall options. Install php, register it in path/environment of windows and write a bat file which will look something like this (warning. Not tested):
@echo off
php artisan serve —host=192.168.1.101 —port=8000
Now save the file as .bat file and you can run this file to run serve. Host is the machines IP. You can set a static IP for that machine if you don’t want it to change. And port you can set to whatever you want. This is just an alternative. Howevet, I would still go for wamp or xampp
Answered By - Mohamed Ahmed Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.