Posts

Showing posts from May, 2022

File/Folder Upload/Download From/To Local/Remote

 copy from remote to local scp file.txt remote_username@10.10.0.2:/remote/directory scp folder from server to local scp -r user@your.server.example.com:/path/to/foo /home/user/Desktop/ how to copy directory to a ssh server # Copy from machine a to b scp -r /path/to/directory user@ipaddress:/path/to/destination # Copy from machine b to a scp -r user@ipaddress:/path/to/destination /path/to/directory copy folder from ssh to local scp -r user@your.server.example.com:/path/to/foo / ssh copy folder from local to remote scp -ra /path/to/local/storage user@remote.host:/path/to/copy ssh copy folder from local to remote scp /path/of/your/local/filename username@hostname:/path/to/remote/server/folder

Server setup basic guide

 BASIC GUIDE ssh root@192.168.0.1 -p 22 adduser hasib ssh -l hasib 192.168.0.1 Update OS Install Apache Install MySQL Install PHP Install Composer (Composer install and globalization) sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin –filename=composer Install Git Set DNS Server Name to Domain Name Provider Panel

Git post receive setup at server for git push to the production from local machine

IN SERVER cd www mkdir repo cd repo mkdir app.website.git cd app.website.git git init –bare cd hooks touch post-receive chmod R 775 post-receive put the following line in post-receive file git --work-tree=/var/www/html/app.website.com --git-dir=/var/www/repo/app.website.git checkout master -f cd /var/www/html/app.website.com nano /etc/hosts 127.0.1.1 app.website.com cd /etc /apach2 /site-available cp 000-deault.conf app.website.com.conf LOCALLY git remote -v git remote add prod-website ssh://root@192.168.0.1:/var/www/repo/app.website.git