Good night, help me I am tired and I do not understand this tutorial, I do all the steps to get to install php that says tudominio can be more specific please in the /var/www/yourdomain folder that should be put because I have tried to put in two ways /var/www/domain also /var/www/ and no way for me will not go well always fail me. Help me I’m tired of always removing all lamp and it always fails for me, if the others happened that. In the PHP installation part that step always fails me with the folders set your_dominio and also in the part that says $USER to be put there. Thank you for your help

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Hi @DavidLuceroSigcho,

As far as I understand you are looking at this tutorial, correct? :

Let’s go over it step by step.

To install Apache, you type in:

sudo apt update
sudo apt install apache2

You need to be inside the droplet to do it.

Once the installation is finished, you’ll need to adjust your firewall settings to allow HTTP traffic. UFW has different application profiles that you can leverage for accomplishing that. To list all currently available UFW application profiles, you can run:

sudo ufw app list

To allow traffic to apache type in

sudo ufw allow in 'Apache Full'

Now, you’ll need to install PHP. Run the following command in your droplet

sudo apt install php libapache2-mod-php php-mysql php-dom php-simplexml php-ssh2 php-xml php-xmlreader php-curl  php-exif  php-ftp php-gd  php-iconv php-imagick php-json  php-mbstring php-posix php-sockets php-tokenizer

Now you both have PHP and Apache installed. Let’s configure your first virtual host file for Apache.

Create the directory for your_domain as follows:

sudo mkdir /var/www/your_domain

Be sure to replace your_domain with your actual domain. The one that you are going to use for people to open your website.

sudo chown -R www-data:www-data /var/www/your_domain

Then, open a new configuration file in Apache’s sites-available directory using your preferred command-line editor. Here, we’ll use nano:

sudo nano /etc/apache2/sites-available/your_domain.conf

This will create a new blank file. Paste in the following bare-bones configuration:

<VirtualHost *:80>
    ServerName your_domain
    ServerAlias www.your_domain
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/your_domain
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

Again, everywhere you see your_domain your domain, change it with your actual domain name.

Once you’ve done the above type in:

sudo a2ensite your_domain
sudo a2dissite 000-default
sudo apache2ctl configtest
sudo systemctl reload apache2

Now you have a working website.


by Erika Heidi
A “LAMP” stack is a group of open-source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL database, and dynamic content is processed by PHP. In this guide, we will install a LAMP stack on an Ubuntu 20.04 server.

Hi @DavidLuceroSigcho,

Don’t worry about it!

Actually, you can name your folder however you like, it can be




It really is a personal choice.

Having said that, the important bit is you Apache configuration file.

If you decide to leave the folder as


you configuration file should look like this:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/clousofte
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined