How VPS - How to use/setup VPS
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Arch

How To Install Nginx 1.14 On Arch Linux

How VPS by How VPS
August 8, 2019
in Arch, Uncategorized
0
0
SHARES
29
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Prerequisites
  2. Install Nginx 1.14 Web Server
  3. Virtual Hosts
  4. Want to contribute?


Prerequisites

  • A Vultr server running up to date Arch Linux (see this article.)
  • Sudo access.
    • Commands required to be ran as root are prefixed by #. The recommended way to run commands as root is to, as a regular user, prefix each of them with sudo.
  • Have a text editor installed, and be familiar with it, such as vi, vim, nano, emacs, or another similar editor

Install Nginx 1.14 Web Server

If you are using a firewall, you will need to enable incoming TCP traffic to port 80.

Install Nginx. There’s also the nginx package which is the stable branch instead of mainline, which is sort of like a long term support branch. It’s recommended to use the mainline branch, unless third party modules you need to use are incompatible with it:

# pacman -S nginx-mainline

Start Nginx, and make it start after every boot:

# systemctl enable --now nginx

Test that Nginx is running. Visit http://YOUR-SERVER-WEB-ADDRESS-OR-IP, and you will see its welcome page. (Run ip addr if you need to know find the IP address.)

Nginx’s configuration files are in /etc/nginx, and its main one is nginx.conf. The line server.location.root /usr/share/nginx/html; sets where it will look for web files. By default, the main Nginx process runs as root, but its worker processes run as user http. Nginx will be logged to /var/log/nginx/access.log.

Virtual Hosts

You can host multiple domain names from the same Nginx server, and serve them different content.

Create a folder to hold your virtual host configurations:

# mkdir /etc/nginx/sites-enabled

Create a configuration file for each virtual host; for example, /etc/nginx/sites-enabled/YOUR-DOMAIN-NAME.com; and populate it with the following configuration:

server {
    listen 80;
    server_name YOUR-DOMAIN-NAME.com;

    location / {
        root /usr/share/nginx/YOUR-DOMAIN-NAME.com;
        index  index.html index.htm;
    }
}

At the end of the http block in /etc/nginx/nginx.conf, add the following line:

include sites-enabled/*;

Restart Nginx:

# systemctl restart nginx

Requests Nginx receives to YOUR-DOMAIN-NAME.com will be served out of /usr/share/nginx/YOUR-DOMAIN-NAME.com. Note requests to Nginx not matching a specific server_name, (just the IP address, or another domain name resolving to your IP), will still be served out of the general server block location.root in /etc/nginx/nginx.conf, which defaults to /usr/share/nginx/html/.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
How VPS

How VPS

Related Posts

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers
Uncategorized

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

February 17, 2020
Install Arch Linux With Btrfs Snapshotting
Uncategorized

Install Arch Linux With Btrfs Snapshotting

February 13, 2020
Arch

Setup Mumble Server on Arch Linux

February 13, 2020
Next Post

How to Use HTTPS on Arch Linux Webserver

How To Install PostgreSQL 11.1 On Arch Linux

How to Install PHP 7.3 on an Arch Linux Webserver

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Follow Us

  • 121 Followers
  • 87.2k Followers

Recommended

Monitoring Your Server With Glances

3 years ago
Download a Local Copy of your Linode Backup

Download a Local Copy of your Linode Backup

4 years ago

How to Block or Disable Normal User Logins in Linux

4 years ago

How to Install and Configure TaskBoard on Ubuntu 16.04

3 years ago

Instagram

    Please install/update and activate JNews Instagram plugin.

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

Topics

Apache Web Server Bluehost Review 2019 Bluehost Review 2020 Bluehost Review 2021 Centmin Mod CentminMod centos install htop fsck htop install HTTP DoS attack Install Snort on an Ubuntu install Zabbix on CentOS install Zabbix on CentOS 7 Linux Commands linux guide linux install htop linux vps setup guide MariaDB MariaDB Error Mysql mysqld error optimize MariaDB optimize Mysql snort Ubuntu
No Result
View All Result

Highlights

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Webmin Reviews

Virtualmin Reviews

CentOS Web Panel Reviews

Ajenti Reviews

ISPConfig Reviews

Trending

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

by How VPS
February 25, 2022
0

I tried to update some extensions by use yum on centOs which I specified in Dockerfile. After...

How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020
Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

February 17, 2020
Webmin Reviews

Webmin Reviews

February 17, 2020
How VPS – How to use/setup VPS

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Visit our landing page to see all features & demos.
LEARN MORE »

Recent News

  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8 February 25, 2022
  • How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”? November 17, 2020
  • How to optimize Mysql or MariaDB November 3, 2020

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

[mc4wp_form]

© 2018 JNews - City News Magazine WordPress theme. All rights belong to their respective owners.
JNews is a top selling 2018 WordPress News, Blog, Newspaper & Magazine Theme.

No Result
View All Result
  • Home

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.