Skip to content

Instantly share code, notes, and snippets.

@Neurogami
Last active September 13, 2016 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Neurogami/98b2cf02c7638c1634fd96d82946ce42 to your computer and use it in GitHub Desktop.
Save Neurogami/98b2cf02c7638c1634fd96d82946ce42 to your computer and use it in GitHub Desktop.

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

  1. Opened a Windows-linux bash shell
  2. Installed apache2 (sudo apt-get install ...)
  3. Wanted to add a virtual host file that had been used on another dev machine
  4. Decided that editing files with vi in the bash terminal was too annoying :)
  5. Found the matching "sites-available" folder via Win10 File Explorer.
  6. Copied an existing virtualhost file itno that folder
  7. Checked, in bash, that the new file was there. No sign of this file.
  8. As an experiment, created, in bash, a test file (in sites-available): sudo vi test.conf
  9. Added some random text and save it
  10. The file is visible in Win 10 File Explorer (as well from a stand Windows cmd shell)
  11. I was able to edit that file in Windows, and back in bash I can see the changes in the test file
  12. Created, in bash, a new vhost file (sudo vi host.org.conf). Added a comment
  13. I was able to edit this file back in windows.
  14. In bash, sudo vi host.org.conf gave "Permissin denied" (in vi)
  15. In the Windows cmd shell renamed host.org.conf to host.conf
  16. In bash, ls still shows host.org.conf
  17. In bash, sudo vi host.conf works (says "[New File]")
  18. But attempts to save that file give an error: "E212: Can't open file for editing"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment