VPS Tutorial Powered by PhotonVPS.

9Oct/110

Set time-out settings for Windows 2003

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Using Terminal Services Configuration

1. Open Terminal Services Configuration.

2. In the console tree, click Connections.

3. In the details pane, right-click the connection for which you want to modify time-out settings, and then click Properties.

4. On the Sessions tab, above End a disconnected session, select the Override user settings check box. This allows you to configure time-out settings for the connection.

5. Configure the following time-out settings as appropriate:

- In End a disconnected session, select the maximum amount of time that a disconnected session remains on the server. When the time limit is reached, the disconnected session ends. When a session ends, it is permanently deleted from the server. Select Never to allow disconnected sessions to remain on the server indefinitely.

- In Active session limit, select the maximum amount of time that a user's session can remain active on the server. When the time limit is reached, either the user is disconnected from the session or the session ends. When a session ends, it is permanently deleted from the server. Select Never to allow the session to continue indefinitely.

- In Idle session limit, select the maximum amount of time that an idle session (a session without client activity) remains on the server. When the time limit is reached, either the user is disconnected from the session or the session ends. When a session ends, it is permanently deleted from the server. Select Never to allow idle sessions to remain on the server indefinitely.

Notes

To open Terminal Services Configuration, click Start, click Control Panel, double-click Administrative Tools, and then double-click Terminal Services Configuration.

Group Policy overrides the configuration set with the Terminal Services Configuration tool.

These settings affect every client that uses the connection to connect to the terminal server. To define Session settings on a per-user basis, use the User Configuration Group Policies or the Terminal Services Extension to Local Users and Groups and Active Directory Users and Computers.

Filed under: Windows No Comments
15Jun/110

Setting up DNS on a Linux Dedicated Server

Below are some great links for setting up DNS on a Linux Dedicated Server:

http://www.youtube.com/watch?v=1qY5Od7iDl4 - Part 1

http://www.youtube.com/watch?v=wMAlsPq6qTw - Part 2

Filed under: CentOS, Linux, OpenVZ, Xen No Comments
21May/110

LNMP Server on CentOS

Step 1. install yum repo

  • //32 bit
    rpm -ivh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
    rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-6.ius.el5.noarch.rpm
  • //64 bit
    rpm -ivh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
    rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-6.ius.el5.noarch.rpm

Step 2. install MySQL

  • //Visit http://dev.mysql.com/downloads/mysql/5.5.html?current_os=7#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

By the way, there is an easy solution which help you do the same, try LNMP Installer for RHEL & CentOS

Filed under: CentOS, Linux No Comments
9Feb/112

Set up a Minecraft Server on CentOS

Setting up a Minecraft server can be pretty difficult if you don't know what you're doing. This tutorial is to simplify running it on CentOS 5.

We'll need to following:

- Dedicated Server / Xen based VPS
- CentOS 5.x 32bit/64bit
- 1GB of RAM or more
- Latest Java JDK
- Minecraft Server

Let's start with getting a Xen VPS, grab one from PhotonVPS. You'll need a Xen one, so I'll recommend a WARP2 or higher.

Now, let's get started by installing Java-JDK:

yum install java-1.6.0-openjdk

Now, let's check if Java was installed:

which java

It should display the following if it was properly installed:

/usr/bin/java

We're done with that now, let's create a directory for Minecraft then install it:

1. Make sure we're in the root directory still:

cd

2. Now let's create the directory:

mkdir Minecraft

3. Enter the directory:

cd Minecraft

4. Time to get Minecraft:

wget http://minecraft.net/download/minecraft_server.jar

5. We'll need to make sure Minecraft as all the correct permissions:

chmod +x minecraft_server.jar

Minecraft is now installed!

From here we'll need to install "screen" to keep the Minecraft server running after we close the SSH session.

Install screen:

yum install screen

Now, we'll use the screen and run Minecraft from there.

screen

