Move from xampp to Laravel Homestead: installation and opening projects - ssh

I want to move two Laravel projects from xampp local environment to Homestead environment.
I followed laravel instructions, set up homestead and created a new project. However,getting an error message when trying to access ssh vagrant in the second homestead folder.
My new installed laravel project is in directory C:\Projects\Project
My homestead was installed in directory C:\Users\tom\Projects_lar\Homestead
For my first project I went to "vagrant ssh" through gitbash and created a new laravel project from there and automatically it appeared also in C:\Projects
Then I tried to git clone a second project after typing SSH vagrant, but the second project did not appear.
So then I created one more homestead and one more laravel project:
C:\Projects\Project2
C:\Users\tom\Projects_lar\Homestead2
Then I could run two laravel projects at the same time, but
I cannot access vagrant ssh in homestead2, it says:
A VirtualBox machine with the name 'homestead' already exists.
Please use another name or delete the machine with the existing
name, and try again.
I also tried to replace files inside C:\Projects\Project with files from my project in local xampp environment, but got an error:
! ) Warning: require(/home/vagrant/Project_lar/Project1/vendor/composer/../symfony/polyfill-ctype/bootstrap.php): failed to open stream: No such file or directory in /home/vagrant/Project_lar/Project1/vendor/composer/autoload_real.php on line 66
Call Stack
Time Memory Function Location
1 0.0016 401952 {main}( ) .../index.php:0
2 0.0049 402216 require( '/home/vagrant/Project_lar/Project1/vendor/autoload.php' ) .../index.php:24
3 0.0054 402896 ComposerAutoloaderInitf2c3bc37946cfa48d88d179975fa8f9f::getLoader( ) .../autoload.php:7
4 0.0077 407496 composerRequiref2c3bc37946cfa48d88d179975fa8f9f( ) .../autoload_real.php:56"*
I am not very good with virtual set ups yet. Questions:
How should I set up 2 new laravel projects?
How do I replace those two projects with my actual projects which currently I have in local xampp environment?
Update: I tried to edit project and project 2. It seems to be one and the same project, not two projects.
I am on windows 10.

Homestead aims to be a singular virtual machine that allows you to develop all your projects. You do not need to create an entirely new vagrant box instance for every project, instead I would encourage you to use shared folders. Please see the documentation.
Essentially, you are creating a folder that both the the host and the guest OS may use. The steps for adding a shared folder are as follows (explained in more depth in the docs as well):
Edit the Homestead.yaml and add your desired path, for example like so:
folders:
- map: ~/code/project
to: C:\Projects\project
Then you must run the command vagrant --provision in the homestead folder to let these changes take effect.

Related

How to force OpenAPI Generator CLI to use pre-downloaded .jar file?

I have installed (via npm) openapi-generator-cli on my WSL running Ubuntu 22.04 image, with correctly configured HTTP_PROXY and HTTPS_PROXY environment variables.
The problem is, running any command (including sudo openapi-generator-cli help) results in OAG-CLI attempting to download the .jar file from maven.org, which end with connection getting refused for unknown reason (SSL cert not listed as trusted? WSL-exclusive bug? corporate proxy having an edge case?).
Instead of dealing with all that, I realised I can just download the latest (as per official website) .jar file:
https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.2.1/openapi-generator-cli-6.2.1.jar
via browser and place it manually for OAG-CLI to use.
I have edited the auto-generated openapitools.json just so:
{
"$schema": "node_modules/#openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "6.2.1",//same version as .jar
"storageDir": "."//see below
}
}
Unfortunately, despite placing two copies of the .jar file (one named openapi-generator-cli-6.2.1.jar, one named openapi-generator-cli.jar) in both the "current" folder and /usr/libs/openapi, and trying the following values for storageDir:
.
./
/usr/libs/openapi
/usr/libs/openapi/
~/usr/libs/openapi
~/usr/libs/openapi/
every single run of sudo openapi-generator-cli help resulted in an immediate Downloading 6.2.1 ... message (followed by connection refused error some time later).
What else do I need to do to make OAG-CLI use the .jar within storageDir instead of trying to download a new copy?
(Answer containing just the structure and contents of a folder created by "storageDir": "~/foo" would allow me to reverse-engineer a working setup.)

"Windows Subsystem for Linux has no installed distributions" even though 'Ubuntu' is installed

I recently moved my wsl directory to another drive due to low storage in C: drive. As per the answer provided in this StackOverflow post, I used lxrunoffline tool and moved my Ubuntu distribution to another drive (E:\wsl in my case). As soon as the distribution was moved successfully, I ran wsl to test and it worked like a charm.
Everything went fine until one day I accidentally renamed the E:\wsl folder to something else. Well, as expected, wsl didn't work. Then, I reverted back to the name wsl and expected it to work but to my surprise, it didn't find any installed distribution after that even though it's installed... ๐Ÿ˜•
E:> wsl
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
Is there any way to revert back to the old directory or make wsl point to a manual location?
EDIT: I don't want to reset Ubuntu as I want to retain the installed packages and preferences...
Well, I finally found a solution to this problem. ๐Ÿ˜Š
This is as simple as registering the distribution using lxrunoffline tool using the rg or register command.
E:\LxRunOffline\LxRunOffline-v3.3.3>lxrunoffline rg
[ERROR] the option '-d' is required but missing
Options:
-n arg Name of the distribution
-d arg The directory containing the distribution.
-c arg The config file to use. This argument is optional.
After running the register command, I was able to start wsl as usual. But that would log you in as a "root" user and would thus start in "/root" directory. I ran the following command to start wsl as different user (this is for Ubuntu):
ubuntu config --default-user <user-name>

