[TUT]How to install Nginx Web Server ~ Domenic Edition

Status
Not open for further replies.

Dom

Active Member
608
2010
53
0
Update any Pre-Installed Sofware :

Code:
 yum clean all
    yum -y update glibc\*
    yum -y update yum\* rpm\* python\*
    yum clean all
    yum -y update
Secure /tmp

Code:
rm -rf /tmp
    mkdir /tmp
    mount -t tmpfs -o rw,noexec,nosuid tmpfs /tmp
    chmod 1777 /tmp
Code:
rm -rf /var/tmp
    ln -s /tmp /var/tmp
Code:
Install NSD
Code:
wget http://www.nlnetlabs.nl/downloads/nsd/nsd-3.2.8.tar.gz

    tar xzvf nsd-3.2.8.tar.gz
    cd nsd-3.2.8
    ./configure
    make
    make install
==============================
Code:
groupadd nsd
    useradd -g nsd -s /sbin/nologin -M nsd
=============================

Code:
mkdir /var/run/nsd
    chown -R nsd:nsd /var/run/nsd/
    chown -R nsd:nsd /var/db/nsd/
    mkdir /etc/nsd/master
    mkdir /etc/nsd/slave
    chown -R nsd:nsd /etc/nsd/
    cp -R $CUR_DIR/config/nsd/* /etc/nsd/
    cd /etc/sysconfig/
    mv $CUR_DIR/sysconfig/nsd nsd
    cd /etc/init.d/
    mv $CUR_DIR/init/nsd nsd
    chmod +x /etc/init.d/nsd
    chkconfig --levels 235 nsd on
    /etc/init.d/nsd start
Install NT
Code:
 yum -y install ntp
        chkconfig --levels 235 ntpd on
        ntpdate pool.ntp.org
        /etc/init.d/ntpd star
Now We install Nginx.
Code:
/sbin/service httpd stop
      chkconfig httpd off
Code:
http://nginx.org/download/nginx-1.0.2.tar.gz
Code:
tar xvfz nginx-1.0.2.tar.gz
    cd nginx-1.02
    ./configure --sbin-path=/usr/local/sbin --with-http_ssl_module
    make
    make install
Code:
groupadd nginx
    useradd -g nginx -d /home/nginx -s /sbin/nologin nginx
    mkdir /home/nginx/domains
    mkdir -p /home/nginx/domains/demo.com/{public,private,log,backup}
    cp -R $CUR_DIR/htdocs/demo.com/* /home/nginx/domains/demo.com/public
    chown -R nginx:nginx /home/nginx
    cp -R $CUR_DIR/htdocs/default/* /usr/local/nginx/html
    rm -rf $CUR_DIR/htdocs
    mkdir /usr/local/nginx/conf/conf.d/
    cp -R $CUR_DIR/config/nginx/* /usr/local/nginx/conf/
    cd /etc/init.d/
    mv $CUR_DIR/init/nginx nginx
    chmod +x nginx
    ./nginx start
    chkconfig --levels 235 nginx on
Install PHP

Code:
Yum install php
Install MYSQL

Code:
 yum -y install mysql mysql-devel mysql-server
    mv $CUR_DIR/config/mysql/my.cnf /etc/my.cnf

    chkconfig --levels 235 mysqld on
    /etc/init.d/mysqld start
Code:
mysql_secure_installation
Install SendMail

Code:
yum -y install sendmail mailx
    chkconfig --levels 235 sendmail on
    /etc/init.d/sendmail start
And Done! :D , You have now install a nice little Nginx WebServer ;)
 
16 comments
If you dont like to bother with all above commands and using centos, here is an alternative script which will download everything and install for you with only couple of commands..
Code:
wget http://freevps.us/downloads/nginx-centos.sh
bash nginx-centos.sh

source
https://freevps.us/thread-528.html
 
There is no panel installed, you need to manage through SSH, if you are looking for a free panel like cpanel you can install kloxo or webmin.

to install kloxo here are commands, make sure its a fresh install
Code:
wget http://download.lxlabs.com/download/kloxo/production/kloxo-install-master.sh
sh ./kloxo-install-master.sh

note* it will install apache not nginx.
 
You could always install ISPmanager




wget "http://download.ispsystem.com/install.sh"
sh install.sh





======================================================





Code:
rpm -ihv [URL]http://centos.alt*****repository/centos/5/i386/centalt-release-5-3.noarch.rpm[/URL]
Code:
rpm -ihv [URL]http://centos.alt*****repository/centos/5/x86_64/centalt-release-5-3.noarch.rpm[/URL]

Code:
yum makecache /usr/local/ispmgr/sbin/pkgctl cache
Code:
/etc/init.d/nginx/restart
 
Last edited:
Status
Not open for further replies.
Back
Top