torstai 7. toukokuuta 2015

SSH Git-repository

On ssh-server install git:

$ sudo apt-get install git
Create empty folder for git:
$mkdir gitkansio && cd gitkansio
Initialize git repository
$git --bare init

On local machine:

Create Git folder with Git:
$mkdir gittest && cd gittest
$sudo apt-get install git
$git init
Create some files
$ echo "lol" >> test.txt
Commit to Git
$git add .
$git commit -m "testing git"
Add remote repository
$git remote add origin ssh://username@server.com:1234/home/user/gitkansio
Push to remote
$git push origin master
$ git branch --set-upstream master origin/master

Clone the repository:
$ git clone ssh://gitmies@www.nikiahlskog.com:4242/home/gitmies/gitkansio

to remove: $ git remote rm origin

Check remotes with command: git remote -v 
Set new remote: git remote set-url origin ssh://gitman@365rent.fi:2222/home/gitman/365rentrepo

keskiviikko 6. toukokuuta 2015

Development mode on with LAMP

I was wondering how to setup development mode on with LAMP.

What you have to do is to set in /etc/apache2/ports.con this: Listen 127.0.0.1:80
That means, only localhost can access apache and no one else can see it.

Second thing, setup php development mode on by editing file /etc/php5/apache2/php.ini and set display_errors = On from Off value.

Create apache benchmark logs

ab -n 100 -c 20 http://localhost/ > benchmarklog-$(date +\%d\%m\%y).txt

ab -n 100 -c 20 http://localhost/ > /home/shnigi/public_html/ablogs/log-$(date +\%d\%m\%y).txt