Post Reply 
LNMP Server on CentOS
03-19-2012, 08:59 PM (This post was last modified: 03-20-2012 08:51 AM by DeathProxy.)
Post: #1
LNMP Server on CentOS
Step 1. install yum repo

//32 bit
rpm -ivh http://download.fedora.redhat.com/pub/ep...noarch.rpm
rpm -ivh http://dl.iuscommunity.org/pub/ius/stabl...noarch.rpm
//64 bit
rpm -ivh http://download.fedora.redhat.com/pub/ep...noarch.rpm
rpm -ivh http://dl.iuscommunity.org/pub/ius/stabl...noarch.rpm

Step 2. install MySQL

//Visit http://dev.mysql.com/downloads/mysql/5.5...#downloads
//You need to download 4 packages, they are:
MySQL-client MySQL-server MySQL-shared-compat MySQL-shared
//After you download them run:
rpm -ivh *.rpm
//change MySQL root password:
service mysql start
mysqladmin -u root password 'yourpasswd'
service mysql stop

Step 3. Add www account

groupadd www
useradd -g www -d /home/www www
// We add www as user of nginx and php-fpm

Step 4. install php

yum install php53u-cli php53u-common php53u php53u-devel php53u-mysql php53u-xmlrpc php53u-xml php53u-gd php53u-pdo php53u-tidy php53u-mcrypt php53u-mbstring php53u-pear php53u-pecl php53u-pecl-memcache php53u-pecl-apc php53u-fpm
//The current PHP version is 5.3.5-3, IUS' package's name is php53u
//You can run command blew to find out lastest version
yum list | grep -w \.ius\.

Step 5. configure php-fpm

//setup php-fpm
vim /etc/php-fpm.d/www.conf
//Find Unix user/group of processes
//change user & group to www

Step 6. Install Nginx

//visit http://nginx.org/en/download.html to get lastest Nginx
//for example, we use http://nginx.org/download/nginx-0.9.5.tar.gz

yum install pcre pcre-devel # these are depend by nginx
cd /tmp
wget http://nginx.org/download/nginx-0.9.5.tar.gz
tar -zxvf nginx-*.tar.gz
cd nginx-*
./configure --user=www --group=www --conf-path=/etc/nginx/nginx.conf --with-http_stub_status_module --with-http_ssl_module
make
make install
//register nginx as a service
vim /etc/init.d/nginx
//paste the script blew then run: chmod 755 /etc/init.d/nginx

#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# pidfile: /usr/local/nginx/logs/nginx.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
nginx="/usr/local/nginx/sbin/nginx"
prog=$(basename $nginx)
NGINX_CONF_FILE="/etc/nginx/nginx.conf"
[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
lockfile=/var/lock/subsys/nginx
start() {
[ -x $nginx ] || exit 5
[ -f $NGINX_CONF_FILE ] || exit 6
echo -n $"Starting $prog: "
daemon $nginx -c $NGINX_CONF_FILE
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
configtest || return $?
stop
start
}
reload() {
configtest || return $?
echo -n $"Reloading $prog: "
killproc $nginx -HUP
RETVAL=$?
echo
}
force_reload() {
restart
}
configtest() {
$nginx -t -c $NGINX_CONF_FILE
}
rh_status() {
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart|configtest)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
exit 2
esac

Step 7. Start at boot
chkconfig mysql on
chkconfig php-fpm on
chkconfig nginx on

Step 8. Start services
service mysql start
service php-fpm start
service nginx start

Finish
Source: http://www.vps-tutorial.info/2011/05/21/...on-centos/
P.S. - It's not my tutorial and I take no credit for it. I just found it on a website.
User Tools
Quote this message in a reply


03-20-2012, 12:23 AM
Post: #2
RE: LNMP Server on CentOS
Please add the source to this tutorial or I have to warn you for pure copy & pasting.

This is helpful:
http://freevps.us/thread-528.html
http://freevps.us/thread-1434.html
User Tools
Quote this message in a reply
03-20-2012, 01:11 AM
Post: #3
RE: LNMP Server on CentOS
This is the Source: http://www.vps-tutorial.info/2011/05/21/...on-centos/
User Tools
Quote this message in a reply
03-21-2012, 04:16 PM
Post: #4
RE: LNMP Server on CentOS
LNMP have a key to install the package.
But it is in Chinese.
Do not know whether we need, if anyone needs the English version can be made

HeartI want a free VPS.
vps,domain,webhosting coupon
YOU CAN FIND SEXY GIRL IN HERE
User Tools
Quote this message in a reply
Post Reply 


Forum Jump:



User(s) browsing this thread:
1 Guest(s)