Websites with Nginx on Arch Linux

Updated by Alex Fornuto

Contribute on GitHub

View Project | View File | Edit File

This guide has been deprecated and is no longer being maintained.

Nginx is a lightweight and high performance web server, designed with the purpose of delivering large amounts of static content quickly and with efficient use of system resources. In contrast to the Apache HTTP server, which uses a threaded or process-oriented approach to handling requests, nginx uses an asynchronous event-driven model to provide more predictable performance under load.

Before you begin installing the nginx web server, it is assumed that you have followed our getting started guide. If you’re new to Linux server administration, you may be interested in our introduction to Linux concepts guide, our beginner’s guide, and our administration basics guide.

Set the Hostname

Before you begin installing and configuring the components described in this guide, please make sure you’ve followed our instructions for setting your hostname. Issue the following commands to make sure it is set properly:

1
2
hostname
hostname -f

The first command should show your short hostname, and the second should show your fully qualified domain name (FQDN).

Installing nginx

Nginx is included in the Arch Linux software repositories. Issue following sequence of commands ensure that your system’s package manager and databases are up to date:

1
2
pacman -Sy
pacman -S pacman

Install the nginx web server by issuing the following command:

1
pacman -S nginx

Edit the /etc/rc.conf file, adding “nginx” to the “DEAMONS=” line as shown in the following excerpt:

/etc/rc.conf

DAEMONS=(syslog-ng network netfs crond sshd ntpd nginx)

To start the server for the first time, use the following command:

1
/etc/rc.d/nginx start

Congratulations! You now have a running and fully functional HTTP server powered by nginx. Continue reading our introduction to basic nginx configuration for more information about using and setting up the web server.

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

This guide is published under a CC BY-ND 4.0 license.