Installing the Apache web server

yum install httpd

Verifying a successful installation of Apache:

rpm -qa | grep -i httpd

Define automatic loading at startup for a server using chkonfig:

chkconfig httpd on

run Apache:

service httpd start

A little bit of tuning to the server, open the apache config file

nano /etc/httpd/conf/httpd.conf

To check if the global variables are preceded by a # remove

ServerName ххх.ххх.ххх.ххх:80  #тут айпишник вашего сервака

NameVirtualHost *:80                    # it is necessary if you have multiple domains on a single IP (a domain name in a directory push apache)

Include virthosts/*.conf                 # here lie the configuration files of your virtual hosts, virthosts create in the / etc / httpd /

Ctrl+O Ctrl+X

service httpd restart

Now let's create catalogs and website configuration file

nano /etc/httpd/virthosts/ru.webserver.conf    with this content

<VirtualHost *:80>
    ServerName webserver.ru

    DocumentRoot /var/www/virthosts/ru.webserver/html
    ServerAdmin admin@localhost>

    <Directory / >
        Allow from all
        AllowOverride All
        Options Indexes FollowSymLinks
    </Directory>

    ErrorLog /var/www/virthosts/ru.webserer/logs/error_log
    CustomLog /var/www/virthosts/ru.webserver/logs/access_log common
</VirtualHost>

Ctrl+O Ctrl+X

Create a directory of the files of the website, the rights to catalogs 755 people, depending on your policy (apache or your)

mkdir /var/www/virthosts

mkdir /var/www/virthosts/html

mkdir /var/www/virthosts/logs

Create a test page:
echo '<h1>It Works!</h1>' > /var/www/virthosts/html/index.html

service httpd restart

Now, if another computer http://webserver.ru dial you'll see a page that says It Works

Keep in mind that webserver.ru necessary to register in the hosts file in the form

ххх.ххх.ххх.ххх webserver.ru

In this case, your browser will know where to look webserver.ru If Apache is used in conjunction with Nginx, it is necessary to deliver a module from the repository mod_rpaf atomic users will then each with its own IP

wget -q -O - http://www.atomicorp.com/installers/atomic | sh

We put as usual

yum install mod_rpaf

Create or open a file if there is a config /etc/httpd/conf.d/mod_rpaf.conf and results in mind

nano /etc/httpd/conf.d/mod_rpaf.conf

LoadModule rpaf_module modules/mod_rpaf.so

<IfModule mod_rpaf.c>

  RPAF_Enable       On
  RPAF_ProxyIPs     127.0.0.1 ххх.ххх.ххх.ххх                 # here enumerate all the IP from which will go to questions
  RPAF_Header       X-Forwarded-For
  RPAF_SetHostName  On
  RPAF_SetHTTPS     On
  RPAF_SetPort      On
</IfModule>

Ctrl+O Ctrl+X

Restart Apache

service httpd restart

Like this.