Categories: Snippets

INSTALL Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 18.04

sudo apt-get update
sudo apt-get install apache2

sudo apache2ctl configtest
sudo ufw app list
sudo nano /etc/apache2/apache2.conf

Inside, at the bottom of the file, add a ServerName directive, pointing to your primary domain name. If you do not have a domain name associated with your server, you can use your server’s public IP address:

ServerName server_domain_or_IP

Example:- ServerName localhost

Install MySQL

sudo apt-get install mysql-server

Note :- Installation may complete without asking for root password. Then here is the solution for setting root password and secure MySQL –  MySQL Server Installed Without Password For Root user On Ubuntu 17.10 / 18.04

Install PHP

sudo apt install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php;
sudo apt-get install php-mcrypt;
sudo apt-get install php-cli;
sudo apt-get install php-gd;

sudo systemctl restart apache2
or
sudo /etc/init.d/apache2 restart

Recent Posts

How To Troubleshoot Socket Errors in MySQL – Ubuntu

MySQL manages connections to the database server through the use of a socket file, a special…

5 years ago

How to remove .html, .php, etc (extension) from URL?

To remove the .html extension from your urls, you can use the following code in…

5 years ago

Ubuntu with Apache2: Installing and Configuring Your SSL Certificate

Use free/paid SSL certificates https://www.sslforfree.com Enable SSL Module Replace 'default-ssl' with the real site name…

5 years ago

Create zip archive excluding specific Files & Directories

Create archive of all files under public_html directory ignoring all files and folders including text…

6 years ago

how to use sudo command to install .tar.gz?

To install some file *.tar.gz, you basically would do: Open a console, and go to…

6 years ago

Change ownership of the directory in ubuntu

The chown command has the following syntax: [crayon-663973e52e354707919258/] So in your example command it is your primary…

6 years ago