Starting up Minecraft now:

java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

(*1024 value can be changed depending on how much RAM your VPS has)
Ex. 512MB VPS - java -Xmx512M -Xms512M -jar minecraft_server.jar nogui
Ex. 2048MB VPS - java -Xmx2048M -Xms2048M -jar minecraft_server.jar nogui

To get back to the normal screen now you'll have to do the following:

Control + a + d

To get back to the screen where Minecraft is running:

screen -r

That's it for getting Minecraft up and running on CentOS!

If you need a VPS, check out PhotonVPS Xen based VPS and use coupon code "MINECRAFTVPS" to receive 10% recurring on all monthly plans.

http://www.photonvps.com/minecraft.html

Filed under: CentOS, Linux 2 Comments
28Jan/110

Kloxo – Processed Logs

Kloxo saves all the log files in the processed stats folder. What you need to do is go to your Kloxo control panel and do the following:

- Resources > Domain Defaults > Remove Processed Logs > Update

Filed under: CentOS, Linux No Comments
28Jan/110

How to install php-5.2 fpm on Ubuntu and Zend Optimizer

1. add apt key

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 19803648C18789EA

2. add the source into  /etc/apt/source.list.  the source is only avaiable for hardy and lucid version.

deb http://ppa.launchpad.net/jdub/ppa/ubuntu lucid main

root@ubuntu:~# apt-get update

root@ubuntu:~# apt-cache search php52
php52-pear - PEAR - PHP Extension and Application Repository
libapache2-mod-php52 - server-side, HTML-embedded scripting language (Apache 2 module)
php52 - server-side, HTML-embedded scripting language
php52-dev - Files for PHP5 module development
php52-fpm - server-side, HTML-embedded scripting language (FastCGI Manager)
php52-apc - Alternative PHP Cache
php52-common - server-side, HTML-embedded scripting language
php52-xdebug - Function traces and profiling for PHP
php52-cairowrapper - Cairo Wrapper Extension
php52-ioncube - ionCube Loader for PHP

3. install the fpm package

apt-get update

apt-get install php52-common php52-dev php52-fpm php52

4. vi /etc/init.d/php52-fpm

change the line

php_fpm_CONF=/etc/php53/php-fpm.conf

to

php_fpm_CONF=/etc/php52/php-fpm.conf

change the line

php_fpm_PID=/var/run/php52-fpm.pid

to

php_fpm_PID=/var/run/php-fpm.pid

4. edit the php fpm configure file : /etc/php52/php-fpm.conf

<?xml version="1.0" ?>
<configuration>
<section name="global_options">
<value name="pid_file">/var/run/php-fpm.pid</value>
<value name="error_log">/var/log/php-fpm.log</value>
<value name="log_level">notice</value>
<value name="emergency_restart_threshold">10</value>
<value name="emergency_restart_interval">1m</value>
<value name="process_control_timeout">5s</value>
<value name="daemonize">yes</value>
</section>
<workers>
<section name="pool">
<value name="name">default</value>
<value name="listen_address">/tmp/php-fcgi.sock</value>
<value name="listen_options">
<value name="backlog">-1</value>
<value name="owner"></value>
<value name="group"></value>
<value name="mode">0666</value>
</value>
<value name="php_defines">
<value name="sendmail_path">/usr/sbin/sendmail -t -i</value>
<value name="display_errors">0</value>
</value>
<value name="user">www-data</value>
<value name="group">www-data</value>
<value name="pm">
<value name="style">apache-like</value>
<value name="max_children">15</value>
<value name="apache_like">
<value name="StartServers">5</value>
<value name="MinSpareServers">5</value>
<value name="MaxSpareServers">15</value>
</value>
</value>
<value name="request_terminate_timeout">0s</value>
<value name="request_slowlog_timeout">0s</value>
<value name="slowlog">logs/slow.log</value>
<value name="rlimit_files">65535</value>
<value name="rlimit_core">0</value>
<value name="chroot"></value>
<value name="chdir"></value>
<value name="catch_workers_output">yes</value>
<value name="max_requests">1024</value>
<value name="allowed_clients">127.0.0.1</value>
<value name="environment">
<value name="HOSTNAME">$HOSTNAME</value>
<value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
<value name="TMP">/tmp</value>
<value name="TMPDIR">/tmp</value>
<value name="TEMP">/tmp</value>
<value name="OSTYPE">$OSTYPE</value>
<value name="MACHTYPE">$MACHTYPE</value>
<value name="MALLOC_CHECK_">2</value>
</value>
</section>
</workers>
</configuration>

