Websites with Nginx on Arch Linux
Updated by Alex Fornuto
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:
hostname hostname -f
The first command should show your short hostname, and the second should show your fully qualified domain name (FQDN).
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:
pacman -Sy pacman -S pacman
Install the nginx web server by issuing the following command:
pacman -S nginx
/etc/rc.conf file, adding “nginx” to the “DEAMONS=” line as shown in the following excerpt:
DAEMONS=(syslog-ng network netfs crond sshd ntpd nginx)
To start the server for the first time, use the following command:
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.
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.
- Linode Docs nginx Documentation
- nginx Community Documentation
- Configure Perl and FastCGI with nginx
- Configure PHP and FastCGI with nginx
This guide is published under a CC BY-ND 4.0 license.