Created by Kicktemp UG / @kicktemp
empfohlen
alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy && echo ''"
$ sshkey
Copied to clipboard.
alias sshstarter="ssh p123456@123.45.67.89"
$ sshstarter
p123456@123.45.67.89's password:***
$ echo -e 'CMD + V\n' >> ~/.ssh/authorized_keys
$ chmod 0600 ~/.ssh/authorized_keys
$ exit
$ sshstarter
p123456:~ >
p123456:~ > cd html/joomla/
p123456:/home/www/p123456/html/joomla > wget https://downloads.joomla.org/cms/joomla3/3-9-0/joomla_3-9-0-stable-full_package-zip?format=zip
$ unzip joomla_3-9-0-stable-full_package-zip\?format\=zip
$ rm joomla_3-9-0-stable-full_package-zip\?format\=zip
p123456:/home/www/p123456/html/joomla > ll
insgesamt 13616
drwxr-xr-x 18 p12356 users 4096 9. Nov 00:14 ./
drwxr-xr-x 5 p12356 users 4096 6. Nov 19:23 ../
drwxr-xr-x 11 p12356 users 4096 30. Okt 01:59 administrator/
drwxr-xr-x 2 p12356 users 4096 30. Okt 01:59 bin/
drwxr-xr-x 2 p12356 users 4096 30. Okt 01:59 cache/
drwxr-xr-x 2 p12356 users 4096 30. Okt 01:59 cli/
drwxr-xr-x 20 p12356 users 4096 30. Okt 01:59 components/
-rw-r--r-- 1 p12356 users 3005 30. Okt 01:59 htaccess.txt
drwxr-xr-x 5 p12356 users 4096 30. Okt 01:59 images/
drwxr-xr-x 2 p12356 users 4096 30. Okt 01:59 includes/
-rw-r--r-- 1 p12356 users 1420 30. Okt 01:59 index.php
drwxr-xr-x 14 p12356 users 4096 30. Okt 01:59 installation/
drwxr-xr-x 4 p12356 users 4096 30. Okt 01:59 language/
drwxr-xr-x 5 p12356 users 4096 30. Okt 01:59 layouts/
drwxr-xr-x 12 p12356 users 4096 30. Okt 01:59 libraries/
-rw-r--r-- 1 p12356 users 18092 30. Okt 01:59 LICENSE.txt
drwxr-xr-x 29 p12356 users 4096 30. Okt 01:59 media/
drwxr-xr-x 27 p12356 users 4096 30. Okt 01:59 modules/
drwxr-xr-x 19 p12356 users 4096 30. Okt 01:59 plugins/
-rw-r--r-- 1 p12356 users 4883 30. Okt 01:59 README.txt
-rw-r--r-- 1 p12356 users 836 30. Okt 01:59 robots.txt.dist
drwxr-xr-x 5 p12356 users 4096 30. Okt 01:59 templates/
drwxr-xr-x 2 p12356 users 4096 30. Okt 01:59 tmp/
-rw-r--r-- 1 p12356 users 1690 30. Okt 01:59 web.config.txt
$ rm -f installation/_Joomla4ZODF7Kns5hSzLrF9Qhgj.txt
$ mv htaccess.txt .htaccess
Suchmaschinen würden sonst die Seite einlesen
Alternative: geht bei uns nicht wegen Git Webhook
$ cd joomlaverzeichnis
$ git init
.git Verzeichnis per .htaccess gegen Zugriffe von außen schützen
$ echo -e 'Order allow,deny\nDeny from all' >> .git/.htaccess
/.idea/
.DS_Store
.htaccess
/cache/*
!/cache/index.html
!/administator/cache/index.html
/administator/cache/*
/administrator/components/com_akeeba/backup/*
!/administator/logs/index.html
/administator/logs/*
!/tmp/index.html
/tmp/*
/configuration.php
$ git status
Auf Branch master
Noch keine Commits
Unversionierte Dateien:
(benutzen Sie "git add ...", um die Änderungen zum Commit vorzumerken)
.gitignore
LICENSE.txt
README.txt
administrator/
bin/
cache/
cli/
components/
images/
includes/
index.php
language/
layouts/
libraries/
media/
modules/
plugins/
robots.txt
templates/
web.config.txt
nichts zum Commit vorgemerkt, aber es gibt unversionierte Dateien
(benutzen Sie "git add" zum Versionieren)
$ mkdir database
$ echo -e 'Order allow,deny\nDeny from all' >> database/.htaccess
#!/bin/bash
BACKUP="/home/www/p123456/html/joomla/database/db.sql"
MUSER="USER"
MPASS="PASSWORD"
MDB="DATABASE"
MHOST="HOST"
# Detect paths
MYSQL=$(which mysql)
MYSQLDUMP="$(which mysqldump)"
# make sure we can connect to server
$MYSQL -u $MUSER -p$MPASS -h $MHOST -e "use $MDB" &>/dev/null
if [ $? -ne 0 ]
then
echo "Error - Cannot connect to mysql server using given username, password or database does not exits!"
exit 1
fi
if [ -f $BACKUP ];
then
echo "MySQL Backup $BACKUP remove"
rm -f $BACKUP
else
echo "MySQL Backup $BACKUP does not exists"
touch $BACKUP
fi
echo "Begin MySQL Backup $BACKUP"
$MYSQLDUMP -u $MUSER -p$MPASS -h $MHOST $MDB > $BACKUP
echo "done"
database/backup.sh
/.idea/
.DS_Store
.htaccess
/cache/*
!/cache/index.html
!/administator/cache/index.html
/administator/cache/*
/administrator/components/com_akeeba/backup/*
!/administator/logs/index.html
/administator/logs/*
!/tmp/index.html
/tmp/*
/configuration.php
/database/backdb.sh
$ cd database/ && sh backdb.sh && ..
MySQL Backup /home/www/p123456/html/joomla/database/db.sql remove
Begin MySQL Backup /home/www/p123456/html/joomla/database/db.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
done
$ git add .
$ git commit -m "init"
$ git remote add origin git@github.com:nielsnuebel/starter.git
$ git push -u origin master
The authenticity of host '123.45.678.99 (123.45.678.99)' can't be established.
RSA key fingerprint is 12:27:as:a5:76:ef:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '123.45.678.99' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Konnte nicht vom Remote-Repository lesen.
Bitte stellen Sie sicher, dass die korrekten Zugriffsberechtigungen bestehen
und das Repository existiert.
$ cd ~/.ssh
$ ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/home/www/p12356/.ssh/id_rsa): mykey
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in mykey.
Your public key has been saved in mykey.pub.
The key fingerprint is:
SHA256:B5qBkgyqDK3WbEkEiVsljI8ylQHFYk18PxHvbHfZcMU p12356@s4153
The key's randomart image is:
+---[RSA 4096]----+
|+BX*. .. ..|
|=*B= o .. E|
|+B=.o o o. . . |
|O.=.. *o. = |
|++ = o S+.. o . |
|. . ... . |
| |
| |
| |
+----[SHA256]-----+
$ cat mykey.pub
Host github.com
HostName www.github.com
IdentityFile ~/.ssh/mykey
StrictHostKeyChecking no
$ git push -u origin master
Zähle Objekte: 8056, Fertig.
Komprimiere Objekte: 100% (7498/7498), Fertig.
Schreibe Objekte: 100% (8056/8056), 9.79 MiB | 3.83 MiB/s, Fertig.
Total 8056 (delta 1780), reused 0 (delta 0)
remote: Resolving deltas: 100% (1780/1780), done.
remote:
remote: Create a pull request for 'master' on GitHub by visiting:
remote: https://github.com/nielsnuebel/starter/pull/new/master
remote:
To github.com:nielsnuebel/starter.git
* [new branch] master -> master
Branch 'master' folgt nun Remote-Branch 'master' von 'origin'.
$ git config user.name "Starter Server"
$ git config user.email "guest@starter.kicktemp.com"
DocumentRoot "/Users/niels/Development/kicktemp/starter/dist"
ServerName starter.test
ErrorLog "/Users/niels/Development/kicktemp/starter/errorlogs/error.log"
CustomLog "/Users/niels/Development/kicktemp/starter/errorlogs/access.log" combined
/usr/local/etc/httpd/extra/httpd-vhosts.conf
$ mkdir ~/Development/kicktemp/starter
$ cd ~/Development/kicktemp/starter
$ git clone git@github.com:nielsnuebel/starter.git dist
/usr/local/etc/httpd/extra/httpd-vhosts.conf
$ sudo apachectl -k restart
(2)No such file or directory: AH02291: Cannot access directory '/Users/niels/Development/kicktemp/starter/errorlogs/' for error log of vhost defined at /usr/local/etc/httpd/extra/httpd-vhosts.conf:357
AH00014: Configuration check failed
$ mkdir ~/Development/kicktemp/starter/errorlogs
$ sshstarter
$ cd html/joomla
$ cp configuration.php configuration_server.php
configuration_server.php
$ vi configuration_server.php
$ cat configuration_server.php
$ git add configuration_server.php && git commit -m "add configuration_server.php"
$ git push origin master
$ cd /Users/niels/Development/kicktemp/starter/dist
$ cp configuration_server.php configuration.php
$ cd /Users/niels/Development/kicktemp/starter
$ open -a PhpStorm .
Bitte nur in der Entwicklung machen.
per Console Lokal und auf dem Server
https://github.com/nielsnuebel/kickdeploy
Suchmaschinen sollen jetzt lesen können