webapps:hugo
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| webapps:hugo [2023/09/16 11:19] – [Configure Nginx] lucid | webapps:hugo [2023/10/03 17:50] (current) – [Configure Nginx] lucid | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| Hugo itself is a static site generator, meaning it takes relatively simple input in the form of markup files and outputs working html code. The webserver, in this case nginx, will be used to host these files on the internet. Web hosting requires some understanding of how DNS works and a domain name, which I will not be going over in this guide, but will describe briefly, enough for most people to figure it out. | Hugo itself is a static site generator, meaning it takes relatively simple input in the form of markup files and outputs working html code. The webserver, in this case nginx, will be used to host these files on the internet. Web hosting requires some understanding of how DNS works and a domain name, which I will not be going over in this guide, but will describe briefly, enough for most people to figure it out. | ||
| + | \\ | ||
| + | \\ | ||
| + | \\ | ||
| =====Hugo Server===== | =====Hugo Server===== | ||
| Dependencies | Dependencies | ||
| - | sudo apt install git nginx golang | + | sudo apt install git golang |
| Line 25: | Line 27: | ||
| echo "theme = ' | echo "theme = ' | ||
| + | \\ | ||
| + | \\ | ||
| + | \\ | ||
| =====Nginx Server===== | =====Nginx Server===== | ||
| - | There are some other basic things you should know about setting up a web server. | + | There are some basic things you should know about setting up a web server. |
| Line 62: | Line 67: | ||
| listen 80; | listen 80; | ||
| server_name subdomain.domain.tld; | server_name subdomain.domain.tld; | ||
| - | root / | + | root / |
| } | } | ||
| </ | </ | ||
| Line 72: | Line 77: | ||
| listen 80; | listen 80; | ||
| server_name 192.168.1.4; | server_name 192.168.1.4; | ||
| - | root / | + | root / |
| } | } | ||
| </ | </ | ||
| Line 82: | Line 87: | ||
| Add a file to the web root to make sure that everything works in your web browser before moving the actual website to the server. | Add a file to the web root to make sure that everything works in your web browser before moving the actual website to the server. | ||
| - | sudo touch / | + | sudo touch / |
| sudo chown -R www-data: | sudo chown -R www-data: | ||
| Line 90: | Line 95: | ||
| Navigate your web browser to your domain or IP address and it should produce a white background with Hello World in the top left corner. | Navigate your web browser to your domain or IP address and it should produce a white background with Hello World in the top left corner. | ||
| + | \\ | ||
| \\ | \\ | ||
| \\ | \\ | ||
| \\ | \\ | ||
| =====Copying your Website to the Web Server===== | =====Copying your Website to the Web Server===== | ||
| - | For this all you need to do is copy your published hugo website to the web server. To publish your website you need to run '' | + | For this all you need to do is copy your published hugo website to the web server. To publish your website |
| Line 106: | Line 112: | ||
| put -R /publish | put -R /publish | ||
| | | ||
| - | Now ssh into your web server | + | Disconnect from the hugo server and ssh into the web server. The files that were just transferred to the web server need to be placed into the / |
| + | |||
| + | Move the files in the publish directory to / | ||
| + | |||
| + | mv ./publish/* / | ||
| + | chown -R www-data: | ||
| + | |||
| + | Restart nginx | ||
| + | |||
| + | sudo systemctl restart nginx | ||
| + | |||
| + | If everything went as expected, your hugo website should be available at your domain or IP, albeit without encryption. | ||
webapps/hugo.1694863144.txt.gz · Last modified: 2023/09/16 11:19 by lucid