Scenario: Wanting to add a virtualhost file to Apache2, which was installed using apt while in bash
Assumption: /etc/apache2 in bash maps to %HOME%\AppData\Local\lxss\rootfs\etc\apache2
- Opened a Windows-linux bash shell
- Installed apache2 (sudo apt-get install ...)
- Wanted to add a virtual host file that had been used on another dev machine
- Decided that editing files with vi in the bash terminal was too annoying :)
- Found the matching "sites-available" folder via Win10 File Explorer.
- Copied an existing virtualhost file itno that folder
- Checked, in bash, that the new file was there. No sign of this file.
- As an experiment, created, in bash, a test file (in sites-available): sudo vi test.conf
- Added some random text and save it
- The file is visible in Win 10 File Explorer (as well from a stand Windows cmd shell)
- I was able to edit that file in Windows, and back in bash I can see the changes in the test file
- Created, in bash, a new vhost file (sudo vi host.org.conf). Added a comment
- I was able to edit this file back in windows.
- In bash, sudo vi host.org.conf gave "Permissin denied" (in vi)
- In the Windows cmd shell renamed host.org.conf to host.conf
- In bash, ls still shows host.org.conf
- In bash, sudo vi host.conf works (says "[New File]")
- But attempts to save that file give an error: "E212: Can't open file for editing"