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 tu_dominio can be more specific please in the /var/www/your_domain folder that should be put because I have tried to put in two ways /var/www/domain also /var/www/www.domain.com 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
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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
</VirtualHost>
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.
Regards, KFSys
Don’t worry about it!
Actually, you can name your folder however you like, it can be
/var/www/clousofte
or
/var/www/www.clousofte.com
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
/var/www/clousofte
you configuration file should look like this:
<VirtualHost *:80>
ServerName clousofte.com
ServerAlias www.clousofte.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/clousofte
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.