Oempro is the most popular email marketing and email service provider software. With Oempro, you can build your very own email marketing service just like Sendloop or Mailchimp. Today, starting up a web startup is easy and costs you a few hundred dollars. We thought that it should be just the same for building your very own ESP. In this article, we will explain you how to build an application server on Linode or DigitalOcean to host Oempro for your email service provider business.
Linode and DigitalOcean are two proven, cost-effective and highly powerful Linux Virtual Server companies. Using such a service provider helps you to scale your costs based on your business details. They both provide you API access. In this way, you can scale your server capabilities based on your needs and keep your infrastructure costs down.
Get a server
In this chapter, we will explain you how to get a CentOS server on Linode and DigitalOcean Linux Virtual Server companies.
Getting a server on Linode
- Visit Linode.com website
- If you have a Linode account already, simply login to your account management area
- If you don’t have a Linode account, scroll down and choose the appropriate plan for your needs
- Once you have created your account, on the server build screen, select “CentOS 6.4″ build, set a root password
- In a minute, your server will be up and ready to setup. Simply boot it by clicking “Boot” button on the server main screen.
- Once your server is online, login to your server with ssh root credentials.
Okay, your server is now ready for setting it up.
Getting a server on DigitalOcean
- Visit DigitalOcean.com website
- If you have an existing account, simply login to your DigitalOcean account
- If you don’t have an account, submit the signup form
- Once you login to your account area, click “Create Droplet” button on top right
- Set a hostname, choose specs and location of your virtual server
- For Linux distribution, choose CentOS 6.4 or higher 64bit build
- Create your droplet (droplet is the alias of virtual server in DigitalOcean world)
- In a minute, your server will be up and ready for setting it up
- You will receive your root password to your account email address
Okay, your server is now ready. Let’s set it up.
Setting up CentOS server
Okay, you have created your server on Linode or DigitalOcean. The next step is to setup server components such as Apache web server, MySQL database server, PHP and PHP extensions.
Before digging into details, let’s set a hostname for your server. This will be a unique identifier for your server. As an example, we will set “oempro.mydomain.com” hostname:
$ echo “HOSTNAME=oempro.mydomain.com” >> /etc/sysconfig/network
$ hostname “oempro.mydomain.com”
Setup server timezone
This is important. Let’s setup the correct timezone based on your needs. As an example, we will be setting up London’s timezone:
$ ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
Update installed packages
Before starting to install packages, let’s update existing ones to the most recent versions:
$ yum -y -v update
In order to perform specific operations, we need wget to be installed and available:
$ yum install -y wget
Atomic repository setup
To enhance available packages, we will be adding Atomic repository:
$ wget -q -O - http://www.atomicorp.com/installers/atomic | sh
Install required packages
We will be installing several packages such as development tools, PHP, memcahced, PHP extensions, MySQL and many others. Some of them are not required by Oempro but we will install them for future use:
$ yum -y -v groupinstall “Development Tools”
$ yum -y -v install fontconfig freetype* nc memcached php php-mysql php-apc mod_php php-cli php-pecl-memcached zlib-devel libmemcached-devel php-pear php-gd httpd git php-ioncube-loader iotop mysql mysql-server phpmyadmin telnet lftp ntpdate php-imap apc php-xml php-bcmath python-setuptools python-devel mod_ssl openssl-devel ruby rubygems redis rubygems
Installing all packages may take a while, sit back and relax
Setup auto-run of specific modules on boot
We will make sure that Apache and MySQL starts automatically whenever your server is rebooted:
$ chkconfig httpd on
$ chkconfig mysqld on
Setup cron for time sync
We don’t want our server date/time to be incorrect. So, let’s sync it. We will simply add a cron job to “root” user cron job list:
$ crontab -e
Now switch to “edit” mode by hitting “i” key. Paste the following command:
47 23 * * * /usr/sbin/ntpdate -b -s 0.us.pool.ntp.org
Hit “Esc” key (to disable edit mode) and then save your cron job by typing “:wq”
You will be returned back to command line with a similar message:
no crontab for root - using an empty one
crontab: installing new crontab
We are not using Ruby on Oempro, but let’s make it ready to use and keep it up-to-date:
$ gem update --system
Composer is a package repository for PHP. Composer is not being used in Oempro but it may change in the future. Let’s make it ready to be used:
$ mkdir /root/tmp
$ cd /root/tmp
$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer
Let’s start web server and MySQL database server:
$ /etc/init.d/httpd restart
$ /etc/init.d/mysqld restart
Initial MySQL server setup
Simply run the “/usr/bin/mysql_secure_installation” app to execute the wizard:
The wizard will ask you some questions such as;
- root password
- remove anonymous users (yes)
- disallow root login remotely (yes)
- remove test databases and users (yes)
- reload privileges now (yes)
We will use phpMyAdmin to administrate our MySQL server. But first, we need to authorize access to it remotely:
$ cd /etc/httpd/conf.d/
$ vi phpMyAdmin.conf
Now search for “Allow from” and add your computer IP address to the list so that you can access phpMyAdmin from your computer. Here’s an example:
Allow from 127.0.0.1 => Allow from 127.0.0.1 126.96.36.199
Save and exit from the editor. Then reload Apache configuration:
$ /etc/init.d/httpd reload
Create MySQL database
Now, we will be creating a MySQL user and database for Oempro.
Simply open a web browser and access phpMyAdmin on your server:
Web browser will ask you to enter username/password. Type “root” for the username and type the password you have set on “Initial Mysql server setup” chapter
On the phpMyAdmin main screen, you can create the Oempro database easily. Simply enter the name of database (ex: oempro) and choose collation (ex: utf8_unicode_ci)
Once the database is created, phpMyAdmin will redirect you to the database screen. On the top menu, click “Privileges” link and then click “Add a new user” link.
Enter the name, password and host for the new user. Do NOT check any global privileges unless you are sure what you are doing.
Once the user is created, phpMyAdmin will redirect you to the database privileges for the new user. Make sure that all privileges are checked and click “Go” button.
Now, your user and database is created. Simply click “Privileges” link on the top menu again and then click “reload the privileges” link on the bottom of the page. This will make sure that new MySQL user credentials are updated.
Your server is now setup and ready to proceed with Oempro installation. You will simply install Oempro to /var/www/html directory. Simply proceed with Oempro Installation help article to make Oempro ready-to-run.
What about mail server?
Sending mass emails from a virtual server is not a good approach, you will simply have very poor inbox delivery rate and probably the hosting provider will warn you when you exceed a certain amount of delivery volume. If you are fully experienced on setting up MTA, handling IP reputation and all other complex stuff, you can build a mail server on a fully dedicated server. If you don’t know what the MTA world is or if you don’t have time to spend on MTA management, then we strongly recommend you to send emails through a third party professional service such as;
and many others…
Optional but nice to have
This article explains how to setup a CentOS server for Oempro and other web apps. In addition to instructions written here, you can setup virtual hosts for your different domains (or apps), use memcached for PHP sessions , fine tune MySQL for higher performance, iptables firewall setup for secured access, etc.
Any suggestions or ideas to add to this article? Let us know below.