Fixing Email server on webuzo

It is deployed along with Exim – the SMTP Email Server, which can be installed by a click from the Webuzo Enduser Panel >> Apps >> Utilities Category

Guide : http://www.webuzo.com/wiki/Install_System_Apps

Accessing SquirrelMail is as simple as a pie with Webuzo.
Guide : http://webuzo.com/wiki/Access_Emails

Issue # 1
You can face the “Error connecting to IMAP server: example.com.
111 : Connection refused
” Error id Dovecot service is not installed on your server.
Squirrel IMAP Error

Fix for the same is to quickly install Dovecot by a click from the Webuzo Enduser Panel >> Apps >> Utilities Category
Guide : http://www.webuzo.com/wiki/Install_System_Apps

Restart the Dovecot Service to avoid other issues:
Guide : http://webuzo.com/wiki/Restart_services

From the command line:
service dovecot restart

Installing Webuzo on a fresh ubuntu server

Goal: Install web panel on your VPS server

Reason:   lets you focus on using apps rather than spending time on installing them. Install PHP, PERL, JAVA, JavaScript applications to your domain with just a click of a button.

  1. Login to your SSH
  2. Update your Operating System
    • apt-get update
  3. Download and install Webuzo

Installation

Open a Shell Terminal (e.g. PuTTY) and SSH to your server. Run the following commands:

wget -N http://files.webuzo.com/install.sh
chmod 0755 install.sh
./install.sh     // This will install the LAMP Stack, DNS Server and FTP server along with Webuzo

OR

./install.sh --install=lamp,bind // This will install the LAMP Stack(softname -> lamp) and DNS Server 
                                    (softname -> bind) along with Webuzo.
                                    Note : softname for Apps should be comma separated.
                                    Get list of softnames for the Apps here : http://api.webuzo.com/apps.php

OR

./install.sh --install=none // This will install only Webuzo without any LAMP Stack.
                               You can later install apps from the Apps Category in the Enduser Panel.

For more information on installing you can check the manual at

Webuzo Website manual

How to install Node.js on centos6

How To Install And Run A Node.js App On Centos 6.4 64bit

Introduction

This article outlines the steps necessary to run a “Hello world” in node.js + express, running on a 64bit Centos 6.4 installation. We will be building the latest version of source (at this moment, v0.10.4) from the upstream provider.

As is written on their homepage, Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. This is a fast, event driven platform and server-side Javascript engine used for building web applications. DigitalOceans’ droplets are a cost-effective way to install and start studying server-side Javascript and bulding or deploying web applications with Node.js.

Setup a VPS

To get started, we will need a droplet – the smallest instance will do just enough – and a SSH client (ie. Putty on Windows, Linux systems and Mac Os X usually have it out of the box). When we receive our initial root password, we can ssh into the instance. SSH into the VPS and change the root password, if you haven’t already. It would probably be a good idea to also update software repository to the latest versions:

yum -y update

This will update installed software on our VPS to the latest versions.

Yum can take a few minutes, but when it’s done, we need to prepare for software installation. We’re going to build Node.js from the latest source available at the moment of writing this (v0.10.4). To do that, we’ll need “Development Tools”. It’s a group of tools for compiling software from sources.

yum -y groupinstall "Development Tools"

This command will pull a “Development Tools” group with the applications needed to compile node.js.

Also, we’ll install GNU screen – a piece of software that allows us to connect to our VPS, start a session and detach from it. We could disconnect and connect later, or from another workstation, and pick up where we left. It’s very handy, especially during development of an app, when we want to learn stuff.

yum -y install screen

Node.js installation

Now that we’re ready to install Node.js from sources. First, we’ll move to /usr/src directory – the usual place to hold software sources.

cd /usr/src

Now, we pick the latest compressed source archive from Node.js website at http://nodejs.org/download/.

wget http://nodejs.org/dist/v0.10.4/node-v0.10.4.tar.gz

We could and should replace the url and use the more recent version of node.js, if there is one. Next, we are uncompressing the source files and move into that directory.

tar zxf node-v0.10.4.tar.gz
cd node-v0.10.4

Now the source for Node.js is extracted and we’re in the source directory. We can now prepare our compiler commands, by executing the configure script:

./configure

It will read the properties of our system to prepare compiler flags. Ie. it could be a system architecture (32/64bit, CPU specific flags etc). With it, we’re ready to actually compile the source now. To do that, just type:

make

This is probably the most time-consuming task here: on my example VPS it took about 6 minutes and 34 seconds to complete. When we’re done, we need to make this available system-wide:

make install

The latest command will place the compiled binaries in system path, so all users could use it without any further setup. By default, node binary should be installed in /usr/local/bin/node.

Install Express.js

We now have Node.js installed and complete, we can start developing right away, deploy an already done application or we can proceed to create our Express.js application. First, we’ll use npm, nodes’ module manager, to install express middleware and supervisor – a helpful module that keeps our app started, monitors for file changes (ie. when we’re developing the app) and restarts the VPS when needed.

UPDATE: To be able to run an executable in /usr/local/bin through sudo, you have add /usr/local/bin to your secure_path using visudo.

sudo visudo

Look for secure_path, and append the following to it: “:/usr/local/bin”. Once you have done that, you’re now ready to install the express and supervisor modules.

npm -g install express express-generator supervisor

npm -g install will install the express and supervisor modules from npm software repository and make it available to the whole system. The -g switch in this command means “global” – the express and supervisor commands will be available accross the whole system.

Add non-privileged user

You should now, for security reasons, create a regular system user and run node under non-privileged account.

To do this, add the user first. You can replace “exampleuser” with whatever name your prefer.

useradd exampleuser

We have a new system user. Add a decent password for the new user:

passwd exampleuser

