Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

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!
I can see that you have used 4 domains. How can I install LAMP + Nginx to work with magento. EX : LEMP + magento and Apache use for reverse proxy or as a load balancer.
This comment has been deleted
hey Jesin,
Your tutorials are top notch and i have learned so much from them, thank you. I want to ship this setup to local install with docker – do you if one already exists over at docker?
also - i read about the httpoxy vulnerability and i noticed that you stressed the location directive was important to keep passwords, htaccess, etc secure – so even though the article linked states unsetting the proxy header in client requests or using different enviro variables as simple fixes – does this apply to this tutorial or have you already allowed for security with the directive?
Even though I am learning loads from you – I am still simple minded, lol. thanks for any advice.
re: recent do newsletter article: https://www.digitalocean.com/community/tutorials/how-to-protect-your-server-against-the-httpoxy-vulnerability?utm_medium=newsletter&utm_source=newsletter&utm_campaign=072116
Thanks for this @jesin it’s great. I did everything exactly like you explained and it worked. Except for step 9 where instead of creating my own certificates i used let’s encrypt certbot. This certificates are super easy to install, they are valid, and best of all free.
Certbot for Nginx on Ubuntu 16.04(xenial)
After installing with: sudo apt-get install letsencrypt
you can create a valid cert using something like:
letsencrypt certonly --webroot -w /var/www/foobar.net -d foobar.net
Just remember that if you also want the cert for the www.foobar.net you will have to do something like this instead:
letsencrypt certonly --webroot -w /var/www/foobar.net -d foobar.net -d www.foobar.net
So now, the NGINX virtual host named apache will look like something like this:
server {
listen 80;
listen 443 ssl;
server_name foobar.net;
ssl on;
ssl_certificate /etc/letsencrypt/live/foobar.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/foobar.net/privkey.pem;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://104.236.224.53:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 80;
listen 443 ssl;
server_name test.io;
ssl on;
ssl_certificate /etc/letsencrypt/live/test.io/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/test.io/privkey.pem;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://104.236.224.53:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
How about installing MYSQL is it the same as in a LAMP/LEMP installation?
Owncloud users: seems that when you install ownlcoud using this tutorial and then the How to Install Owncloud on Ubuntu 16.04 tutorial, it resets Apache to use mod_php but if you do again:
sudo a2dismod php7.0
ando reload apache
php-fpm it’s again enabled.
Maybe owncloud does not support php-fpm?
I think this is weird, dont know if its standard behavior but i am suspecting that a droplet’s name affects the configuration of an apache virtual host.
Let say you have created a droplet and finished step 5 of your tutorial @jesin
If the A record of one of your domains points to your droplet’s IP with a name or value of @, (if you pointed your domain to your droplet) and your droplet’s name happens to match that of your domain, then you will get the apache default page even if your virtual host includes the ServerName directive and points the domain a different folder.
Conditions:
1.- Lets say you have a domain on namecheap called whataday.com 2.- You point that domain with a value of @ to your droplet’s IP (pointed the domain to your droplet) 3.- Your droplet is named whataday.com
Then you will get this result. Or at least that what happened to me. I have ereased my cache many times, tried 4 different browsers on two different computers. I alway get the apache default page for the domain that matches my droplet’s name. The other 2 domains i created are fine, just like your tutorial teaches. (i did step 5 with 3 domains instead of two).
I am aware from the apache docs that if you omit the ServerName directive from any name-based virtual host, the server will default to a fully qualified domain name (FQDN) derived from the system hostname.
But did not expect the droplet’s name to affect the vhost configuration even if the ServerName directive is included within the vhost.
Home some expert could enlighten me
When browsing my app through the Nginx proxy pass (served by apache) all i got was a blank screen full of gibberish and strange charsets. Nothing else at all. No PHP Errors, no clues, no nothing.
It took me more than 8 hours to finally come up with the solution, turns out the nginx vhost for apache needed this line:
proxy_set_header Accept-Encoding "";