Back to basics - apache?

May 21, 2017 161 views
Apache Deployment

I've just created a droplet and am basically unsure what to do next. I've got the Node server up and running with mysql, can access everything remotely but, what now?

Do I need to install Apache? I would have presumed that would have been done but I cannot access the site by IP address so I guess not.

Where do my files go? Which folder resolves as web root?

Is there a full on tutorial anywhere that gives a start to finish example?

Many thanks

3 Answers

Where to go next depends on what you want and what you have. You mentioned Node server, if your app is based on Node.js, I can recommend taking few additional steps to get it ready for production. How To Set Up a Node.js Application for Production on Ubuntu 16.04 will explain you how. This will also setup you Nginx, which is used to proxy app (explained in tutorial).

For files if you have Node app, put it anywhere you want, even home directory will do the job.

If you're not based on Node, and you have Web site you want to serve, you will have to install Apache or Nginx manually and put your files in /var/www/html. One of following two tutorials will help you:
How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04
How To Install Linux, Nginx, MySQL, PHP (LEMP stack) in Ubuntu 16.04.

Choose whatever you like more, or have more experience with. First is based on Apache, while second is based on Nginx.

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...


When it comes to NodeJS, most applications run on non-standard ports, such as 3000 (for example), so without a web server running in front to proxy the requests on port 80 to the application running on port 3000, the only way to access the application will be by appending the port to the end of the domain or IP address.

If you go the NGINX route (which is what I'd recommend), check my comment here for a working example of how to setup a server block for NGINX to proxy requests to your NodeJS application:

Have another answer? Share your knowledge.