www-data node in its folder

This commit is contained in:
Valentin 2024-02-26 15:16:53 +01:00
parent 0cc3dc535f
commit 4482a9acfc
1 changed files with 7 additions and 9 deletions

View File

@ -192,19 +192,17 @@ read answer
if [[ "$answer" == "y" ]]; then
touch /var/www/.bashrc
chown www-data:www-data /var/www/.bashrc
mkdir /var/www/.nvm
chown www-data:www-data /var/www/.nvm
mkdir /var/www/.npm
chown www-data:www-data /var/www/.npm
mkdir /var/www/node
chown www-data:www-data /var/www/node
su -s /bin/bash -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash &&\
export NVM_DIR="$HOME/.nvm" &&\
export NVM_DIR="$HOME/node/.nvm" &&\
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" &&\
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" &&\
nvm install v18' www-data
ln -sf /var/www/.nvm/versions/node/v18.19.1/bin/node /usr/bin/node
ln -sf /var/www/.nvm/versions/node/v18.19.1/bin/npm /usr/bin/npm
ln -sf /var/www/.nvm/versions/node/v18.19.1/bin/npx /usr/bin/npx
ln -sf /var/www/node/.nvm/versions/node/v18.19.1/bin/node /usr/bin/node
ln -sf /var/www/node/.nvm/versions/node/v18.19.1/bin/npm /usr/bin/npm
ln -sf /var/www/node/.nvm/versions/node/v18.19.1/bin/npx /usr/bin/npx
echo -e "${PURPLE}${BOLD}Node installed${RESET}";
fi
@ -364,7 +362,7 @@ if [[ "$answer" == "y" ]]; then
echo \"URL=https://${domain_name}\" >> .env &&\
echo \"DIRECTUS_URL=https://cms.${domain_name}\" >> .env &&\
tmux send-keys -t directus C-c &&\
npx nuxi@latest init &&\
npm install -y &&\
NUXT_TELEMETRY_DISABLED=1 bash -c \"npm run build\" &&\
tmux new-session -d -s front &&\
tmux send-keys -t front \"cd ${front_directory} && node .output/server/index.mjs\" C-m &&\