Log out, and log back in as the new user.This changes our login shell from root (system user) to exampleuser (non-privileged user who can compromise the system with less damage).

Creating an express app

Express is powerfull framework, and to create our first application, all we have to do is type:

express hello

The command will create a “hello” directory and setup some basics for a new application. Now we should enter this directory and install express dependencies:

cd hello && npm install

npm install part of the command will read all the module dependencies from a generated package.json file and install it from npm software repository.

We should start a new screen session so we can leave node app running:

screen

Finally, we can start our application with the help of supervisor that we installed earlier.

supervisor ./bin/www

Now we’re able to access our first express app at your VPS IP. For example http://123.456.78.90:3000/.

How to install Ruby on Rails in Centos 6.5

Introduction

Ruby on Rails

Ruby on Rails is one of the most popular web development framework, it’s build upon Ruby Programming Language, and it’s the hottest web development stack currently.

Rbenv

Rbenv is a shell script tools created by Sam Stephenson. It’s used for groom your app’s Ruby environment.Use rbenv can pick a Ruby version for your application and guarantee that your development environment matches production.

rbenv works by inserting a directory of shims at the front of your PATH:

 ~/.rbenv/shims:/usr/local/bin:/usr/bin:/bin

Through a process called rehashing, rbenv maintains shims in that directory to match every Ruby command across every installed version of Ruby—irb, gem, rake, rails, ruby, and so on.

CentOS

CentOS is derived from Red Hat Enterprise Linux. The target users of these distributions are usually businesses, which require their systems to be running the most stable way for a long time.So we are going to use CentOS 6.5 running our applications.

Step One – Install dependencies

Before, installing any package, it’s always recommended to update package repository cache use yum.

 sudo yum update

Now,in order to get necessary development tools and dependencies, run the following:

 sudo yum groupinstall -y 'development tools'
 sudo yum install -y gcc-c++ glibc-headers openssl-devel readline libyaml-devel readline-devel zlib zlib-devel  sqlite-devel  

Step Two – Install Rbenv and ruby-build

Then we are ready to get Rbenv downloaded installed, run the following to check out rbenv into ~/.rbenv:

 git clone git://github.com/sstephenson/rbenv.git ~/.rbenv

Add ~/.rbenv/bin to your $PATH for access to the rbenv command-line utility:

 echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile

Add rbenv init to your shell to enable rbenv shims and autocompletion.

 echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

Ruby-build is a Rbenv plugin which provides the rbenv install command that simplifies the process of installing new Ruby versions. Install rbenv-build:

 git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

reloaded your bash_profile to enable rbenv command:

 source ~/.bash_profile

Step Three – Install Ruby

Install Ruby 2.1.0 and make it the default

 rbenv install 2.1.0
 rbenv rehash
 rbenv global 2.1.0

Now you can run:

 ruby -v

to verify your ruby environment has been installed successful。 It will output something like this:

 ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]

How to install VNC-SERVER or remote desktop on centos 6

VNC is a protocol that is used to share the desktop with other users/computers over the network/Internet.In order to share a desktop, VNC server must be install and configure on the computer and VNC client must be run on the computer that will access the shared desktop.

When we install the minimal copy of CentOS Server, it only gives us the “Command Line” interface.

But some people prefer GUI instead and for this they install Full version of Gnome on CentOS. Actually there is a better way and that is to install VNC. VNC provides a lightweight virtual desktop than full blown version of Gnome.

To run the VNC Server on CentOS, we have to install these required packages:

sudo yum groupinstall Desktop

sudo yum install tigervnc-server

sudo yum install xorg-x11-fonts-Type1

This is optional:

sudo yum install vnc

To start VNC Server on boot

sudo chkconfig vncserver on

To setup users’ VNC password:

vncpasswd

Edit the /etc/sysconfig/vncservers file:

sudo nano /etc/sysconfig/vncservers

Add the following to the end of the file:

VNCSERVERS="1:arbab"
VNCSERVERARGS[1]="-geometry 1024x600"

The iptables rules need to be amended to open the VNC ports:

sudo iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp -m multiport --dports 5901:5903,6001:6003 -j ACCEPT
sudo service iptables save
sudo service iptables restart

Restart the VNC Server:

sudo service vncserver restart

Now kill the VNC Server:

vncserver -kill :1

Edit the xstartup file in .vnc directory:

nano .vnc/xstartup

Comment the last line and run the Gnome:

#twm & 
exec gnome-session &

Restart the service:

sudo service vncserver restart

Now, download VNCViewer onto our desktop computer from which we want to access the shared desktop. Connect using ServerIP/Name:1 (:1 is for the VNC server window), In my case it is centos:1.

Enter the password that we created using the vncpasswd command:

We now have GUI access to our server.

Ability to connect for multiple users:

Create a local user, using the following command:

sudo adduser ali

Create a password for newly created user:

sudo passwd ali

Switch to the newly created user and run vncpasswd command for it:

su ali
vncpasswd

Edit the /etc/sysconfig/vncservers file:

sudo nano /etc/sysconfig/vncservers

Add these lines for new user:

VNCSERVERS="1:arbab 2:ali"
VNCSERVERARGS[1]="-geometry 1024x600"
VNCSERVERARGS[2]="-geometry 1024x600"

Restart the VNC service:

sudo service vncserver restart

Kill the vncserver session for new user and edit the xstartup file:

su ali
vncserver -kill :2
cd ~
nano .vnc/xstartup

Modify the file so it looks like this:

#twm & 
exec gnome-session &

Restart the VNC service:

sudo service vncserver restart

Connect with newly created user using centos:2, Where centos is my server name:

Enter the password that we created using the vncpasswd command:

We now have GUI access to our server for newly created user.

Hope this will help you!

Please Remember me in your prayers!

Enjoy :-)