slashrelativepath / relativepath-cycle-5

Source repository for Relative Path Cycle 5
3 stars 0 forks source link

Linux Webserver updates #9

Open eld120 opened 9 months ago

eld120 commented 9 months ago

As we use a variety of different linux distros within our cohort we will need to update the current webserver-linux.sh script to account for the various package managers (apt vs pacman for example) or create separate shell scripts based on the package manager present on the OS. Currently the webserver-linux.sh script is written for Arch.

eld120 commented 9 months ago

Doing a bit of testing targeting a bare bones ubuntu container. The Arch script within webserver-linux.sh is not working for me within a blank container. I should note that containers seem to be shipped without a lot of pre-installed software that one would usually find (vi/vim/nano or even snapd on ubuntu) and that has been a bit of a challenge.

Another note/heads up for windows users: I'm also running into issues with file formatting - it's important to save files that are going to be run in an linux environment with unix style line endings (LF) instead of the windows default (CRLF). Our shell scripts have failed a number of times just because I've copied over a valid shell script with the incorrect line endings and I've received the following error output:


checking if Nano is installed
./webserver-linux.sh: line 3: syntax error near unexpected token `$'\r''
'/webserver-linux.sh: line 3: `if ( which nano ) ```
eld120 commented 9 months ago

The fix is to simply save the file with LF line endings, the toggle can be found here in VS Code, other editors may be different: image