Cannot install Kaltura oflaDemo on CentOS7

I'm currently setting up a Kaltura streaming server on CentOS 7 with mariaDB. When I come to the point the installation manual requires me to install oflaDemo via browser, I only get an empty list. No connection errors occour. The debug output states:
Host: vstream-dev.my.domain
Trying to connect
Net status: NetConnection.Connect.Success
Got the application list
Got the application list
Got the application list
So, in theory there shouldn't be a problem.
Firewall is down for testing/devel
SELinux is off (permissive)
The only error that ocoured during the installation process was packet mysql-server is not installed. But the manual states that I should use mariaDB on CentOS 7.
I tried to clone https://github.com/Red5/red5-examples and link the ofla Demo folder to /usr/lib/red5/webapps/ with no success.
Ok, I solved it.
What I did:
I cloned the repo with the red5 examples: https://github.com/Red5/red5-examples and navigated into the subfolder oflaDemo (with pom.xml).
Then I had to install maven with
yum install -y maven
and do a maven build
mvn clean install
After that, I was able to grab the file target/red5-example-oflaDemo-2.0.war. I extracted this file into a folder oflaDemo in /var/lib/red5/webapps and restarted the server. Finally, I did mkdir /usr/lib/red5/webapps/oflaDemo/streams to create a folder for the streams.
After that, I was able to navigate to the demo via
http://my.domain:5080/oflaDemo/

Lucee Express on local Dev

Iโ€™m currently running window 7, ACF 11, and IIS 7 and would like to install Lucee express to try.
Iโ€™m having the hardest time getting Lucee to work on my local desktop. I followed this article http://www.gpickin.com/index.cfm/blog/setting-up-lucee-in-my-dev-environment-changing-ports I canโ€™t get the Lucee welcome page to work.
I download the Lucee Express from here http://lucee.org/downloads.html
I extract the file to C:\lucee
Ran the C:\lucee\bin\startup.bat
Navigated to 127.0.0.1:8888
I get the follow message: Firefox can't establish a connection to the server at 127.0.0.1:8888
Can someone tell me what am I doing wrong? Thank you in advance for your insights.
As identified in the comments on the question: you are missing the environment variable pointing to your Java runtime (you need one of JAVA_HOME or JRE_HOME.
This can be achieved in one of a coupla ways.
Set it globally:
Control Panel > System > Advanced system settings > Environment Variables > System Variables > New...
Or set it for just that environment by editing the startup.bat file you've already been using:
SET JAVA_HOME=[path]
In both situations you need a path to either a JRE or a JDK. You say you have CF11 already installed, so you can simply point to its one, which will be a subdirectory of your CF install, as Leigh points out above. So something like:
SET JRE_HOME=D:\apps\Adobe\ColdFusion\11\express\jre
If you have a Java JDK installed instead and want to use that, use JAVA_HOME instead of JRE_HOME, eg:
SET JAVA_HOME=D:\apps\Oracle\Java\jdk\1.8.0_60
As these things can be installed anywhere, you'll just need to locate 'em and use the path accordingly. You want to point it to the top level directory of your JRE or JDK, which contains the bin subdirectory.

How to open Virtual Box on Windows 10

I am unable to access the virtual box that I initialized with the "vagrant up" command. I now get this:
[C:\web\Homestead]vagrant global-status
id name provider state directory
------------------------------------------------------------------------
13650ef default virtualbox running C:/web/Homestead
The above shows information about all known Vagrant environments
on this machine. This data is cached and may not be completely
up-to-date. To interact with any of the machines, you can go to
that directory and run Vagrant, or you can use the ID directly
with Vagrant commands from any directory. For example:
"vagrant destroy 1a2b3c4d"
[C:\web\Homestead]vagrant ssh 13650ef
C:/web/Homestead/Vagrantfile:4: warning: already initialized constant
....
The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:
The executable 'cygpath' Vagrant is trying to run was not
found in the %PATH% variable. This is an error. Please verify
this software is installed and on the path.
I am running Windows 10 and set my environment variables, as follows:
Path c:\php;C:\Program Files\Oracle\VirtualBox;
C:\Program Files\Git\usr\bin;C:\cygwin64;
C:\Users\Kevin\AppData\Roaming\npm
The cygpath file it seeks is clearly under both c:\Program Files\Git\usr\bin and under C:\cygwin64.
I tried to access the virtual box through Putty, but got the simple message "connection refused". I have used Puttygen to convert the ssh keys to Putty ppk files.
I have tried to retrace my steps initializing the virtual box, but I fail to see how to step forward and open the box.
Should I destroy my virtual box and start over?
Try to change the PATH paths with 'Program Files' to Progra~1 paths or to wrap each path item with double-quotes, e.g.:
Path c:\php;"C:\Program Files\Oracle\VirtualBox"; "C:\Program
Files\Git\usr\bin";C:\cygwin64; C:\Users\Kevin\AppData\Roaming\npm
or
Path c:\php;C:\Progra~1\Oracle\VirtualBox;
C:\Progra~1\Git\usr\bin;C:\cygwin64;
C:\Users\Kevin\AppData\Roaming\npm