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
• 18,520 points
2,679 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
1,615 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,620 points
861 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 23, 2019 in Linux Administration by Ishaan
901 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,620 points
8,248 views
+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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,064 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
788 views
+1 vote
3 answers

How to uninstall Apache2 on Ubuntu?

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

answered May 14, 2019 in Linux Administration by Hemant
276,548 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP