I would like to start with a little introduction about XAMPP.
X – cross platform, different operating systems ( Windows, Linux, Mac OS X)
A-Apache (HTTP server)
P-PHP (Scripting Language)
P-Perl (Script programming language)
Use: PHP script is executed on server so if you want to run php script on local machine you need local server XAMP provide you local server (Apache). Well, it can be used for all the above as well.
I feel rather installing all the above separately we can simply install Xampp all at once.
Steps to Install XAMPP:
- Download the latest version of xampp from https://www.apachefriends.org/download.html choose the version and OS you want.
- Open the terminal ctrl+alt+t and then browse (cd) to the directory where the file was downloaded and run the below commands, you can replace the name with the name of your installed file
sudo chmod 755 xampp-linux-x64-7.1.1-0-installer.run
This will extract all the packages to the /opt/lampp directory
- Then you have to store the php files you want to run in /opt/lampp/htdocs and for that you need to change the permissions of htdocs, for that run the command
sudo chmod 777 /opt/lampp/htdocs
- Now copy the php file in /opt/lampp/htdocs
- Then you need to go ahead, and start the service, and see if it works
- To check, you can browse the following urls in your browser
You may see the following page
This means that another daemon of mysql is already running, so we need to stop lampp and mysql and restart lampp again, run the following commands
sudo /opt/lampp/lampp stop
sudo service mysql stop
sudo /opt/lampp/lampp start
If you see the following page it may mean that another daemon of Apache is already running and you need to stop lampp and apache and then start apache again.
Run the following commands
sudo /opt/lampp/lampp stop
sudo service apache2 stop
sudo /opt/lampp/lampp start
And to remove this problem permanently we delete the previously installed services.
Life has been awesome as it should have, learning new stuff every day is what keeps me going and today is one of those days when you get those inner soul callings. I love watching the videos of LiveEachDay it gives a very bright perspective of life, gotta go have my class (Compiler Design it is) not a big fan, but will try to learn something anyway it was going to start by 4:30 and now it’s 4:35 pm and I am already late.
So now that our set up is ready, we have the master server and two mirror servers. And before proceeding any further I Strongly suggest you to go through the README section in this link https://github.com/KDE/propagator and if you feel like you can come back .
1.Foremost you need to have the following installed in you master server :
- Python 3.5
- Celery 3
- GitPython : make sure first you install pip3 using sudo apt-get install python3-pip then you can pip3 install gitpython
- Propagator uses the AsyncIO module : pip3 install asyncio
- Other dependencies : pip3 install requests
NOTE : Also install pip3 and Gitpython in the two mirror servers as well.
2. Install propagator in the master VM for that first you need to clone it git clone https://github.com/KDE/propagator.git and then configure the ~/propagator/config/ServerConfig.json for that first you need to change the RepoRoot to the location you have stored the git repository. Export the variable GATOR_CONFIG_FILE in bash for that run the command export GATOR_CONFIG_FILE=/path_to_propagator/config/ServerConfig.json Then you can run the server with the command supervisord -c ./supervisord.conf
3.Setting up the AnongitRemote plugin to push to the two mirror servers :
- First we generate a new SSH key in the master VM and make sure you store it somewhere else not ~/.ssh so that now we have two SSH keys on the server the old one is already in use so we keep it untouched now that we have a new SSH key we append the public key to the ~/.ssh/authorized_keys on the master server and configure the ~/propagator/config/ServerConfig.json by setting the path of the private key in the field AnongitAPIKeyFile .And then we copy this public key to the two mirrors with the command ssh-copy-id -i ~/path_to_new_sshkey/id_rsa.pub user@IP
- Then we copy the agent/GatorSSHAgent from the master VM to the two mirror server, run this in the master VM scp /path_to_propagator/agent/GatorSSHAgent user@IP:/destination here user and IP are of the mirror VM and destination is the location you want to store it in mirror. Make sure you have installed pip3 and GitPython in the mirrors as well.
- Now configure the ~/.ssh/authorized_keys file of the two mirrors. Note that the second ssh-rsa key is the newly copied key so we need to prefix the second key and it will look like command=path/to/GatorSSHAgent ssh-rsaAcd ……..fddhg@ssh-key-comment
4. Lastly we need to edit the post-update hook of the git repository in the master server where we specify the location of mirrorctl in master server and the loacation of the git repo in mirror servers so add this command /path_to_propagator/bin/mirrorctl update user@IP:/location_of_git_repo name_of_repo.git
Please make sure you use Python 3 throughout as Propagator is written in Python3.5 if you get any errors during running it that means some modules you installed is not Python 3 compatible.All you need to do is to check the log files and run the modules in server separately eg : python3 CeleryWorkers.py and in case you get errors debug accordingly. If you feel that the server is still not working delete /home/user/.propagator.sock and then try to run propagator again.
I never fail, How could this happen to me, Why me what did i do wrong.
Mom never talks of failures, Dad never make us learn to fail, school teaches it neither. Then what is failure?
The idea of failure is more frightening than failure itself. It is not a defeat but a pause for us to stop, introspect and understand is it the right door we are knocking if yes then why isn’t it opening did we follow the right path?
Someone close told me that for becoming good in something all you need is to make yourself believe that you are good at it, you love it and this is what you always wanted to do.
Despite everything i failed this time, horribly i failed and nobody taught me what do we do when we fail. It is not that i wasn’t aware of it but may be too afraid to talk about it. I have my share of sleepless nights and tears of sorrow, where the nights are mine and days i sleep. I am locked in a cage it feels, little did i know its locked inside. The darkness here beholds me I hope I break this cage and read this once again and smile!
1.We need to set three Virtual Machines that’s easy you can see the related tutorial on youtube.
Now the thing is we need to ssh from host(my physical machine) to the guest(master VM) and from the master VM to the two mirror VMs without using password. For that we need IP of the VMs. So the plan is to create two NICs, one NIC is connected to NAT, and the second NIC is connected to vboxnet0 through Host-Only. First we go to File->Preferences setting in Virtual Box and then Network->Host Only Networks add a new network. Then we need to make sure that all the VMs are connected to two Ethernet interfaces.
If you are using any server distribution on your VM you need to add the new network in the file /etc/network/interfaces.
That’s it now you have the IP to ssh.
2.Install openssh-client on the host machine and openssh-server on the master VM and two mirror VM’s .
Generate two RSA-4096 keypairs – one on the host machine, one on the master server using the command ssh-keygen -t rsa -b 4096
Set up the master server with the public key of your host machine, and set up the mirrors with the public key of the master machine so we can use ssh-copy-id -i ~/.ssh/id_rsa.pub user@IP and to ssh without password we need to change the permission of .ssh/authorized_keys and add the private key identities to the authentication agent, use ssh-add
3.Set up git server on all the three VMs, first sudo apt-get install git-core on all the three servers then create bare repository first cd into the git repository then git –bare init and set up post-update hook. For that you need to create a post-update file in which we write the bash script to push the changes to the mirror servers. The contents of the post-update file on the master git server .
As we see here we have used git push –mirror url command which pushes the committed changes to the specified mirror url from the master server to the two mirror servers.
We can now clone the repository from the master to our host machine and can push the commits and we have the changes in the mirror servers as well.
You can also check using a different branch to commit changes and then check that the changes are reflected on both the mirror git servers.
The good news is i got selected for GSoC 2016, well its pretty exciting. As a part of my GSoC project with KDE i will be working on Propagator. So in this blog i will be spamming you with all my GSoC experiences and related technicalities.