What is the best way to setup lamp in wsl, and where should i put codes that easy for atom to edit - server

I am a developer that used windows 10 and all my tools are installed in windows 10 such as atom, laragon, gitbash.
here's the scenario,
since I am using laragon as a server on windows 10, I put all my codes in c:/laragon/www. so that when i visit my website at localhost, codes found in www is located and serve to localhost.
now i try wsl on windows, when i installed lamp, my code should reside in /var/www/. the problem with this i can't use atom which is installed in windows to edit code found in /var/www.
my question is, since i been looking for good article at google that best discuss to setup php development using wsl.
What is the best way to setup lamp in wsl, and where should i put codes that easy for atom to edit.
sorry if i don't know this, because i really don't know, and i been looking for this for almost a month now.

I would highly advise against doing this.
Use WSL to mount C:\laragon\www and edit the files within the windows filesystem using atom but even then, it may be best to just completely use the windows environment.
Microsoft have issued warnings that you can edit windows files from inside WSL, but should not under any circumstances edit WSL/files within the ubuntu underlying filesystem from windows [1].
Speaking from experience on trying to set up web services, be it a MERN stack, meteor or a LAMP stack on WSL, I have also had a lot of issues with permissions on starting database services.
1 : https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
Steps to hosting LAMP in WSL with the files to be served in windows to be edited by windows tools;
Mount a windows directory (If you haven't already)
Update your Apache / LAMP stack configs to point at the mounted directory;
See this article for some good info. https://www.digitalocean.com/community/tutorials/how-to-move-an-apache-web-root-to-a-new-location-on-ubuntu-16-04
Restart Apache and if needed, other LAMP related services. (The above article covers this as the last step anyway)

Related

Visual Studio Code remote access to a WSL2:ubuntu on my desktop from my macbook

've looked around and can't seem to find the answer to this - probably because the feature is pretty new.
I tried the remote WSL:ubuntu connection on my windows desktop machine to connect to my WSL2 Ubuntu running on the same machine. This is pretty much perfect as it allows access to my Nvidia GPU under linux
Is there anyway I can do the same trick from my macbook? I can connect to the windows side of the desktop using the new remote tunnel feature but I'm drawing a blank on how to do for the WSL buried in that machine. It looks like it's just using the same remote connection feature so I'm thinking it should be possible but WSL2 network is not exposed the same way you can with a VM or other machine.
The desktop has way more everything than my macbook including a nvidia GPU I want to use for some machine learning.
I can do it from the desktop itself - but it's nice to be able to use that machine from my macbook at certain times of day.
I have recently started using VSCode so I'm on the learning curve with it - it may well be that it's not possible using the new remote tunnels - or requires some messing with adding a new hyper-v bridged adapter to the WSL installation. I'm hoping against hope there's an easy solve that I've somehow missed.
I tried setting up the remote tunnel as per https://code.visualstudio.com/blogs/2022/12/07/remote-even-better but it seems to setup a server to access windows not the WSL2 service.
Thanks for any help!
I had a similar problem and found this github issue. While the developers are looking into including this feature, you currently will need to install the VSCode CLI directly in WSL. You can find the downloads here
Notes
I would recommend the x64 CLI download in the Linux section. It will download a tar.gz file which will have a file named code in it when extracted.
The tunnel will launch from wherever you place that code file, so I put mine in the ~/ (home) directory.
You can then open a tunnel using the command ./code tunnel from that location. You can replace the . with the path to the code file to open the tunnel while in a different directory, i.e. ~/code.
You can still launch a tunnel from Windows with code tunnel. (note that this command does not have ./)

How to offline install vscode-server for windows remote target

I've been able to follow similar answers for offline installing vscode-server on remote linux targets but I cannot find out how to do this for windows. On the official page for vscode-remote-ssh https://code.visualstudio.com/docs/remote/ssh, it shows that the system requirements for the remote supports Windows 10 / Server 2016/2019 (1803+) using the official OpenSSH Server. So I know it's possible I just can't seem to find the download link that vscode-remote-dev uses to download the windows version of vscode server.
The download link for linux follows this format https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable would there be a specific endpoint for server-windows? I've tried a bunch of different combinations but I could not get anything.
I'm also making the assumption that there is a different download link but it seems a very unlikely case that linux and windows share the same link.
Any help would be appreciated. I've enjoyed using this for remote dev on linux and now I've got an opportunity to use it on windows.
Instead of using server-linux-x64, server-win32-x64 should be used and it will download the correct windows version of the vscode-server.
I did find this in the comments of this question. Using "Remote SSH" in VSCode on a target machine that only allows inbound SSH connections.

How to run eclipse on AWS

I have successfuly run rStudio on Amazon Web Services and it is extremely useful.
I want to run eclipse on AWS as well. When I type this in to google most tutorials are about the eclipse plugin. That's not what I want. I want to run eclipse on AWS.
I tried setting up an instance on EC2 which allowed me to run windows server 2012 but I couldn't install anything because of various internet explorer configuration issues and anyway I hat windows. I also tried a remote linux installation but its not really what I want. I want to run eclipse so that I can access it from a public DNS in the same way that I have managed to do with rStudio. Is this possible. Are there other (even non-AWS) ways?
I presume that by "AWS" you are actually referring to Amazon EC2 virtual machines.
Installing software on an Amazon EC2 instance is no different to installing on any other computer -- it's the same copy of Microsoft Windows you would use elsewhere.
The difficulties you mention of running Internet Explorer on Windows 2012 is entirely part of Microsoft's (rather strange) security settings that discourage using Internet Explorer as a system administrator, in order to combat security weaknesses that people try to exploit. Windows 2012 will no longer be supported by Microsoft in 2018.
I recommend using Windows 2016, which does not seem to impose such restrictions. It's also a newer, supported operating system that matches Windows 10.
Then, just install the software as normal and things will work a lot better for you.
Update:
You're right -- IE has problems on Windows 2016 but they are different to what is happening on Windows 2012 (last time I looked).
To get around the silly Microsoft IE security:
Run Server Manager
Go to Local Server
Click IE Enhanced Security Configuration ("On")
Turn both settings off
Internet Explorer then works and you can install Eclipse.

Upload and Deploy Golang application to VPS

I've made a Go app and when I run the exe locally it works fine. Where would I upload this to on my VPS? public_html/domain.com/somefolder ? or /usr/somefolder with SSH?
I have my app, my .exe and src-files, but what do I do with it when I deploy online on my VPS? I haven't been able to find a tutorial about this, so I hope you can help me.
do I upload all files in my src folder including the binaries from when I've written "go build"?
upload to where on my VPS? using ssh or cpanel / ftp program or what?
What are the steps from "go build" on your own local windows 8 computer to uploading and running it online on a linux server?
Ps.
Additionally will CentOS 5.1.1 although not supported https://golang.org/doc/install - allow for me to run an already linux compiled go program on my VPS, and does it only mean that I cannot install Go and do compilation on the CentOS 5.x server? Would CentOS 5.1.1 explain the "segmentation fault" error shh gives me when running the command "./[filename]"?
Well, usually, you would:
Copy the binary you created + all resource files (html, css, images, ...)
(optionally the source code as well)
Have a way to ensure the program keeps running
crontab can be used to check if your program is alive, but a simple monitoring program would suffice as well (which you can write yourself)
Run the binary as a non-privileged user
(you can also combine it with something like Docker if you want)
It does not make sense to put it inside public_html/domain.com/somefolder, as it is not public html code. You'd want your files somewhere they cannot be accessed unless using the application/binary you created.
My apologies for not having neat source links to my story. However, this does seem like the best thing to do.
Another important note:
Even though your VPS may run Windows, you can also deploy linux binaries to a Linux VPS (which are drastically cheaper) - looking at this SO question.
A short note I wrote on writing golang app on osx and deploying on Linux server: http://kumargaurav.co/2016/08/10/deploy-go-lang-app-linux-server/

How to host the OpenStreetMap Locally

I want to host the OSM (OpenStreetMap) locally. I need the basic idea what are required for hosting the OSM and how the task can be done in a step wise manner. I have to host it in Windows7 environment.
Any kind of help will be useful.
switch2osm contains detailed instructions and requirements for setting up a OSM server. If you have a Windows system then better set up a Linux VM inside it.
A bit too old but I will just put it here for someone who is searching for the same thing.
An exact instance of OpenStreetMap can be hosted locally by following the installation guide of OpenStreetMap.
Quoting from the Link:
"These instructions are designed for setting up The Rails Port for development and testing. If you want to deploy the software for your own project, then see the notes at the end.
You can install the software directly on your machine, which is the traditional and probably best-supported approach. However, there is an alternative which may be easier: Vagrant. This installs the software into a virtual machine, which makes it easier to get a consistent development environment and may avoid installation difficulties. For Vagrant instructions, see VAGRANT.md.
These instructions are based on Ubuntu 12.04 LTS, which is the platform used by the OSMF servers. The instructions also work, with only minor amendments, for all other current Ubuntu releases, Fedora and MacOSX
We don't recommend attempting to develop or deploy this software on Windows. If you need to use Windows, then try developing this software using Ubuntu in a virtual machine, or use Vagrant."