Magento 2 development environment on local server - testing

I need to create a local development environment and struggling a little with the setup. I want to replicate my live server as close as I possibly can.
I want to install Magento ver 2.1.8, running MySQL 5.6, PHP 7.0 with NginX and Debian.
Now, it would be more than one person which will be working on the development sites, therefore, it will have to stored on our local server.
We are working on Windows 10 Pro machines.
I had a look at tools such as VirtualBox, Vagrant and Docker but reading about them got me even more confused.
I had a brief look at the LAMP stack too. Could you recommend the best way to go for my situation?
Do I have to use these tools in combination with each other?
Do I have to install the software on each computer or on local server?

I recommend to use this docker container: https://github.com/yvoronoy/magento2docker
It uses apache but you can change it via editing Dockerfile. Main advantage in this container is configured sshfs mounting in MacOS which works a little bit faster that default mounting, and you can work with source code as you work on local instance.

Related

Host Nuxt.js and Express.js On Ubuntu server via putty and run it all the time

I have done a project for BE and FE (Express.js and Nuxt.js), but when it build and run it via putty on ubuntu server, this is what I get
Is that a way to make it live using Putty?
And what happens if I close Putty, will Express and Nuxt still be running on the server?
This is not a conventional way of exposing something to the Internet since it's not publicly facing the Internet (the only way right now to have access to your apps is to know the IP of the server, username + password of the SSH account).
Also, you're running the server in dev mode here, not something optimized in terms of speed.
You will need to use yarn generate (or yarn build) then yarn start on Netlify, Vercel or any platform like that for your Frontend (free service usually if using SSG).
Here is a whole list of places and how to host there for the frontend: https://nuxtjs.org/deployments
As for your backend, you may host it on Heroku, Render.com, Railway or any place of your choice (with a Node.js available).
Even a bare metal SSD can be good for such but it will require more setup overall.

Is there a fast painless way to setup a linux distro on VirtualBox?

I like the Docker Hub with dockerfiles idea very much.
Is there a similar way to get a small working linux VirtualBox instance in a few commands, that could also be controlled from a command line?
Vagrant is a great tool that does just what you want and much more! It's a ruby application written for fast and simple setup of minimal development environments.
By default it creates VirtualBox images, but it supports VMWare and many others too. The whole setup of a box is managed by a single Vagrantfile! Your vm options, network settings and provisioning is done there.
Setting up a virtualbox box is as easy as executing just two shell commands. Checkout the Getting Started Guide for an example using Ubuntu.
You can use a vast range of prepared images from the Hashicorp Atlas or build your owns.
Also, vagrant doesn't limit you to one virtual machine per development setup, it enables you to model cluster setups on a single machine using multiple vms. I myself use docker for that part though.
Edit: fixed a typo :<

PhpStorm and other Tools in a Virtual Machine

I am developing php applications at my work.
The development server runs in a ubuntu vm, but on the host machine runs windows 7 os.
I keep running into problems with windows as a development environment and i am missing
some linux features. Unfortunately, I can not install another operating system on the host.
Now I wonder if I should install all my dev tools (like phpstorm) in another virtual machine
and do my work there. Does it make sense or will i get performance issues?
This is the perfect use-case for Vagrant.
Create and configure lightweight, reproducible, and portable development environments.
From the official website.
It can be controlled with PhpStorm and it is perfectly lightwight.
I am using PhpStorm, Vagrant & Puppet with nginx, php and mysql, XDebug and I am quite happy with it, quite powerful and very easy to deploy.
EDIT
And this is awesome blog post by James McFadden on Using Vagrant and Puppet to build a PHP, Nginx and MySQL environment and you can find numerous others with apache or any other tool you might need.
DECLAIMER: The step with replacing my.cnf didn't work for me so I could advice you to just skip it.

How install Wordpress in a EC2 machine?

I have an EC2 instance running with Glassfish Server Open Source Edition.
And now I need to setup the a website in wordpress.
How can I do that ?
I'm looking for 5 minutes installation tutorial but I'm stuck in the part where it's says about the webserver.
I have to install the Apache in Linux then enable the FTP access ? (to upload the wordpress files ? )
For now I'm stuck in this part guys, any tip is very welcome.
Ok. This is going to be a bit of a high level overview of what you need to do. Its a long process which you need to look into.
Glassfish server is (afaik) for Java applications. Wordpress is a PHP/mysql based system.
Apache is a free and open source web server which you can use, which integrates with php and mysql nicely. What you need is called a LAMP setup (LAMP stands for "linux, apache, mysql and php). You haven't specified what your EC2 is running (what linux distro) but lets say its Ubuntu. A quick search for "installing lamp ubuntu" on google turns up many different tutorials and walkthroughs for installing a lamp setup on your machine.
You'll need SSH access (which you'll have with EC2) then if you run through your tutorial of choice you'll have a working web server, you'll specify a public_html directory (usually by default /var/www).
Now to install Wordpress. What you could do is install an FTP server. This is going to be relatively complicated though, however it will be the easiest way to install Wordpress. Install FTP and upload the wordpress files to the public html directory, then you will be able to run through the 5 minute install process using the mysql database credentials you set up in the LAMP tutorial.
An easier way to do what you need to do is to install subversion on your EC2 instance - e.g. sudo apt-get install subversion on ubuntu. That way you can svn export the wordpress repository to your public html folder (http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion).
However, without an FTP server running on your EC2 instance you won't be able to FTP in to modify files or anything. You'll have to do everything over SSH (or SFTP) which may or may not be manageable for you.
In all honesty, and with the utmost respect, if you don't know about apache and installing a LAMP server and such then you're probably a bit out of your depth with Amazon's EC2 server. You'd be better off with a dedicated server from a hosting company who will have installed everything you need.

Production Grade Server Software

I am currently using XAMPP to test and Run my website on my Laptop.
Is there any (Good,Production Grade,Free,AMP based) server software?
Or Can I manually fix the security holes in XAMPP (like no password for 'root') to bring it up to production level?
Platform : Windows
Technologies: Apache, MySQL, PHP
Requirements: Hosting on Own server
Priveleges: Easy installation and configuration
You're best off just setting things up yourself. It's not that difficult, especially since there are scores and scores of guides around the web. Trying to bring XAMPP up to production quality would be just as much work. Here are some links:
Ubuntu LAMP
Debian LAMP
Fedora LAMP
Arch Linux LAMP
WAMP (Windows)
You can easily find more by doing a Google search.
Why not simply use official Apache? It's the most-used Production http server in the world.
Can you expand your question with details on your platform and requirements?
You would be better off configuring the full stack yourself. This ensures that you know what's running, and how it's configured. Even if you use a bundle (I highly recommend Zend Server if you do), you would need to run through the service configurations anyway. Never rely on anything out-of-box in a production environment.
If you do configure the stack yourself, Google is your friend, and there are plenty of resources here to help as well.