5.Install Zend Optimizer

wget http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz

tar zxf  ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz

cp ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp/ZendOptimizer.so /usr/lib/php52/20060613/

add the following line to /etc/php52/fpm/php.ini

zend_extension=/usr/lib/php52/20060613/ZendOptimizer.so

6. start the php-fpm start

/etc/init.d/php52-fpm restart

Filed under: CentOS, Linux No Comments
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 1 Comment
20Jan/110

Install Kloxo/LxAdmin on CentOS 5.x 32bit

Kloxo installation is fairly easy, however keep in mind this only works on CentOS 32bit.  There is a few bugs in 64bit and I would not recommend it's use.

Let's check what version of CentOS you're on first:

# uname -m
i686 <-- This means it's 32bit.
x86_64 <-- This means it's 64bit

Next let's get the Kloxo installer by running this command:

# wget http://download.lxlabs.com/download/kloxo/production/kloxo-install-master.sh

Now we can install Kloxo:

# ./kloxo-install-master.sh

This will take some time now, after it's completed the below message will appear:

Congratuations. Kloxo has been installed succesfully on your server as master
You can connect to the server at https://<ip-address>:7777 or http://<ip-address>:7778
Please note that first is secure ssl connection, while the second is normal one.
The login and password are 'admin' 'admin'. After Logging in, you will have to change your password to something more secure
We hope you will find managing your hosting with Kloxo refreshingly pleasurable, and also we wish you all the success on your hosting venture
Thanks for choosing Kloxo to manage your hosting, and allowing us to be of service

Now open your Browser and type http://(ip-address):7778 and login with

Username : admin
Password : admin

Follow the instructions to change your password

Filed under: CentOS, Linux No Comments
19Jan/110

Change Windows 2008 Administrator Password

To change the Administrator password on Windows 2008, please follow the directions below:

Membership in Administrators, or equivalent, is the minimum required to perform this procedure.

To change the Administrator password in Windows Server 2008

  1. Log on to the computer using the Administrator account.
  2. Click Start > Settings, click Control Panel, and then double-click User Accounts.
  3. In User Accounts, in Make changes to your user account, click Change your password.
  4. In Change your password, in Current Password, type your password.
  5. In New password, type a new password.
  6. In Confirm new password, retype the password.
  7. In Type a password hint, type a word or phrase that will remind you of your password or, optionally, leave this field blank.
  8. Click Change password.
Filed under: Windows No Comments
19Jan/110

Change Windows 2003 Administrator Password

To change the Administrator password on Windows 2003, please follow the directions below:

Membership in Administrators, or equivalent, is the minimum required to perform this procedure.

To change the Administrator password in Windows Server 2003

  1. Log on to the computer using the Administrator account.
  2. Click Start > Settings > Control Panel, right-click Administrative Tools, and then click Open. Administrative Tools opens.
  3. Double-click Computer Management, click Local Users and Groups, and in the details pane, double-click Users. The Users folder opens.
  4. In the details pane, right-click the account that you want to change, and click Set Password. A warning dialog box opens. Read the information to determine whether you want to proceed with the step to change the password.
  5. In New Password, type a password. In Confirm password, retype the password, and then click OK.
Filed under: Windows No Comments