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?

Thanks!!
Dec 13, 2019 in Linux Administration by Hannah
• 17,890 points
55 views

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/example.com

Move all the contents into this example.com 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/jgefroh.com;  index index.html;  server_name jgefroh.com www.jgefroh.com;  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
112 views
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,570 points
72 views
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
59 views
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,570 points
139 views
0 votes
1 answer
+13 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,400 points
311 views
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
64 views
0 votes
1 answer

How to uninstall Apache2 on Ubuntu?

Hey @Laksha, execute the following commands: $ sudo ...READ MORE

answered May 13, 2019 in Linux Administration by Hemant
1,912 views