 Hi everyone, I will be conducting today's session which is on Apache PHP and MySQL installation which you will require for Moodle installation which will be coming soon. First on your terminal just type apt-get install apache 2, this is the command to install the apache server on your system, oh yes before that I just forgot. You need to have root permissions for running this command. So, you just do su enter and enter your root password, so type sudo su it will ask for your your account password. You should see root at your laptop name like this. The command is sudo su, is everyone done? Then just run this command apt-get install apache 2, ept get this will install apache 2, now the apache 2 is installed on the system. Now since it is a server it will have configuration files which are placed at etc slash etc slash apache 2 folder, so we will just do ls of it slash etc, is it done with everyone, yeah. So now ls space slash etc slash apache 2 should give you all the configuration files, all the configuration files are stored in under this directory and since it is a web server you will have a web root where in all your web files will be stored, so that is the web root is at slash var slash www, these are the important directories you should remember. For now it has a dummy file called index.html, you can do a cat of it, it is a simple file which says it works. Now just try restarting the server, the command for which is slash etc slash init dot d apache 2 restart, this is giving me some errors, let us see yeah a server name not found, let us see how to fix it, so now to fix that error just add the line, add the following line at the end of apache 2 dot conf slash etc slash apache 2 slash apache 2 dot conf says at the go to the last line and say server name space your machine host name, let me show you say this is the file slash etc slash apache 2 slash apache 2 dot conf, vim is a text editor, I hope everyone knows about vm, go to the last line say insert, say server name space your machine name, now my machine name is IITB dash laptop sorry, so it is IITB dash laptop, no it has to be exactly as it appears on your command prompt, this server name space your host name, no, no, right now your machine is the server, this is my host name it might be different in your case, is everyone done, I save this file come out, now try restarting the server, now see I am not getting that error, now let us just test whatever we have done, we have actually done just two steps which is installation of apache 2 and adding that line in apache 2 dot conf that is it, just go to your browser and type this line, this URL 127 dot 0 dot 0 dot 1, it should show you that page that HTML page that we saw 2 minutes back, 127 dot 0 dot 0 dot 1 is the IP address which points to your machine by default, so it says it works and if you remember it this file was in slash wire slash www which is your web route, now if you do not have a proxy set this even this will work IITB dash laptop, yeah this is your Mozilla Firefox edit preferences, go to network tab settings and you must be having a manual proxy configuration here which is required because if you want to access outside websites, so now let us begin with PHP installation, for installing PHP just type this command apget install PHP 5 leave apache 2 dash mod dash PHP 5, apget install PHP 5 leave apache 2 mod PHP 5, now restart your apache 2, so now apache 2 has restarted, so PHP 5 is done now that is just one command, yeah just install PHP 5 and that leave apache 2 is actually a module which is for apache for, so that you can run PHP 5 and apache that is why you need to restart the server again and that is it your PHP installation is done, then we move over to MySQL installation for that you need the command apget install MySQL dash server space PHP 5 dash MySQL, yeah it will ask for a root password give some password which is which you will remember you will require it for module installation, you will get a blue screen, okay it seems MySQL server is already installed on the system, so it says it is already the newest version, okay but in your case if it does not have it will install and it will give you a blue screen which asks you for a root password which you should remember because you will require it for module installation, okay yeah when you run this command apget install MySQL server PHP 5 MySQL it will in the process it will give you a blue screen which will ask you for a root password and it will ask you twice once for recon confirming, so give the same password in both the cases and remember the password you will require it for MySQL installation module installation, okay it is a good idea to note down your MySQL password, so that you know you can refer to it later because it is a root password remember, okay now let us say how to run the MySQL client for that type the command MySQL space dash u root dash p MySQL minus u is for this user root login as root minus p prompt for password and MySQL is a default database which is already created, now enter the root password and when it asks you for a password type the same password that you entered in that blue screen just do not forget your root password, okay it creates a lot of problems. So we were at this line MySQL minus u minus p you will get a prompt like this okay the MySQL prompt now you are inside MySQL then just type this query select star from user now you are getting a huge it is actually a table which has the list of all the users the present database users then just type quit and you are out on the prompt then how to add a user account type this command MySQL minus u root minus p it will ask you for the root password prompt for password yeah no it will not allow you to enter because root has a password I am not selecting a default database then type this command create user new user at local host exactly as this is so it says local host is your machine and new user is the new user that we are adding it says query okay then you grant all the privileges to the user for which you type grant all privileges on star dot star means all tables of all databases new user at local host it says query okay now your user is created now let's see whether you can log in through the new user account so type quit and then type this command MySQL minus u new user minus p MySQL MySQL minus u new user minus p MySQL when you are asked for a password just enter because you don't have you have not set a password yet so it is using the MySQL database now if you type this query select star from user you should get this new user that you have added in the database select star from user you see this new user is added okay so type quit and you are out that's it