9/6/2023 0 Comments Apache php mysqlLAMP (Linux, Apache, MySQL, PHP) Stack Setup Additionally, you will be able to learn how to install Composer, NPM and troubleshoot possible errors which can be occurred when setting up the MySQL server and phpMyAdmin. In this guide, mainly you will be able to learn how to install and set up the LAMP stack for a development environment. Usually, when we develop an application, we create at least 3 different and separate environments for development, stage and production. Restart MySQL server to apply the changes sudo systemctl restart mysqlĪllow port 3306 in UFW: sudo ufw allow 3306Īnd that is the MySQL server installed you will now need to configure/add users as you see fit.LAMP stack or Linux, Apache, MySQL and PHP are the main essential set of tools that you need to develop or run a PHP based web application or a CMS (Content Management System) such as Laravel and WordPress. Optional to allow remote connection to your MySQL: sudo nano /etc/mysql//mysqld.cnf Set up with more secure passwords: sudo mysql_secure_installationĪfter setting and validating your password: systemctl status rvice Now for the MySQL server install sudo apt install mysql-server To test that Certbots renew is functioning correctly run: sudo certbot renew -dry-run MySQL install On success you will now need to open port 443 for the HTTPS: sudo ufw allow 443Īs the certificate expires every 90 days instead of manually renewing it Certbot can do it for you. This will ask for your email address, terms agreement and if you want to be contacted by the Electronic Frontier Foundation about news and changes.Ĭhoose if you want to redirect to HTTPS or not. sudo certbot -apache -d -d Replace with the hostname assigned to your VPS Now to get an SSL certificate/s for your hostname. Install Certbot: sudo apt install -y certbot python3-certbot-apache sudo apt install -reinstall software-properties-commonĪnd then add the Certbot repository: sudo add-apt-repository ppa:certbot/certbot Time to get HTTPS or SSL for your webserver with a free let’s encrypt certificate. Installing PHP extensions is done with this command: sudo apt install php8.0-Ī quick method to install common extensions: sudo apt install php8.0- SSL install To check if PHP is installed and its version use: php -v Go ahead and restart Apache sudo systemctl restart apache2 Now finally actually downloading and installing PHP 8 and the apache module for PHP 8: sudo apt install php8.0 libapache2-mod-php8.0 Installing PHP 8 on Ubuntu 20.04 means you must first install the independent software sources: sudo apt install software-properties-commonĪnd then the repository for the PHP versions: sudo add-apt-repository ppa:ondrej/php PHP 8 is the most recent version of PHP and a main one too, it was released November 26th 2020. You will be greeted with the default page upon successful install You can also navigate to HTTP://SERVER_IP_HEREin a web browser to see if Apache is installed and able to be accessed. This is important as you don’t want to be blocked out of your server.Ĭheck Apaches status with: sudo systemctl status apache2 Make sure you have your SSH port or SSH in general allowed: sudo ufw allow 22 Now allow Apache traffic: sudo ufw allow 'Apache' You can install UFW with: sudo apt install ufw If it returns ufw: command not found that means UFW is not installed. When you run this command: sudo ufw app list Now for some firewall tinkering with UFW (Uncomplicated firewall). Install it with: sudo apt install apache2 Apache installĪpache is a popular, open-sourced HTTP server. Once that has finished you can now progress with this guide. The first step after SSH’ing into your server is to update the package list sudo apt update This post covers installing Apache with the brand new PHP 8, a MySQL server and finally enabling SSL with let’s encrypt for your hostname. Installing and setting up a LAMP stack on Ubuntu 20.04 圆4.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |