1

I installed Ubuntu 16 some years ago, and I remembered an option during installation that allowed me to install a few other functions, such as LAMP. Why is that option removed, and what is the easiest way to install it (with just basic Ubuntu server knowledge)? I've tried apt-get install lamp-server as sugested by a google search, but the terminal replies Unable to locate package lamp-server.

  • I suspect you are remembering (and seeking) tasksel. – user535733 Jun 08 '20 at 15:17
  • I don't remember having to type anything anywhere, it was an option during the Ubuntu setup, to include LAMP, Mailserver, SSH and some other features. –  Jun 09 '20 at 08:00

1 Answers1

0

The absolute minimum would be this:

  1. Open Terminal (or connect to the machine via SSH)

  2. Update apt:

    sudo apt update 
    
  3. Install Apache:

    sudo apt install apache2
    
  4. Ensure the Uncomplicated FireWall allows traffic:

    sudo ufw allow in "Apache Full"
    

    From here you can test that Apache is working by visiting the IP address of the system. For example, if you're installing on your local machine, you can use http://127.0.0.1 in your browser of choice.

  5. Install MySQL Server:

    sudo apt install mysql-server
    

    Once installed, you can interactively configure the database with:

    sudo mysql_secure_installation
    
  6. Install PHP:

    sudo apt install php libapache2-mod-php php-mysql php-dev php-json php-xml php-zip php-mbstring
    

    Note: Some additional, common packages are included here. I you're not going to use JSON, XML, or ZIP compression, feel free to exclude them. The Multi-Byte string (mbstring) and development packages are strongly encouraged, though.

  7. (Optional) Enable the Apache Headers and Redirect modules:

    sudo a2enmod redirect 
    sudo a2enmod headers 
    
  8. Restart Apache to ensure that everything is running:

    sudo service apache2 restart
    

This will give you the bare minimum of a working LAMP stack. From here, you can begin working with MySQL to create accounts and databases or modify the Apache virtual host configuration files to better suit your purposes.

matigo
  • 22,138
  • 7
  • 45
  • 75