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 me 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 changes 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. Follow the following steps.
Download MediaWiki through the following command.
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 https://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
To install xml,
sudo apt-get install php-xmlOnce 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.
1. 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”;
2. Create a mysql database pi_wiki
sudo mysql -u root
mysql> CREATE DATABASE pi_wiki;
mysql> use pi_wiki;
3. Grant user access to new database.
mysql> GRANT ALL ON pi_wiki.* TO ‘new_mysql_user’@’localhost’;
Now fill in the boxes with the appropriate information and you're good to go.