Arch Linux: The LAMP stack

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome back again to the channel and to another video have you ever wondered how can i actually build an installation of arch linux where i can work maybe on a website or i want to work on a new project with a web server well we can do this very easily by installing the lamp stack lamp is an acronym for linux apache maria database and php and those are the packages we need in order to install something like wordpress if you want to test a website for example or if you want to build a new one so what we are going to do in this video is to install the lamp stack on arch linux and have your own web server on arch linux where you can develop eventually your new website so let's get going and see how it's done so let's get started here in installing the software we need to run our website and i'm doing this already since a while and i'm really happy to have arch linux as a server it does actually work really well even it's bleeding edge software even it's aurora release but in my case because i keep it always up to date it has always been very stable and i've been running the server without any problem so in order to install the web server and wordpress to work on a website here we need to install what's called the lamp stack now lamp is an acronym for linux apache mysql and php so these are basically the components we need to run our web server and eventually wordpress on it so let's begin with the l well we have that already because that's linux and we are running arch so we are fine with that and we can move over to the second component which is the apache web server so let's open up the terminal because all the commands we need to run here are from the terminal and i'll go full screen increase the font size a little and let's install our apache server by typing in sudo pacman dash s and then apache and then hit enter we'll enter our sudo password and hit enter and we press enter to accept the installation and there you go apache is installed so let's clean up the terminal now we need to basically enable apache and started it at the same time so we can type in sudo system ctl enable now httpd which is the service for apache and then we can hit enter so this command basically enables the web server when we boot the machine and started it right away that's the now switch now the configuration file for apache is under the etsy directory and we need to go there and uncomment one of the modules so to change that we need to type in sudo vim slash etsy slash httpd slash conf slash httpd.com any tensor and we need to search for the module which is the unique id module so let's search this in vim unique underscore id underscore module there you go it's the one already selected so i can hit enter here and i need to uncomment this line by deleting the hashtag here and then we can save the file and exit now we need to reload our server by typing in sudo system ctl restart httpd and hit enter and the web server is restarted now the module we just uncommented provides a magic token for each request which is guaranteed to be unique across all requests under very specific conditions and i just wanted to make sure to uncomment this so that the server treats this request properly now we can check actually if the server is up and running if we get out of the terminal here and let me open up firefox and this machine is configured with the name localhost as it should be also in your case if you follow the base installation of arch linux so if i type in here local host and hit enter we have our web server here up and running there is not much in here but the server is running so let's close firefox and go back to our terminal clean it up and proceed to the next step which is installing our php modules so we have a bunch of packages to install here we can type in sudo pacman dash s the first package is php we have also php dash cgi we have also then php.gd and php.pgsql and also php dash apache and then we can hit enter now we can press enter here to accept the defaults and the packages are now installed so let's clean up the terminal and we need to go back again into our configuration file for the web server because we need to uncomment a module and comment another one so let's do this again by typing in sudo vim slash etsy slash httpd slash conf slash htdpd.com any tensor and the first line we need to comment is the line which has npm event module so let's search for this mpm underscore event underscore module and there you go and it's the first one that we need to basically comment so let's hit enter here go to the beginning of the line and hit enter modes and had a hash here and we need to uncomment the prefork module which is just underneath so let's do this by deleting the hashtag here and then we can save the file but we don't exit them yet because we need to add some lines here so let's go down at the end of the file and enter insert mode again and let's enter these lines so we need to enter first our php modules so let's type in load module php 7 underscore module and then modules slash lib.php 7 dot so on the next line we can type in add handler php 7 dash script and then php and in the last line we type in include conf slash extra slash php7 underscore module dot conf so what we basically did here we commented out one module and uncommented another one which is helping the server with child processes and we added also some extra things here for php so now we can save the file and exit beam and we need to edit also our php.eni file to enable two extensions there so to do this we can type in sudo vim slash etsy slash php slash php.ini and hit enter and we need to search here for the mysqli extension which is down here somewhere so let me scroll down the file here and i can see it is right here so we need to basically uncomment this extension by deleting the semicolon here and we do the same for the gd extension for which we installed also the package so let's read the semicolon and we can save this file and exit bim and now let's test if php is working correctly by creating a php file in our server so let's type in sudo vim slash srv which is the server directory slash http and then info dot php edit enter and let's type in the php code here so we'll type in the minor then symbol and then a question mark php and then php info opening and closing parenthesis semicolon a space question mark and major then symbol and then we can save the file and exit them and we need to restart one more time our web server so let's type in sudo system ctl restart httpd and hit enter and let's go back to our browser and see what happens so let's open up firefox here and let's type in here again localhost but this time we add at the end info.php any temperature and you can see the php file here so that means php is working correctly so let's close the browser and proceed to the next step which is installing our database for wordpress so i'll go back to the terminal go full screen in here clean it up and let's install the packages we need for mariadb so let's type in sudo pacman dash s and the first package is mariadb then we need also lib maria db and we need also maria db clients and then we can hit enter proceed with installation and the packages are now installed so we can clean up the terminal now let's set the basic configuration for the database by typing in sudo mysql underscore install underscore db and then dash dash user equal mysql and then base there for the base directory which is equal to slash user and then dash dash data deer equal slash var slash lib slash mysql so we defined the base directory and also the data directory and then we can hit enter it's going to take a second to do that there you go so we can clean up the terminal and the next step is to enable our service so let's type in sudo system ctl enable dash dash now and then mysqld and then we can hit enter so this basically again enables the service when we boot the machine and starts the service right away so we need to set first a secure installation for the database before we proceed with the installation itself so we can type in sudo mysql underscore secure underscore installation and hit enter now in order to log into mariadb to secure it we'll need the current password for the root user if you have just installed the mariadb and you haven't set the root password you should just press enter here and that's exactly what i'm going to do because i didn't set any password so we have to decide here whether to switch to unix socket authentication and i will let the default here for yes so the next question is change the root password in this case i want to type in n to leave it empty and hit enter i want to remove anonymous user so i'm going to accept the defaults here and i want to disallow also root login remotely so i'm just going to hit enter here and the same for the test database and i want to reload the privilege table now and this is now done so we can clean up the terminal and proceed with the installation of our database so to do this we can type in sudo mysql dash u for the user and the user is root dash p and the password is empty and then we can hit enter now the password is empty so we just hit enter here and we can create now our database so let's go ahead and do that so we create a database by typing in create database and you can call the database anything you want in my case i'm going to call it my wordpress and then add the semicolon at the end and hit enter now let's clean up the terminal to have a bit more space here the next step is to create the user so let's go ahead and do that by typing in create user single quote and then you choose the username in my case it's going to be my name here single quote again at single quote the name of the server in our case it's localhost then a single quote again and then identified by single quote and then we choose the password for this user in my case i'm going to choose a very simple one one two three four please choose a better one and then a semicolon to end the command and then we can hit enter next we need to grant privileges to this user so we can type in grants all privileges on and then the database name in my case it was my wordpress dot asterisk and then two so begin the privileges two single quotes the username a single quote at single quote local host and then single quote again the semicolon and enter to accept the command now we need to flush the privileges so let's type in flash privileges semicolon and hit enter and we can exit now the program by typing exit and this is done so let's clean up the terminal now we need to download wordpress in our server directory so to do this we need to change to the server directory let's do this by typing in cd slash srv slash http and hit enter now we can use wget to download wordpress and if you don't have it installed we can type in now sudo pacman s and then wget and hit enter and proceed with installation in my case it was already installed but i reinstalled it again and now that we are still in the server directory we can use wget to download wordpress by typing in sudo wget https colon slash and then wordpress dot org slash latest dot star dot gz and then we can hit enter it's gonna take a moment here to download wordpress there you go and now we need to decompress the file that we just downloaded so to do this we can type in sudo tar xv set and then latest dot star.gz and then we can hit enter it's going to take a moment to do that there you go now we have wordpress installed in our directory but we need to change the permissions in there so that the web server can read on that so to do this we need to type in sudo shown for changing ownership dash capital r because we want to make the changes recursive in the directory then the user is root colon and the group is http the web server and the directory is slash srv http slash wordpress which was created when we downloaded wordpress and then we can hit enter now let's go into the wordpress directory by typing in cd and then wordpress and hit enter and in this directory there is already a sample configuration file for wordpress that we can use so we can type in sudo cp for copy and then wp dash config sample dot php and the name of the configuration is gonna be wp dash config dot php and then we can hit enter now we need to edit this configuration file to add the username and password for the database so through this we can type in sudo vim and then wp config dot php edit enter and we basically move down here and we replace the database name here with the name of our database which in my case was my wordpress the username here on the bottom so let's replace this with the username we choose in my case it was my name and the same goes for the password down here so we'll replace with our password which in my case it was one two three four very secure password and then we can save the file and exit view and let's exit the terminal here and go back to firefox and let's type in here localhost and then wordpress and hit enter and you can see here we have our welcome screen for wordpress where we can configure our website so let's do this site title name i will call this one test site and the username is going to be my name this is the username for the wordpress installation not for the database then you can choose here a password again i'm gonna use the one two three four it's just an example and i'm gonna confirm this we need to type in an email here this is mandatory so i'm just gonna type in here info at my website and i'm going to click install wordpress now i don't want to save this right now and there you go wordpress has been installed and let's click login and type in the username and the password and we are now in wordpress so let's go to test site here right click open link in new tab and we have our website up and running and this is how you can install wordpress on arch linux with a web server it's not a difficult process and if you have a website that you would like to develop or you would like to test out a little bit wordpress this is a fairly simple way to do it there you go guys this is how you can install the lamp stack and wordpress in arch linux it's a very simple procedure and as you can see arch linux is very fast being also a very light distribution and you can really work well with wordpress if you have any questions about the video guys let me know in the comments below i will be more than happy to answer them as soon as i can and i hope you like this video guys if you did please hit the thumbs up and subs to the channel if you haven't already subs always helps us out and if you want to support the channel you can do so by visiting our patreon website a big thank you to our patreons always and if you want to donate to the channel you can do so by visiting our website and donate via paypal thank you so much for watching this video guys and i'll see you very soon in the next one
Info
Channel: EF - Linux Made Simple
Views: 5,262
Rating: 5 out of 5
Keywords: Linux, Arch Linux, Software, Training, how to install, install arch linux, install linux, tech tips, it tips, linux tips, UEFI, linux help, linux uefi, lamp, wordpress
Id: GYnmm97bPxg
Channel Id: undefined
Length: 17min 31sec (1051 seconds)
Published: Thu Oct 22 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.