How To Install Lamp Server In Debian Packages
Posted : adminOn 10/11/2017How to Install LAMP server on Ubuntu. I recommend you install all the components of L. A. M. P separately. But that takes some time and patience. If you are looking for One click installation, there are many such packages available. The following explains the installation of Bitnami LAMPstack. Download the recommended installer from here https bitnami. Continue reading How to install LAMP Apache, MySQL, PHP. How to install LAMP Apache, MySQL, PHP stack on Debian 8. And also the packages aptget install. Apache-Enable-Start-Status.png' alt='How To Install Lamp Server In Debian Packages' title='How To Install Lamp Server In Debian Packages' />Provide execution permission to the. Run it. Just double click on it or run from terminal. The installation processes is self explanatory. Recommended way installing all the components separately. Step 1 Install Apache and Allow in Firewallsudo apt get update. Next, assuming that you have followed the initial server setup instructions to enable the UFW firewall, make sure that your firewall allows HTTP and HTTPS traffic. How To Install Lamp Server In Debian Packages' title='How To Install Lamp Server In Debian Packages' />You can make sure that UFW has an application profile for Apache like so sudo ufw app list. Available applications. Apache Secure. If you look at the Apache Full profile, it should show that it enables traffic to ports 8. Apache Full. Profile Apache Full. Title Web Server HTTP,HTTPS. Description Apache v. Apache web. Allow incoming traffic for this profile sudo ufw allow in Apache Full. You can do a spot check right away to verify that everything went as planned by visiting your servers public IP address in your web browser see the note under the next heading to find out what your public IP address is if you do not have this information already http yourserverIPaddress or just type localhost in URL barYou will see the default Ubuntu 1. Configure-LAMP-Server-on-Debian-9-PHP-Information.png' alt='Debian Show Installed Packages' title='Debian Show Installed Packages' />Apache web page, which is there for informational and testing purposes. It should look something like this If you see this page, then your web server is now correctly installed and accessible through your firewall. How To Find your Servers Public IP Address. Step 2 Install My. SQLRun the command sudo apt get install mysql server. How To Install Lamp Server In Debian Packages' title='How To Install Lamp Server In Debian Packages' />During the installation, your server will ask you to select and confirm a password for the My. SQL root user. This is an administrative account in My. SQL that has increased privileges. Think of it as being similar to the root account for the server itself the one you are configuring now is a My. SQL specific account, however. Make sure this is a strong, unique password, and do not leave it blank. When the installation is complete, we want to run a simple security script that will remove some dangerous defaults and lock down access to our database system a little bit. Start the interactive script by running sudo mysqlsecureinstallation. You will be asked to enter the password you set for the My. SQL root account. Next, you will be asked if you want to configure the VALIDATE PASSWORD PLUGIN. Warning Enabling this feature is something of a judgment call. If enabled, passwords which dont match the specified criteria will be rejected by My. SQL with an error. This will cause issues if you use a weak password in conjunction with software which automatically configures My. SQL user credentials, such as the Ubuntu packages for php. My. Admin. It is safe to leave validation disabled, but you should always use strong, unique passwords for database credentials. Answer y for yes, or anything else to continue without enabling. VALIDATE PASSWORD PLUGIN can be used to test passwords. It checks the strength of password. Would you like to setup VALIDATE PASSWORD plugin Press yY for Yes, any other key for No Youll be asked to select a level of password validation. Keep in mind that if you enter 2, for the strongest level, you will receive errors when attempting to set any password which does not contain numbers, upper and lowercase letters, and special characters, or which is based on common dictionary words. There are three levels of password validation policy LOW Length 8. MEDIUM Length 8, numeric, mixed case, and special characters. STRONG Length 8, numeric, mixed case, special characters and dictionary file. Please enter 0 LOW, 1 MEDIUM and 2 STRONG 1. If you enabled password validation, youll be shown a password strength for the existing root password, and asked you if you want to change that password. DigitalOcean Community. Menu. Since the virtual private server is already running Debian. LAMP server. Step OneInstall. This tutorial is going to show you how to install LAMP Server on Debian 9 Stretch. The following packages were automatically installed and are no longer required. How to Install Nextcloud on Debian 9. LAMP server on Debian. PHP Packages Before you install. Tasksel is a Debian. Because the package managers now have most of the tasks as metapackages, tasksel is. To Install and Configure LAMP on Debian 9 LAMP Stack. The following packages were automatically. Reading. If you are happy with your current password, enter n for no at the prompt Using existing password for root. Estimated strength of the password 1. Change the password for root Press yY for Yes, any other key for No n. For the rest of the questions, you should press Y and hit the Enter key at each prompt. This will remove some anonymous users and the test database, disable remote root logins, and load these new rules so that My. SQL immediately respects the changes we have made. At this point, your database system is now set up and we can move on. Step 3 Install PHPRun the command sudo apt get install php libapache. This should install PHP without any problems. Well test this in a moment. In most cases, well want to modify the way that Apache serves files when a directory is requested. Currently, if a user requests a directory from the server, Apache will first look for a file called index. We want to tell our web server to prefer PHP files, so well make Apache look for an index. To do this, type this command to open the dir. It will look like this lt If. Module moddir. c. Directory. Index index. If. Module. We want to move the PHP index file highlighted above to the first position after the Directory. Index specification, like this lt If. Module moddir. c. Directory. Index index. If. Module. When you are finished, save and close the file by pressing Ctrl X. Youll have to confirm the save by typing Y and then hit Enter to confirm the file save location. After this, we need to restart the Apache web server in order for our changes to be recognized. You can do this by typing this sudo systemctl restart apache. We can also check on the status of the apache. LSB Apache. 2 web server. Loaded loaded etcinit. Drop In libsystemdsystemapache. Active active running since Wed 2. EDT 4. 5s ago. Docs man systemd sysv generator8. Process 1. 35. 81 Exec. Stopetcinit. dapache. SUCCESS. Process 1. Exec. Startetcinit. SUCCESS. Tasks 6 limit 5. CGroup system. sliceapache. Apr 1. 3 1. 4 2. Stopped LSB Apache. Apr 1. 3 1. 4 2. Starting LSB Apache. Apr 1. 3 1. 4 2. Starting Apache httpd web server apache. Apr 1. 3 1. 4 2. AH0. Could not reliably determine the servers fully qualified domain name, using 1. Set the Server. Nam. Apr 1. 3 1. 4 2. Apr 1. Started LSB Apache. Install PHP Modules. To enhance the functionality of PHP, we can optionally install some additional modules. To see the available options for PHP modules and libraries, you can pipe the results of apt cache search into less, a pager which lets you scroll through the output of other commands apt cache search php less. Use the arrow keys to scroll up and down, and q to quit. The results are all optional components that you can install. It will give you a short description for each libnet libidn perl Perl bindings for GNU Libidn. PHP development packages. HTML embedded scripting language CGI binary default. PHP scripting language default. Common files for PHP packages. CURL module for PHP default. Files for PHP module development default. GD module for PHP default. GMP module for PHP default. To get more information about what each module does, you can either search the internet, or you can look at the long description of the package by typing apt cache show packagename. How to Install LAMP Stack on Debian 9 Stretch. This tutorial is going to show you how to install Apache, Maria. DB and PHP7 LAMP stack on Debian 9 stretch. LAMP is the most common web service stack for building dynamic websites and web applications. Its made up of four components Linux, Apache, My. SQLMaria. DB, PHP Linux is the operating system Apache is the web server My. SQLMaria. DB is database PHP is a server side scripting language. All of the four components are free and open source. However, since My. SQL is now owned by Oracle and theres a chance that Oracle turns it to a closed source product, we will choose Maria. DB instead of My. SQL. You can follow this tutorial on a VPS Virtual Private Server or on a local Debian 9 computer. Please note that you need to have root privilege when installing software on Debian. You can add sudo at the beginning of a command, or use su command to switch to root user. Step 1 Update Software Packages. Before we install the LAMP stack, its a good idea to update repository and software packages. Run the following command on your Debian 9 OS. Step 2 Install Apache Web Server. Enter the following command to install Apache Web server. The apache. 2 utils package will install some useful utilities like Apache HTTP server benchmarking tool ab. After its installed, Apache should be automatically started. Check its status with systemctl. Output apache. The Apache HTTP Server. Loaded loaded libsystemdsystemapache. Active active running since Sun 2. UTC 5min ago. Main PID 1. CGroup system. sliceapache. If its not running, use systemctl to start it. Its also a good idea to enable Apache to automatically start at boot time. Check Apache version sudo apache. Output Server version Apache2. Debian. Server built 2. T1. 8 3. 7 3. 3Now type in the public IP address of your Debian 9 server in the browser address bar. You should see It works Web page, which means Apache Web server is running properly. You can use the following commands to fetch the public IP address of your Debian 9 server in the terminal. If you are installing LAMP on your local Debian 9 box, then you should type 1. Finally, we need to set www data Apache user as the owner of web root directory. By default its owned by root user. RStep 3 Install Maria. DB Database Server. Maria. DB is a drop in replacement for My. SQL. Enter the following command to install it on Debian 9. Maria. DB is recommended over My. SQL. As a matter of fact, if you try to install My. SQL on Debian 9 using the following command, it will install Maria. DB and set Maria. DB as the default database server. After its installed, Maria. DB server should be automatically stared. Use systemctl to check its status. Output mariadb. Maria. DB database server. Loaded loaded libsystemdsystemmariadb. Active active running since Sun 2. UTC 1min 3. 7s ago. Main PID 1. 61. 27 mysqld. Status Taking your SQL requests now. CGroup system. slicemariadb. If its not running, start it with this command sudo systemctl start mariadb. To enable Maria. DB to automatically start at boot time, runsudo systemctl enable mariadb. Now run the post installation security script. When it asks you to enter Maria. DB root password, press Enter key as the root password isnt set yet. Then enter y to set the root password for Maria. DB server. Next, you can just press Enter to answer all remaining questions. This will remove anonymous user, disable remote root login and remove test database. This step is a basic requirement for Maria. DB database security. Now you can use the following command to log in to Maria. DB server. sudo mariadb u root. To exit, runexit Check Maria. DB server version information. Output mariadb Ver 1. Distrib 1. 0. 1. 2. Maria. DB, for debian linux gnu x. Step 4 Install PHP7. Enter the following command to install PHP7. Enable the Apache php. Apache Web server. Check PHP version information. Output PHP 7. 0. May 1. NTS. Copyright c 1. The PHP Group. Zend Engine v. Copyright c 1. 99. Zend Technologies. Zend OPcache v. 7. Copyright c 1. 99. Zend Technologies. To test PHP scripts with Apache server, we need to create a info. Web root directory. Muruga Muruga Om Muruga Mp3 Song more. Paste the following PHP code into the file. Save and close the file. Now in the browser address bar, enter server ip addressinfo. Replace sever ip address with your actual IP. If you follow this tutorial on your local computer, then type 1. You should see your servers PHP information. This means PHP scripts can run properly with Apache web server. You can find that Zend OPcache is enabled. Congrats You have successfully installed Apache, Maria. DB and PHP7 on Debian 9 Stretch. For your servers security, you should delete info. Thats it I hope this tutorial helped you install LAMP stack on Debian 9 Stretch. As always, if you found this post useful, then subscribe to our free newsletter to get new tutorials. Rate this tutorialTotal 1.