Tag: server

step 9: install redis (redis.io store)

redis logo

Installation of redis on CentOS 6:

Redis (the redis.io key-value store) is available in the remy repo which depends on the epel repo:

If you didn't already previously add the remi repo to your repositories then follow the following step to do so.

I wanted the remi repo "Enterprise Linux 6 (with EPEL)" package, you may have to use another one depending on your OS and version, i used centos6 and therefore choosed to use the following commands:

step 8: install mongodb

first create a repository file for the 10gen repo:

# vi /etc/yum.repos.d/10gen.repo

press the "i" key to go into edit mode

paste the following content into the editor


[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0

step 6: install and configure php5, php-fpm and apc

php-fpm logo

We have just installed Nginx and now we want to host the php application we made. This is when php-fpm comes into play. Since the day i started playing around with php-fpm i loved it. You install php-fpm and then using the powerful configuration files you can setup multiple vhost on a single machine. Each php-fpm pool, can have it's own socket or run on it's own port, you can setup a different user and group for each pool and put as many ftp-users in that group as you want. You can even chroot the directory you as nginx public web directory, have an own php-ini per vhost and therefore also setup a different sessions folder for each pool.

install php5 and php-fpm:

php-fpm (PHP fastCGI process manager) is available in the remy repo which depends on the epel repo:

I wanted the remi repo "Enterprise Linux 6 (with EPEL)" package, you may have to use another one depending on your OS and version, i used centos6 and therefore choosed to use the following commands:

step 5: install and configure nginx

Nginx logo

NGINX is much more then just a server like Apache, that's probably why it gained so much market share over the few last years if you trust the Netcraft server market share statistics.

NGINX has two advantages over Apache, first one is super fast, second one it's consumes less resources then Apache. Those are two important wins in two areas that really matter when having to decide which server to choose when getting started. Nginx is so fast because it's event driven. You may already have seen how javascript uses events and asynchronous loading of data. Nginx is similar to this, it emits a request, but doesn't wait all the time for a response keeping the connection open. Nginx requests something, then closes the connection and does something else. But in the request is a callback. So when the requested data is ready the nginx callback gets called and the response is send through a new connection to nginx. This is why nginx can handle such a lot of connections.

But as i said NGINX is more then just a server. The powerful configuration mechanism lets you setup NGINX to be a proxy server for one or multiple apache servers. You can use it as load balancer for multiple node.js instances or "just" use it as normal server to host your php website. If it's a php website you want to host.

step 4: configure bind

First of all you need to find your named.conf (the bind configuration file)

There is tool called "locate" on your system that is useful to find files, but every time your add or delete a file, you need to update "locate"'s files database, to do so type:

# updatedb

now use the following command to find the named.conf file:

# locate named.conf

step 3: install bind (DNS software) and enable SELinux

I always like to install bind first, because this allows me to initialize the DNS transfer of my domain(s) name(s) which takes time, after the setup of bind and while waiting for the DNS transfer to occur, i have time to install and configure other things like the server software (apache / nginx) and the database (mysql / mongo db).

check if bind is installed

First check if bind (Berkeley Internet Name Domain is a domain name service software) is not already installed, to get a list of all the installed packages type:

step 2: ensure that your server software is up to date

A tool used on CentOS to update packages is yum. You will use this tool a lot during the next hours, to update packages already installed, download and install new packages. A very nice feature is that yum will automatically resolve dependencies of the packages you want to install and install the dependencies required by the package you have choosen.

step 1: centOS server installation and configuration series

This article is a series of articles in which i describe howto setup a dedicated server.

For my blog i wanted to test lots of new tools and ways to create a website. I will describe howto install Nginx with php-fpm as server. Nginx will get several virtual hosts, a "normal" vhost, an SSL vhost (howto add an SSL certificate to Nginx) as well as a sub-domain vhost. I will also use APC a pear package to speed up the execution of php scripts through opcode caching. As database i have choosen to use MongoDB a nice NoSQL database. I will also describe howto setup Bind DNS (chrooted) to manage domains, sub-domains as well as entries like a CNAME to replace the ugly Amazon Cloud Urls. As a CDN i will use Amazon Cloudfront. As FTP Server i will show you howto install VSFTP and howto create user accounts.

This first article will explain howto connect to your Server through SSH, i will use Putty for this task, read on if you want to know more.

  • First
  • Previous
  • 1
  • Next
  • Last