As you guys might know , I just got started in the field of programming and open-source contribution. I was hoping that it would be easy enough for my to grasp the concept but after a fatal step (of which i have no idea) , the task of installing MySQL became so elusive and frustrating that i was literally about to loss my mind . So I’m gonna try to prevent you guys from doing the same mistake as me.
Do not try install Apache,MySQL or PHP separately. Try using the command
sudo apt-get install lamp-server^
This will install all 3 of them .
Install git , if you do not already have it .
To install it,use sudo apt-get install git
After installing git, you must configure your username and email as git tracks any chances you make using your username and email.
git config –global “user.email”—–Enter you email address instead of user.email.
git config –global “user.name” —-Enter your chosen username and replace it with “user.name”.
Now, you need to generate SSH keys to establish a connection between your PC and Gerrit but to be able to generate a new key you need to check if a key already exists. To check for this , try
ssh-keygen -t rsa -C “your email address”
After you enter the above command , you’re gonna be prompted for a passphrase. Do not worry about that just press enter.
You now need to create a Gerrit account and add the SSH key .
- Go to wikitech.wikimedia.org.
- Log into the web interface of Gerrit.
- Go to settings and click on “SSH Public Keys”
- Paste your ssh key into the corresponding filed
Now , run eval ‘ssh-agent‘ and ssh-add .ssh/id_rsa
In order not to get “Permission denied”, you should run ssh -p 29418 <USERNAME>@gerrit.wikimedia.org
Type this in terminal.
Once the download is completed, you need to extract the folder and place it in your web directory.
To extract the folder use the following command.
tar -xvzf /tmp/mediawiki-*.tar.gz
Now rename the mediawiki file as “core” and copy it to the www folder of var. If you are not able to paste it , it might be because your the folder is read only. So to solve this , apply the following command
sudo chmod 777 -R 777 /var/www/html
This will remove any restriction and then just copy the core file into www folder.
You can try to see if the localhost is working. So go to your browser and search for http://localhost/core/
It may also happen that you may not have installed all the extension . The extensions that you might be asked to download might be php mdstring and xml.
To install mbstring , just type the following command,
sudo apt-get install php-mbstring
and for xml,
sudo apt-get install php-xml
Once you completed downloading everything restart the Apache server using the command
systemctl restart apache2
Now try localhost/core/ again. It should work.
Now just go through the local setting till you reach a page where you are asked for a for username and password. Those are actually for your database which you have not yet created. So open terminal and create a database.
- Create a mysql user.
sudo mysql -u root -p “password” —-Replace the “password” with an actual password.
mysql>CREATE USER ‘new_mysql_user’@’localhost’ IDENTIFIED BY “your password”;
- Create a mysql database pi_wiki
sudo mysql -u root
mysql> CREATE DATABASE pi_wiki;
mysql> use pi_wiki;
- Grant user access to new database.
mysql> GRANT ALL ON pi_wiki.* TO ‘new_mysql_user’@’localhost’;
Now fill in the boxes with appropriate information and you are good to go.