Deploy a static website on a webserver

0 votes
Hey Guys! I have a Linux system and I need to deploy a static website on it. I know I need to use webservers but I don't know how to?

Can somebody help me?

Dec 13, 2019 in Linux Administration by Hannah
• 18,570 points

1 answer to this question.

0 votes

Hi @hannah. You are right, you need to use a webserver. Let me give you an example of how you can use Nginx. Follow these steps:

1. Install Nginx

sudo apt-get update
sudo apt-get install nginx

2. Move your static webpage content to the Nginx server. 

Create a directory in /var/www/

Move all the contents into this file.

Now you'll need to tell your Nginx about yours website

3. Configure you Nginx server, something like this:

server {
  listen 80 default_server;
  listen [::]:80 default_server;  root /var/www/;  index index.html;  server_name;  location / {
    try_files $uri $uri/ =404;

4. Now restart your Nginx server.

sudo systemctl restart nginx
answered Dec 13, 2019 by Travis

Related Questions In Linux Administration

0 votes
1 answer

Error when trying to install a few packages on ubuntu

Try executing the following commands and try ...READ MORE

answered Mar 15, 2019 in Linux Administration by Jobin
0 votes
1 answer

To run a shell script on a Unix console or Mac terminal

To run a non-executable sh script, use: sh myscript To run ...READ MORE

answered May 16, 2019 in Linux Administration by Upasana
• 8,620 points
0 votes
1 answer

Installation fails on xenial "Repository does not have a release file"

This bug is missing log files that ...READ MORE

answered May 22, 2019 in Linux Administration by Ishaan
0 votes
1 answer

Ubuntu 10.10: Connecting to a terminal to a serial-to-USB device on Maverick Meerkat

Check with dmesg | grep tty if system recognize ...READ MORE

answered Jun 10, 2019 in Linux Administration by Upasana
• 8,620 points
+1 vote
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
0 votes
1 answer
0 votes
1 answer

Enable https on a Linux system

Hi @hannah, you can execute the following ...READ MORE

answered Dec 13, 2019 in Linux Administration by Priyaj
0 votes
3 answers

How to uninstall Apache2 on Ubuntu?

apache2 is a meta package that just selects ...READ MORE

answered Dec 13, 2020 in Linux Administration by Gitika
• 65,930 points