• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • 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
35
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
Previous Post

Using Makepkg on Arch Linux

Next Post

How to Use HTTPS on Arch Linux Webserver

Next Post

How to Use HTTPS on Arch Linux Webserver

Leave a Reply Cancel reply

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

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

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"?

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

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • 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
  • About
  • Advertise
  • Careers
  • Contact

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

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

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

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet