I am sort of new in web development and so sorry if the question is a little out of place or too simple. I just finished developing my first web application using Laravel and it is meant to be used as an intranet application for a specific facility. I developed the application on my windows machine, and now we are moving forward with deployment, I have remote access to the server of the facility (windows server 2012). However, the server does not have internet connection so I can only copy, paste (or any other offline operation), and so I installed XAMPP offline and simply copy pasted the project files in the htdocs directory of the server, then I added the server name in the following files "C:\xampp\apache\conf\extra\httpd-vhosts" "C:\Windows\System32\drivers\etc\hosts" like so:
in "C:\xampp\apache\conf\extra\httpd-vhosts"
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/proj/public"
ServerName www.something.com
</VirtualHost>
in "C:\Windows\System32\drivers\etc\hosts"
127.0.0.1 localhost
127.0.0.1 www.something.com
After doing so the application starts normally, but of course the database needs to be configured as well in the server, and so here are my questions: 1-Is this the right way to go about doing something like this, or is there a better way of doing it (in terms of overall criteria such as security, maintainability....etc)? 2-If this is the right way, then should I just copy paste the database from my machine to the server or should I ask them to provide internet access to the server so that I can install composer, git and other tools that allows me to automatically generate the database from the code? 3-If i continue using it this way modifying the code will be extremely tiresome, since every time I edit something I will have to follow which files were edited in my machine and correspondingly change them in the server, and so what is the right way to go about maintaining the application? Or is it only possible using internet connection in the server?
I am sorry if the question is too long I am just new in this and would like to get an overall idea on deployment of web applications, of course if there is any other way of doing this that is totally different I am happy to know about it.
You should have the required info for database connetction, such as host, port, username, password and database name.
Once you have them, just edit the .env
file in your remote project directory to match those info.
Then run php artisan migrate
which will create the database and all the tables. You don't need internet connection to do that.
Since your remote machine doesn't have internet connection, you can just copy all files from your local directory to the remote machine. Composer will just install everything into the vendor
directory, but if you copy it as well you don't need to run composer
.
To speed up the process a little you can use WinSCP that will allow you to synchronise your local and remote directory. Of course this is not a best practice, but in your case is a huge help.