VPS Tutorial Powered by PhotonVPS.

28Jan/111

CentOS – Installing Nginx via yum

Nginx (pronounced “Engine X”) is a lightweight web server that offers speed and flexibility without all of the extra features that larger web servers like Apache offer. Although it is a free and open source application, CentOS does not offer the latest version in its default YUM repository. To install it, you need to add the EPEL (Extra Packages for Enterprise Linux) repository, which is part of the Fedora Project.

1. Install the EPEL repository:

# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-3.noarch.rpm

2. Install nginx

# yum install nginx

3. You will be asked to install the gpg-key for EPEL. Answer yes

4. Start Nginx

# /etc/init.d/nginx start

5. Check the installation by going to your web server’s default site, either using your ip address or domain name.

Filed under: CentOS, Linux Leave a comment
Comments (1) Trackbacks (0)
  1. I had a problem using the version nginx from epel 5-4 on a VPS, as it is built with AIO support but the VPS didn’t have AIO in the kernel, so nginx would just spew errors about eventfd() to its error.log when I tried to start it. Luckily, it was straightforward to install the development tools from the web admin console, so I did that and then rebuilt the package from source:

    - grabbed the source rpm (http://download.fedora.redhat.com/pub/epel/5/SRPMS/nginx-0.8.53-1.el5.src.rpm)
    - installed it
    - went to SPECS in my rpm topdir (e.g. /usr/src/redhat) and found the nginx.spec file
    - edited it, removing the “–with-file-aio” line under “./configure”
    - built it (rpmbuild -ba nginx.spec), installing needed dependencies along the way with yum
    - after I got through the rpmbuild, went to ../RPMS/i386 to get the finished rpm, and installed it.

    The config of nginx in the package might not be good performance wise for use without AIO, but it should at least get you going.


Leave a comment

Trackbacks are disabled.