Select Page

WE IMPROVE YOUR BUSINESS

Direct support nodig bel: 056-4654561 of ga naar support

### install composer (https://www.1and1.com/cloud-community/learn/application/php/install-and-use-php-composer-on-ubuntu-1604/)

sudo curl -s https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

### migrate nginx (https://gilang.chandrasa.com/blog/install-latest-version-of-nginx-on-ubuntu/, https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-with-nginx-on-an-ubuntu-14-04-server)

sudo echo -e "deb https://nginx.org/packages/mainline/ubuntu/ `lsb_release -cs` nginx\ndeb-src https://nginx.org/packages/mainline/ubuntu/ `lsb_release -cs` nginx" > /etc/apt/sources.list.d/nginx.list wget -q -O- http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
sudo apt-get update

mkdir /etc/nginx_old

cp -a /etc/nginx/ /etc/nginx_old

 

### Migrate to mariadb (https://downloads.mariadb.org/mariadb/repositories/#mirror=digitalocean-ams)

sudo apt-get install software-properties-common sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

sudo add-apt-repository ‘deb [arch=amd64,i386,ppc64el] http://ams2.mirrors.digitalocean.com/mariadb/repo/10.2/ubuntu xenial main’

sudo apt update

sudo apt install mariadb-server

vi /etc/mysql/mariadb.conf.d/50-server.cnf

#Then add the line below [mysqld] section. (https://websiteforstudents.com/fix-mariadb-plugin-unix_socket-is-not-loaded-error-on-ubuntu-17-04-17-10/)

plugin-load-add = auth_socket.so

sudo service mysql restart

sudo mysql -u root

use mysql;
update user set plugin='' where User='root';
flush privileges;
exit

### Access vagrant mysql from mysqlworkbench

mysql -u root -p

MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO root@’%’ IDENTIFIED BY ‘r00tw00t’;

exit;

### Install phpmyadmin (https://docs.phpmyadmin.net/en/latest/setup.html)

cd /etc/

composer create-project phpmyadmin/phpmyadmin

# https://tehnoblog.org/phpmyadmin-error-connection-for-controluser-as-defined-in-your-configuration-failed/

vi /etc/phpmyadmin/config-db.php

#change

$dbuser=‘root’;
$dbpass=‘password’; // set current password between quotes ‘ ‘

vi /etc/phpmyadmin/config.sample.inc.php

$cfg[‘blowfish_secret’] = ‘$2a$07$tNhWhIkBJCWn8554NE0wmO4qMo/CPLyBkD1Aja/9Pkmb25iZn9G.i’; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

cp /etc/phpmyadmin/config.sample.inc.php /etc/phpmyadmin/config.inc.php

### Upgrade php version (https://ayesh.me/Ubuntu-PHP-7.2)

apt-get install python-software-properties

sudo add-apt-repository ppa:ondrej/php
sudo apt update

dpkg -l | grep php | tee packages.txt

sudo apt install php7.2 php7.2-common php7.2-cli php7.2-fpm

sudo apt-get install php7.2-mysqli php7.2-gettext php7.2-xml php7.2-gd php7.2-intl php7.2-ssh2

sudo apt purge php7.1*

### Switch php version

sudo update-alternatives --set php /usr/bin/php7.1
sudo update-alternatives --set phar /usr/bin/phar7.1
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.1
sudo update-alternatives --set phpize /usr/bin/phpize7.1
sudo update-alternatives --set php-config /usr/bin/php-config7.1

### Deployer

#on localy

ssh-keygen -t rsa -b 4096 -C “support@4bis.nl”

/root/.ssh/id_rsa_github_admin_ifinish_nl

vi ~/.ssh/id_rsa_github_admin_ifinish_nl.pub

ssh-add ~/.ssh/id_rsa_github_admin_ifinish_nl

# ON https://github.com/4bis/admin.i-finish.nl/settings/keys

Add the key

ssh-keygen generates keys.

$ ssh-keygen -t rsa -b 4096 -C

Enter passphrase (empty for no passphrase):

Enter same passphrase again: Note: When it asks you to enter the passphrase just press enter key, and do not give any password here.

3. ssh-copy-id copies public key to remote host

Use ssh-copy-id, to copy the public key to the remote host.

ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.200.10

Note: The above will ask the password for your account on the remote host, and copy the public key automatically to the appropriate location. If ssh-copy-id doesn’t work for you, use the method we discussed earlier to setup ssh password less login.

4. Perform rsync over ssh without password

Now, you should be able to ssh to remote host without entering the password.

ssh 192.168.200.10

Perform the rsync again, it should not ask you to enter any password this time.

rsync -avz -e ssh /home/test/ user@192.168.200.10:/backup/test/
ssh-keygen -t rsa -b 4096 -C "max@4bis.nl"
ssh-agent -s
sudo vi ~/.ssh/config
Host *
 AddKeysToAgent yes
 UseKeychain yes
 IdentityFile ~/.ssh/id_rsa

ssh-add -K ~/.ssh/id_rsa

pbcopy < ~/.ssh/id_rsa.pub