-
1burn the sd card and prepare ssh
I used Raspbian Buster Lite from here
i burned it on the microSD card using Rufus
then plugg your freshly burned SD card in the raspberry pi
power the pi using the micro USB.
connect a screen and a USB keyboard (or setup ssh directly by adding a empty file called ssh in the boot partition of the sd card)
1) enable ssh with raspi-config under interfacing option
2) setup the keyboard layout using raspi-config
3) change the password using again raspi-config
4) set hostname with raspi-config
5) setup a static ip adress by edditing /etc/dhcpd.conf
6) login via ssh and create.ssh
7) put your public key in .ssh/authorized_keys
8) sudo apt update && sudo apt upgrade -y
9) sudo reboot now
now your pi is ready
-
2setup RAID
The objective is to have a safer way of storing the datas and a bigger storage than what the pi can offer with the SD card alone
sudo apt-get install mdadm
sudo dd if=/dev/zero of=/dev/sda bs=256M count=1
sudo dd if=/dev/zero of=/dev/sdb bs=256M count=1
(be careful. this wipe the content of your stick)
sudo parted /dev/sda mklabel gpt print mkpart primary 0% 100% print quit
sudo parted /dev/sdb mklabel gpt print mkpart primary 0% 100% print quit
sudo mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sda1 /dev/sdb1
sudo -i (it dont work with sudo for some reason) mdadm --detail --scan >> /etc/mdadm/mdadm.conf exit
sudo mkfs.ext4 -v -m .1 -b 4096 -E stride=32,stripe-width=64 /dev/md0
sudo mount /dev/md0 /mnt sudo chmod -R 777 /mnt
sudo df -h
if you loose a drive due to weak power supply, you can re-add it with :
mdadm /dev/md0 -a /dev/sdX0
then edit the max_usb_current=1 in /boot/config.txt
sudo nano /boot/config.txt max_usb_current=1
you should now see youre raid
sudo blkid
note hte id of your RAID
sudo nano /etc/fstab
add the followinf line (replace X with your id) :
UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX /mnt ext4 defaults 0 0
sudo reboot now
once rebooted you should now see your raid mount in /mnt
sudo df -h
-
3setup Log2Ram
This step is optional but greatly recommand to extend the lifetime of your server.
cd /home/pi
sudo apt-get install git lsof mdadm -y git
git clone https://github.com/azlux/log2ram.git
cd log2ram
chmod +x install.sh
sudo ./install.sh
sudo nano /etc/log2ram.conf
set size the buffer size from 40 to 128 megabyte
sudo reboot now
-
4install LAMP and download phabricator
sudo apt-get install mariadb-server mariadb-client -y
sudo apt-get install mariadb-server mariadb-client -y
sudo apt-get install apache2 php libapache2-mod-php -y
sudo apt-get install phpmyadmin -y
sudo apt-get install php7.3-mysqlnd -y
sudo apt-get install php7.3-gd php7.3-dev php7.3-curl php7.3-mbstring php7.3-apcu php7.3 -y
sudo mkdir /mnt/phabFolder sudo ln -s /mnt/phabFolder /var/www/phabFolder
cd /var/www/phabFolder
sudo git clone https://github.com/phacility/libphutil.git
sudo git clone https://github.com/phacility/arcanist.git
sudo git clone https://github.com/phacility/phabricator.git
-
5setup apache
sudo a2enmod rewrite
sudo a2enmod ssl
sudo systemctl restart apache2
sudo nano /etc/apache2/sites-available/phabricator.conf
<virtualhost *:80> ServerName '192.168.10.100' DocumentRoot /var/www/phabFolder/phabricator/webroot RewriteEngine on RewriteRule ^/rsrc/(.*) - [L,QSA] RewriteRule ^/favicon.ico - [L,QSA] RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA] <Directory "/var/www/phabFolder/phabricator/webroot"> Options FollowSymLinks Order allow,deny Allow from all </directory> </virtualhost>
sudo a2ensite phabricator.conf
sudo systemctl reload apache2
sudo a2enmod rewrite
-
6setup phabricator
cd /var/www/phabFolder/phabricator/
sudo mysql create user admin@localhost identified by 'yourPassword'; GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost'; exit;
sudo ./bin/config set mysql.host localhost sudo ./bin/config set mysql.port 3306
sudo ./bin/config set mysql.user admin
sudo ./bin/config set mysql.pass 'yourPassword'
sudo ./bin/storage upgrade --user admin --password 'yourPassword' --force
sudo systemctl restart mysql sudo systemctl restart apache2
sudo reboot now
wait a 45 secondes
From now your should see the phabricator webpage when you open your raspberry pi adress using a web browser
-
7move data to RAID
lets start with the database :
sudo systemctl stop mysql
sudo cp -R -p /var/lib/mysql /mnt/mysql sudo chmod -R 777 /mnt/mysql
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
set datadir = /mnt/mysql
sudo systemctl start mysql
now for the repos
sudo mkdir /mnt/repo
sudo chmod 777 /mnt/repo
sudo ln -s /mnt/repo /var/repo
-
8setup user login method
now you need to setup a admin password.
first login on phabricator using you broswer
then on the raspberry pi enter :
cd /var/www/phabFolder/phabricator/
bin/auth recover admin
you should get a link that allow to (re)set the password.
normally phabricator send you a mail with this link but it need to you to setup a mail server and i dont need a mail server just to send login link so for every new user that create an account you just need to run theses two command (replace admin with the username) and setup them a password
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
There is no step here to show how the Phabricator's daemons could be launched at boot up instead of launching them manually. The easy way I found is to sdd this line on the rpi's /etc/rc.local:
sudo /var/www/phabFolder/phabricator/bin/phd start
Are you sure? yes | no
i personnally just added a cron with
@reboot php /var/www/phabricator/bin/phd start
i should update this install process i improved tid and bits.
Are you sure? yes | no
The phabricator.conf file has an error, the first line should be read as
"<virtualhost *:80>"
Are you sure? yes | no
i fixed it. thank
Are you sure? yes | no