Part 1 :How to install Mediawiki .

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.

Step 1

Do not try install Apache,MySQL or PHP separately. Try using the command

sudo apt-get install lamp-server^ 

screenshot_2018-11-06-downloading-and-installing-lamp-on-ubuntu-google-search2.png

This will install all 3 of them .

Step 2

Install git ,  if you do not already have it .

To install it,use sudo apt-get install git 

Step 3

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”.

Step 4

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

ls ~/.ssh

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

Screenshot_2018-11-06 Gerrit Tutorial - MediaWiki

Step 5

Download mediawiki.

Type this in terminal.

wget https://releases.wikimedia.org/mediawiki/1.31/mediawiki-1.31.1.tar.gz

Step 6

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.

Step 7

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.

Screenshot_2018-11-06 downloading and installing lamp on ubuntu - Google Search(1)

mysql>CREATE USER ‘new_mysql_user’@’localhost’ IDENTIFIED BY “your password”;

mysql>quit;

  • 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’;

mysql>quit;

Step 8

Now fill in the boxes with appropriate information and you are good to go.

Screenshot_2018-11-06 mediawiki local host page - Google Search(1)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s