sh Uberspace 7 Neos安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh Uberspace 7 Neos安装相关的知识,希望对你有一定的参考价值。
# Neos on Uberspace 7
## Synchronized Bash Scripts on Login `.bashrc`
These bash file get downloaded every time I log into our [Uberspace](https://uberspace.de) servers. Like that, I can maintain the `.bash_profile` in one place.
## Installation
```bash
curl -s -L https://gist.githubusercontent.com/jonnitto/2b4c2ae152d3b040e0ff68eda65ee21f/raw/Install.sh | bash
```
#!/bin/sh
alias df='df -h'
alias du='du -h --max-depth=1'
alias grep='grep --color=auto'
alias mkdir='mkdir -pv'
alias head='head -n 50'
alias tail='tail -n 50'
alias ..='cd ../'
alias ...='cd ../../'
alias ....='cd ../../../'
alias ....='cd ../../../../'
alias ~='cd ~'
alias ls='ls --color'
alias ll='ls --color -lh'
alias la='ls --color -lsha'
alias q='exit'
alias c='clear'
alias p='ping'
USER=$(whoami)
GROUP=$(whoami)
Context=Production
alias composer='~/bin/composer'
alias go2www='cd /var/www/virtual/$USER/'
alias flowContext='FLOW_CONTEXT=$Context ./flow'
alias flowhelp='flowContext help'
alias flushcache='flowContext flow:cache:flush'
alias warmup='flowContext flow:cache:warmup'
alias publishResource='flowContext resource:publish'
alias migratedb='flowContext doctrine:migrate'
alias noderepair='flowContext node:repair'
alias getsetuppassword='cat Data/SetupPassword.txt'
alias setcharset='flowContext database:setcharset'
alias readKey='cat ~/.ssh/id_rsa.pub'
alias readMySQLConfig='cat ~/.my.cnf'
alias installImageOptimizer='npm install -g jpegtran-bin optipng-bin gifsicle svgo'
function go2Neos {
if [ -d "/var/www/virtual/${USER}/Neos" ]
then cd /var/www/virtual/$USER/Neos
fi
}
function generateKey {
ssh-keygen -t rsa -b 4096 -C "Uberspace $(whoami)"
echo ""
readKey
}
function killcache {
flowContext flow:package:rescan
flushcache --force
rm -rf Data/Temporary/*
}
function recreateThumbnails {
flowContext media:clearthumbnails
flowContext resource:publish
flowContext media:createthumbnails
flowContext media:renderthumbnails
}
function repairpermission {
echo "Setting file permissions per file, this might take a while ..."
chown -R $USER:$GROUP .
find . -type d -exec chmod 775 {} \
find . -type f \! \( -name commit-msg -or -name '*.sh' \) -exec chmod 664 {} \;
chmod 770 flow
chmod 755 Web
chmod 644 Web/index.php
chmod 644 Web/.htaccess
chown -R $USER:$GROUP Web/_Resources
chmod 775 Web/_Resources
echo "Done."
}
function update {
go2Neos
if [ -d ".src" ]
then git pull
fi
rm composer.lock
~/bin/composer install --prefer-dist --no-dev
killcache
migratedb
publishResource
}
function writeNeosSettings {
cat > Configuration/Settings.yaml <<__EOF__
Neos:
Imagine:
driver: Imagick
Flow:
persistence:
backendOptions:
driver: pdo_mysql
dbname: ${USER}
user: ${USER}
password: '$(grep -Po -m 1 "password=\K(\S)*" ~/.my.cnf)'
host: localhost
__EOF__
cat Configuration/Settings.yaml
}
echo ""
echo "Update composer…"
~/bin/composer selfupdate
echo ""
echo ""
echo "Synchronized bash script from GitHub successfully loaded"
echo ""
rm Login.sh
#!/bin/sh
USER=$(whoami)
echo ""
echo ""
if [ -f "/home/${USER}/bin/composer" ]
then echo "Composer already installed"
else
echo "Install Composer"
curl -sS https://getcomposer.org/installer | php
mv composer.phar ~/bin/composer
fi
echo ""
if [ -d "/var/www/virtual/${USER}/Neos" ]
then echo "Neos folder already exists"
else
echo "Create Neos folder and symlink"
cd /var/www/virtual/$USER/
mkdir Neos
go2www
rm -rf html
ln -s Neos/Web html
fi
echo ""
echo "Create .bash_profile"
cat > ~/.bash_profile <<__EOF__
wget --no-cache -q https://gist.githubusercontent.com/jonnitto/2b4c2ae152d3b040e0ff68eda65ee21f/raw/Login.sh
source Login.sh
__EOF__
source ~/.bash_profile
echo ""
echo "Installation done"
echo ""
以上是关于sh Uberspace 7 Neos安装的主要内容,如果未能解决你的问题,请参考以下文章
带有 Neos CMS 的 AWS Lambda 的 bref.sh php 容器