How to Install Multiple PHP version (PHP 5.2, PHP 5.5, PHP 5.6 and PHP 7) in single VPS with Ubuntu 16.04

I need to test the effect of new plugin on new development stage while still preserve production setting. Not in high traffic domain and I also want to learn new framework called phalcon php. Since I want to support newest ubuntu server I came with my requirement list :

  1. Must be able to run on newest Ubuntu (I’m aware about 16.04 LTS)
  2. Must be able to run old PHP version (the latest of 5.2 release is 5.2.17). Even this version is no longer supported by php.net but a few products still rely on this version.
  3. I want to learn Phalcon PHP version 2.0.x .
  4. I also want to compare it with latest version of Phalcon PHP version 2.1.x
  5. Newest PHP version 7 also needed

The list translated into plan :

5.2 -> 5.2.17
5.5 -> 5.5.32 -> phalcon 2.0.10 (latest)
5.6 -> 5.6.18 -> phalcon 2.1 (latest)
7.0 -> 7.0.3

Well, I use Vultr since this vps working well for me for long time and also support iso (yes, I use Ubuntu 16.04 server daily build). (EU) Frankfurt, DE chosen as vps location for this server. 64 bit OS (Xenial Server).

ubuntu16

I also pointing A record for these sub domain. More

How to install PHP 7 GA on CentOs Server

One of blogger in my town came and ask me to help him with his server. Actually his server is enough to handle his wordpress blog but he don’t know what to do. I suggest him to upgrade his server or reinstall server to support latest PHP 7. I told him that newest PHP is twice fast as legacy PHP that he use. I promise to show him the steps and put it public. Maybe other blogger need and find it useful too.

Lets get start!

I use DigitalOcean VPS (1GB package) – You get free $10 if you’re new user.

Choose CentOS 6.7 64 bit with 1 GB memory.

Login to vps and install :

# curl -O https://centminmod.com/installer.sh && chmod 0700 installer.sh && bash installer.sh

Wait till you see # sign . Follow by type

# centmin More

Install PHP 7 and Apache22 on DragonFlyBSD 4.2.4

Using current machine but get faster performance by only upgrade software is a good offer. That feel happen to me when I hear about php 7 release. Being curious I decide to use latest dragonflybsd (at this moment 4.2.4) as pilot project for new hosting infrastructure platform.

Lets get start!

# uname -a

DragonFly php7.hostingformula.net 4.2-RELEASE DragonFly v4.2.4-RELEASE #6: Sun Aug 9 13:25:14 EDT 2015 [email protected]:/usr/obj/home/justin/release/4_2/sys/X86_64_GENERIC x86_64

# pkg info

bind-tools-9.10.2P3 Command line tools from BIND: delv, dig, host, nslookup…
ca_root_nss-3.19.2 Root certificate bundle from the Mozilla Project
cdrtools-3.00_2 CD/DVD/BluRay and ISO-9660 image creation and extraction tools
curl-7.43.0_2 Non-interactive tool to get files from FTP, GOPHER, HTTP(S) servers
cvsps-2.1_1 Create patchset information from CVS
expat-2.1.0_2 XML 1.0 parser written in C
gettext-runtime-0.19.4 GNU gettext runtime libraries and programs
git-2.4.6 Distributed source code management tool
idnkit-1.0_5 Library to handle internationalized domain names
indexinfo-0.2.3 Utility to regenerate the GNU info page index
isc-dhcp42-server-4.2.8_1 ISC Dynamic Host Configuration Protocol server
krb5-1.13.2_2 Authentication system developed at MIT, successor to Kerberos IV
libxml2-2.9.2_3 XML parser library for GNOME
pkg-1.5.5 Package manager More

VPS run out of space after apt-get upgrade

Yes, updraft plus plugin complain about space left. Needed 24 MB but less than that available.

Quick search lead me to problem that occur after apt-get upgrade.

# df -H

Filesystem Size Used Avail Use% Mounted on
/dev/vda1 16G 15G 296M 99% /
udev 385M 13k 385M 1% /dev
tmpfs 79M 254k 79M 1% /run
none 5.3M 0 5.3M 0% /run/lock
none 393M 0 393M 0% /run/shm

 

# apt-get install -f

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
linux-headers-3.2.0-93-generic-pae linux-headers-3.2.0-88-generic-pae linux-headers-3.2.0-90-generic-pae linux-headers-3.2.0-85-generic-pae linux-headers-3.2.0-70
linux-headers-3.2.0-72 linux-headers-3.2.0-73 linux-headers-3.2.0-74 linux-headers-3.2.0-80 linux-headers-3.2.0-75 linux-headers-3.2.0-76 linux-headers-3.2.0-82
linux-headers-3.2.0-77 linux-headers-3.2.0-83 linux-headers-3.2.0-84 linux-headers-3.2.0-79 linux-headers-3.2.0-90 linux-headers-3.2.0-85 linux-headers-3.2.0-91
linux-headers-3.2.0-86 linux-headers-3.2.0-92 linux-headers-3.2.0-87 linux-headers-3.2.0-93 linux-headers-3.2.0-88 linux-headers-3.2.0-89
linux-headers-3.2.0-82-generic-pae linux-headers-3.2.0-77-generic-pae linux-headers-3.2.0-72-generic-pae libluajit-5.1-common linux-headers-3.2.0-89-generic-pae
linux-headers-3.2.0-91-generic-pae linux-headers-3.2.0-86-generic-pae libluajit-5.1-2 linux-headers-3.2.0-83-generic-pae linux-headers-3.2.0-80-generic-pae
linux-headers-3.2.0-75-generic-pae linux-headers-3.2.0-73-generic-pae linux-headers-3.2.0-70-generic-pae linux-headers-3.2.0-92-generic-pae
linux-headers-3.2.0-87-generic-pae linux-headers-3.2.0-84-generic-pae linux-headers-3.2.0-79-generic-pae linux-headers-3.2.0-76-generic-pae
linux-headers-3.2.0-74-generic-pae
Use ‘apt-get autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
root@install:/var/log# apt-get autoremove
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
libluajit-5.1-2 libluajit-5.1-common linux-headers-3.2.0-70 linux-headers-3.2.0-70-generic-pae linux-headers-3.2.0-72 linux-headers-3.2.0-72-generic-pae
linux-headers-3.2.0-73 linux-headers-3.2.0-73-generic-pae linux-headers-3.2.0-74 linux-headers-3.2.0-74-generic-pae linux-headers-3.2.0-75
linux-headers-3.2.0-75-generic-pae linux-headers-3.2.0-76 linux-headers-3.2.0-76-generic-pae linux-headers-3.2.0-77 linux-headers-3.2.0-77-generic-pae
linux-headers-3.2.0-79 linux-headers-3.2.0-79-generic-pae linux-headers-3.2.0-80 linux-headers-3.2.0-80-generic-pae linux-headers-3.2.0-82
linux-headers-3.2.0-82-generic-pae linux-headers-3.2.0-83 linux-headers-3.2.0-83-generic-pae linux-headers-3.2.0-84 linux-headers-3.2.0-84-generic-pae
linux-headers-3.2.0-85 linux-headers-3.2.0-85-generic-pae linux-headers-3.2.0-86 linux-headers-3.2.0-86-generic-pae linux-headers-3.2.0-87
linux-headers-3.2.0-87-generic-pae linux-headers-3.2.0-88 linux-headers-3.2.0-88-generic-pae linux-headers-3.2.0-89 linux-headers-3.2.0-89-generic-pae
linux-headers-3.2.0-90 linux-headers-3.2.0-90-generic-pae linux-headers-3.2.0-91 linux-headers-3.2.0-91-generic-pae linux-headers-3.2.0-92
linux-headers-3.2.0-92-generic-pae linux-headers-3.2.0-93 linux-headers-3.2.0-93-generic-pae
0 upgraded, 0 newly installed, 44 to remove and 1 not upgraded.
After this operation, 1425 MB disk space will be freed.
Do you want to continue [Y/n]? y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “id_ID.UTF-8”,
LC_MONETARY = “id_ID.UTF-8”,
LC_ADDRESS = “id_ID.UTF-8”,
LC_TELEPHONE = “id_ID.UTF-8”,
LC_NAME = “id_ID.UTF-8”,
LC_MEASUREMENT = “id_ID.UTF-8”,
LC_IDENTIFICATION = “id_ID.UTF-8”,
LC_NUMERIC = “id_ID.UTF-8”,
LC_PAPER = “id_ID.UTF-8”,
LANG = “en_US.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database … 642426 files and directories currently installed.)
Removing libluajit-5.1-2 …
Removing libluajit-5.1-common …
Removing linux-headers-3.2.0-70-generic-pae …
Removing linux-headers-3.2.0-70 …
Removing linux-headers-3.2.0-72-generic-pae …
Removing linux-headers-3.2.0-72 …
Removing linux-headers-3.2.0-73-generic-pae …
Removing linux-headers-3.2.0-73 …
Removing linux-headers-3.2.0-74-generic-pae …
Removing linux-headers-3.2.0-74 …
Removing linux-headers-3.2.0-75-generic-pae …
Removing linux-headers-3.2.0-75 …
Removing linux-headers-3.2.0-76-generic-pae …
Removing linux-headers-3.2.0-76 …
Removing linux-headers-3.2.0-77-generic-pae …
Removing linux-headers-3.2.0-77 …
Removing linux-headers-3.2.0-79-generic-pae …
Removing linux-headers-3.2.0-79 …
Removing linux-headers-3.2.0-80-generic-pae …
Removing linux-headers-3.2.0-80 …
Removing linux-headers-3.2.0-82-generic-pae …
Removing linux-headers-3.2.0-82 …
Removing linux-headers-3.2.0-83-generic-pae …
Removing linux-headers-3.2.0-83 …
Removing linux-headers-3.2.0-84-generic-pae …
Removing linux-headers-3.2.0-84 …
Removing linux-headers-3.2.0-85-generic-pae …
Removing linux-headers-3.2.0-85 …
Removing linux-headers-3.2.0-86-generic-pae …
Removing linux-headers-3.2.0-86 …
Removing linux-headers-3.2.0-87-generic-pae …
Removing linux-headers-3.2.0-87 …
Removing linux-headers-3.2.0-88-generic-pae …
Removing linux-headers-3.2.0-88 …
Removing linux-headers-3.2.0-89-generic-pae …
Removing linux-headers-3.2.0-89 …
Removing linux-headers-3.2.0-90-generic-pae …
Removing linux-headers-3.2.0-90 …
Removing linux-headers-3.2.0-91-generic-pae …
Removing linux-headers-3.2.0-91 …
Removing linux-headers-3.2.0-92-generic-pae …
Removing linux-headers-3.2.0-92 …
Removing linux-headers-3.2.0-93-generic-pae …
Removing linux-headers-3.2.0-93 …
Processing triggers for libc-bin …
ldconfig deferred processing now taking place

# df -H

Filesystem Size Used Avail Use% Mounted on
/dev/vda1 16G 12G 4.1G 74% /
udev 385M 13k 385M 1% /dev
tmpfs 79M 254k 79M 1% /run
none 5.3M 0 5.3M 0% /run/lock
none 393M 0 393M 0% /run/shm

 

Wow, huge saver 🙂

$5/month FreeBSD VPS experience (from March 2017 you can get it with $2.5/month)

A reader shout me an email asking if I can share my experience around FreeBSD VPS that I use. Well that topic is not a fancy thing. I think that kind of topic will give user ‘bias’ opinion but since its my blog and my other reader might be want to know too then I try my best to share it.

Purpose

The purpose of FreeBSD deployment in vps is based on experiment hobby. I use FreeBSD since 4.7 for email server (qmail, djbdns stuff). Another test for web server and php stuff also included.

Technology

I never care about which technology they use. Is it Xen or KVM. I’m cheapskate. I try the cheap one 🙂

Provider

RootBSD

RootBSD is my first FreeBSD vps provider. I use their cheapest package ($19.97/month). 512MB memory with 20GB storage. Setup is not instant. I used to get my account information in minimum 4 hours after they verify payment etc. I never use their support and that means good. Great service make me never get in touch with their technical support 🙂 . Reverse dns available from control panel. Payment is fix. No hourly rate and you must pay in front for their service.

Atlantic

Their ads show up when I open Facebook and I give them a try. They have $1/month package (round up, its 0.99 actually). 256MB memory and 10GB SSD. I use it for VPN server . They have 4 location (usa-east, usa-central, usa-west and canada-east). Email port blocked by default. You have to request to technical support to lift the restriction. Their FreeBSD limited to FreeBSD 10 at the moment. No custom iso supported.

Vultr

This provider is my favorite. At the moment provide 14 location and generous specs. By default they provide mainstream distribution such as CentOS, Ubuntu, Debian, Windows, CoreOS, FreeBSD 10 and more. You’ll get more distribution under 64 bit but you can choose 32 bit too. What I really like is their custom iso option. This mean you can install and experiment with many OS which not appear by default. So far I’ve tried :

Their cheapest price is $5/month 2.5/month and if you in limited budget you can use it hourly. Email port blocked by default and you need to contact support to remove the barrier.

Digital Ocean

This provider is my favorite when I looking for Singapore based location. Depend on my client need. But I ever see different network performance in same region. Same wordpresss based site located in same Singapore region and different IP (i think different server too) but very slow. My friend also report same experience. I choose to move slow server to USA location and so far it work well in term of network connectivity speed. Email port is not blocked by default which is good news for newbie who want to see their Zimbra server work or not. Digital Ocean recently support FreeBSD (FreeBSD 10.1) but still no custom iso. Their price also $5/month and hourly rate for minimal server (512MB, 20GB SSD). Yes, the storage is more 5GB than Vultr but memory is less 256MB than Vultr.

Uptime

At the moment the uptime is great for all provider. The longest one located in Digital Ocean server :

# uptime
03:38:37 up 366 days, 23:37, 1 user, load average: 0.00, 0.00, 0.00

While Vultr follow

# uptime
03:39:53 up 51 days, 56 min, 1 user, load average: 0.16, 0.10, 0.08

Atlantic

# uptime
22:43:37 up 39 days, 19:04, 1 user, load average: 0.06, 0.03, 0.05

Yes, all of the server uptime currently match their deployment date.

In general my view about ‘cheap’ vps changed. I can deploy many server with low budget and spare the rest for balancing or backup purpose and Yes, it might use my favorite os ‘the power to serve’ 🙂

How to move Joomla website to VPS

A friend of mine that not seen for years contact me. He had problem with his school website. Headmaster give him order to take care their website that seem to abandoned by current holder. Every time they (school) contact him. No respond and no email. He ask me to see it and if possible solve it immediately.

Update : if you’re in hurry then you can use Fiverr service that will do the job ($5 per site). Click here to see the service.

After ask the website hosting representative we have clues where do we must start.

  1. Create official letter from school about domain ownership.
  2. Scan the letter and send it to hosting company

The process itself is not straightforward as current holder respond to hosting company email and the phone but not respond to us. After a month the progress finally move to right direction. Current holder not paid for hosting fee and that’s the reason for my friend. Contact hosting company and finally they approve account moving and switching.

Since the hosting company suspend the account for its late payment then the website is not accessible anymore and only display ‘account suspended’ message. My friend ask me if I can give him temporary place for their school. I agree to give him a space with exchange. I must do the transfer process myself. I like to see how to transfer joomla based website to vps.

Lets get start!

Backup Joomla Website

Fortunately my friend already download the backup file. Its tar.gz file (backup-11.15.2014_11-29-19_domain.tar.gz ).

Send Joomla backup file to vps

After copying the file to my laptop I initiate transfer using scp.

scp backup-11.15.2014_11-29-19_domain.tar.gz root@ipaddress:/root

the process depend on internet speed and file size. For my case, it took around 1 hour to upload 132MB of file.

Creating New Domain on VPS

I use Easyengine that I use in previous post for host wordpress. Joomla also created with php and utilize mysql. So I choose php+mysql website.

# ee site schooldomainname --mysql

The command will generate all required files including database plus its credentials at /var/www/schooldomainname/ee-config.php

To see database name, database user database password and database host created by easyengine you can use :

cat /var/www/schooldomainname/ee-config.php

Extract Joomla Backup on VPS

I use same VPS that powered by Vultr for WordPress. Time for extract backup file.

# mv backup-11.15.2014_11-29-19_schooldomainname.tar.gz /var/www/schooldomainname/

# cd /var/www/schooldomainname/

# tar xvzf backup-11.15.2014_11-29-19_schooldomainname.tar.gz

# ls
addons     cron          fp              httpfiles  meta  mysql             pds              psql_users.sql    resellerpackages  shell      sslkeys      userdata  vf
bandwidth  digestshadow  has_sslstorage  locale     mm    mysql-timestamps  proftpdpasswd    quota             sds               ssl        suspended    va
counters   dnszones      homedir         logaholic  mma   mysql.sql         psql             resellerconfig    sds2              sslcerts   suspendinfo  vad
cp         domainkeys    homedir_paths   logs       mms   nobodyfiles       psql_grants.sql  resellerfeatures  shadow            ssldomain  userconfig   version

Looks like this backup file created by my friend taken from cpanel backup wizard.

I just need to find out where joomla files and its database located.

Finding Joomla Files + Database

After search for while I can see where is the location of Joomla files. Its in :

homedir/public_html

Database file located in :

mysql

Move Joomla folder to Easyengine public folder

Next step is move joomla folder found from previous step to easyengine folder.

#cd /var/www/schooldomainname

# mv backup-11.15.2014_11-29-19_schooldomainname/homedir/public_html .
# mv tes/backup-11.15.2014_11-29-19_schooldomainname/mysql/schooldomainname.sql .

Edit configuration file of Joomla

The configuration file located in configuration.php . Edit $user, $password and $db .

#nano htdocs/configuration.php

save the file.

Import Joomla Database File

# mysql -udb_user -p db_name < schooldomainname.sql
Enter password:
#

Make Joomla website live

# ee site enable schooldomainame

Thats it. Try to reload it via web browser and everything load fine so far.

My friend happy with the migration process. The load speed is incredible and they can add their content again and if they like it then they can make their own server with Vultr.

Lesson learned :

  1. Never use personal email address as contact, billing etc for school domain. Always use school email address. Beside this touch make everything official also prevent future problem like my friend case.
  2. If possible use the longest period for registering school domain. Yearly renewed domain is not suitable for a school.

How to move wordpress to easyengine based vps

Its almost the end of year. Many offer came and out include hosting. My friend just have her hosting account expire and the reason why she not continue her hosting plan is cost. She got her hosting package last year for $10 (from facebook group). The package cover free domain + 12 month of hosting and when renewal process came she can afford it. Its $104 now. Ten times from previous invoice. She already knew it and try to find other solution to keep her blog alive.

She already red my post about utilize vps. Her blog is using wordpress and she want to try it after she see my other blog that load blazing fast. I told her about Vultr and she could try it for cheapest package.

I promise her to help the migration process in exchange she let me share the process for hostingformula.net reader (I won’t reveal domain name). Hope this useful for others.

Lets get start!

Backup WordPress

In general WordPress is PHP and MySQL application. To backup wordpress the step is quite simple.

1. Backup database

To see all database credentials see wp-config.php content and write it down to notepad or other equal application. I’m lucky the host provide ssh access. So I can use command line for quick access 🙂

# cat wp-config.php

This command will display the content of wp-config.php . If you just want to extract the database essentials use this command : (my assumptions that you already log in with ssh). More

How to Install FreeBSD 10 32 bit on VPS

A reader send me an email. He ask about possibility of install FreeBSD 32 bit on VPS. He just confuse why Vultr not provide custom iso under 32 tab. He think Vultr not support it. I replied to him that he could test it himself. Upload iso file as usual and continue with installation. He not sure and ask me to try and if possible show the process in single post.

Well, I just remember myself when first time I learn install Redhat 6. I loss 4 month of worrying and afraid if fail. In reality it took 2 days for install FreeBSD 4.7 ( one day for download iso and burn it to CD and second day for read installation manual and applied it). I think Vultr is great one. They provide very flexible infrastructure and if I want to back to FreeBSD 4 I can do that too.

My student also free to experiment with their task only by using small 11 inch netbook. Remote to Vultr and free to test the configuration. Fast network and good CPU.

Lets get start!

Choose FreeBSD 10.1 Iso File

FreeBSD 10.1 was released and I want to try install FreeBSD 10.1 32 bit for this experiment.

There is two options available :

Since I’ll have a lot of bandwidth I use DVD version for upload it to custom isos list.

FreeBSD 10.1 iso in Vultr

Connect iso file in virtual iso section More

Cheap Forex VPS Do it Yourself Server

One of my reader shout me an email about his problem. He get free forex vps from his broker after he met required deposit amount but he got disappointed with the quality. Its low end vps that running Windows 2003 and restrict him on EA usage. He don’t know how his broker monitor his vps but when he try to use his VPS running EA for another broker the connection get worst and he got warning. He must utilize the server only for the broker who give him vps not for others. He already search for cheap forex vps but still not sure which one he must choose. Lightweight vps he ever try is not run anti virus and very minimal installation. Only Windows 2003 with built in IE browser. To many networking problem and maintenance force him to abandon his server.

Another consideration is Windows Server 2003 end of life that will happen on July 14, 2015. While newer version need more requirement that mean more money when you deploy newer Windows server. Yes, according to Microsoft Technet the requirement for Windows 2003 server is quite low (x86 based computer need 256 MB recommended minimum and 512 MB minimum for x64 based computer). I think that the only consideration why many forex vps provider out there still deploy this version.

Since he only need stable and cheap vps server for his forex activity he want me to give my opinion. Is he can build his own forex vps server that also easy to use like Windows. I agree to answer and promise him to make a post for his question when time permit. After 2 weeks when I have time I start test possibility of using other operating system other than Windows as Forex vps. I came with conclusion : Yes, he can. He can build his own server and I think the server is stable too. More

How to install Oracle Linux in VPS using custom iso

I used to use CentOS for linux based server, second option is Ubuntu server. Both option taken with consideration about their support. CentOS is free and always came out after Linux Redhat. Ubuntu also free and have their LTS policy that make feel confident deploying it to my server. The problem with CentOS is me actually. I must wait for long time till I get it released but it’s worth. Today, my friend who study in Europe ask me about Oracle Linux. I never know about it and I feel curious. Beside official support of software that required specific OS like HHVM that support Ubuntu server that make me choose Ubuntu server for smooth installation of HHVM then I’ll use CentOS first.

Same principle applied for Oracle Linux. Since Oracle own this OS then I think they have great support related to their product such Oracle database. Other sight I get from their release is not long after Linux Redhat released I see it (Oracle Linux) also come with their version.

In this post I’ll explore how to install oracle linux in vps using custom iso. Oracle linux version 6.6 that released on Oct 21 2014.

Preparation

Upload oracle linux iso

I use vultr for this post. They provide custom iso facility that enable me for use iso link.

Using oracle linux iso file from here and upload it to Vultr.

How to install Oracle Linux in VPS using custom iso : upload custom iso of Oracle linux

More

Using Gparted for VPS Disk Partition : Install slackware in vps using custom iso case

Install slackware in a vps is assignment I create for student. The challenge is rather different than install others (BSD or Linux distro) operating system. Yes, create partition is a must in this work. If Ubuntu or CentOS or OpenSUSE provide easy way to create partition then Slackware is strict.

The minimal solution is still the same. Create swap and native but you must use command line tools like cfdisk or fdisk. One of my student admire if he did different way to accomplish the job. He use Gparted to create the partition followed by Slackware installation.

I think his way might be useful for others who want to achieve the same target : install slackware in vps.  So, here the steps I try to recreate for that aim.

Preparing Gparted & Slackware ISO

I use vps provider that let me use custom iso like Vultr. After login then click ‘My ISO’ to upload the iso.

I use Gparted from Jaist mirror.

For Gparted 0.20.0-2 iso file (x64) click here.

I also use Slackware 14.1 iso from Slackware mirror.

Both of iso use 64 bit version.

Enter location of iso file then upload.

Install slackware in vps using custom iso : choose slackware iso location

More

How to install OpenSUSE 13.1 Server in VPS using custom iso

Today, my class will be discuss on how to install Zimbra Collaboration Suite. One of my student want to try it using different OS. As we don’t have access for Linux Suse Enterrprise Server 11 then we’ll try it on OpenSuse 13.1 . I never try it beside using Ubuntu but it won’t hurt right 🙂 . VPS is ready for such action.

I start by install OpenSUSE 13.1 server using VPS that support custom iso with these details :

  1. Location : Frankfurt
  2. Memory : 1GB (lowest memory available is 768 but I’ll try 1 GB)
  3. HD : 20 GB
  4. Technology : KVM
  5. Price : $7/mo

Lets get start!

More

How to Install DragonFlyBSD in VPS using custom iso feature

Distrowatch told me about newest version of DragonFlyBSD (3.8.0) . This version also in my waiting list as I know this BSD variant since beginning. When DragonFlyBSD begin using ports  aka dports to their software installation management then I’m happily use this version as server.

For documentation process when I delegate installation process for my staff I create this simple guide.

Of course its VPS based as we try to minimize physical server for our company 🙂

Create temporary iso location

DragonFlyBSD provide .iso.bz2 link and I have to convert it to .iso first. The idea is create temporary location for iso file and use it for Vultr custom iso.

I think my lowendspririt vps is good place to hold temporary image.

$ ssh [email protected] -p 17020
[email protected]’s password:
Welcome to Ubuntu 12.04 LTS (GNU/Linux 2.6.32-042stab084.17 i686)

* Documentation:  https://help.ubuntu.com/
Last login: Mon Jun  9 13:23:09 2014 from 36.68.189.115
# cd /var/www/oteos.com/htdocs/
# wget -c http://avalon.dragonflybsd.org/iso-images/dfly-x86_64-3.8.0_REL.iso.bz2
–2014-06-10 10:17:20–  http://avalon.dragonflybsd.org/iso-images/dfly-x86_64-3.8.0_REL.iso.bz2
Resolving avalon.dragonflybsd.org (avalon.dragonflybsd.org)… 2001:470:1:43b:1::72, 199.233.90.72
Connecting to avalon.dragonflybsd.org (avalon.dragonflybsd.org)|2001:470:1:43b:1::72|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 208704827 (199M) [application/x-bzip2]
Saving to: `dfly-x86_64-3.8.0_REL.iso.bz2′

More

How to install OpenBSD in VPS using custom iso

My friend came up with question about OpenBSD. He ask me about possibility of install OpenBSD remotely and continue to manage it for different purpose. I promise to help but due to time constraint I can not visit his house and teach him. I decide to make this post for him but I hope this simple guide will also help others that might face similar problem.

I use vps service from Vultr for this guide since I can use my existing credit and also quick setup process.

Others series that related to custom iso vps :

Upload OpenBSD iso to VPS server

I use Australia for VPS server location so I use nearest OpenBSD mirror close to Australia (Internode amd64 OpenBSD 5.5). This tutorial use OpenBSD 5.5 but you can change the iso file (I’ll update latest iso list when OpenBSD release new version).

Update on May 12 2015:

OpenBSD 5.7 has released. You can use these iso :

  • 64 bit OpenBSD 5.7 iso, (http://ftp.openbsd.org/pub/OpenBSD/5.7/amd64/install57.iso)
  • 32 bit OpenBSD 5.7 iso, (http://ftp.openbsd.org/pub/OpenBSD/5.7/i386/install57.iso)

If you want to use 5.6 release then you can use this iso :

Enter the link on “remote URL” section.

How to install OpenBSD in VPS using custom iso - choose your openbsd iso location file

More

Find out specific file (sql file) in vps

2014 is here and happy new year everyone 🙂 . As new year come I want to do ‘clean up’ for some vps and get rid from unused or old file that no longer useful on my vps server. Since the content handle by many side I can not delete many file and only able to delete sql file. The problem is I can not remember where I put the file?

Linux come with ‘find’ command and I can concentrate on “public_html” folder :

$ find public_html -name \*.sql -print
public_html/polling/dbdbd.sql
public_html/polling/pollingdb.sql
public_html/polling/dbdb/bukudb2.sql
public_html/polling/dbdb/bukudb.sql
public_html/home/cometchat/plugins/filetransfer/uploads/bpk.sql
public_html/reservasi/Addons/dbReservasi.sql
public_html/adminphp/scripts/upgrade_tables_mysql_4_1_2+.sql
public_html/adminphp/scripts/create_tables.sql
public_html/adminphp/scripts/create_tables_mysql_4_1_2+.sql
public_html/Hanz/elfinder-2.0-rc1/php/MySQLStorage.sql
public_html/hanz2/fig/figdb2.sql
public_html/hanz2/fig_old/figdb.sql

Wow, at least I know that garbage is exist.

Time to work now.

P.S : other useful command

$ncdu

ncdu 1.7 ~ Use the arrow keys to navigate, press ? for help
— /home/working/public_html ——————————————————
/..
5.4GiB [##########]  public_html2014.tar.gz
2.9GiB [#####     ] /picture
2.2GiB [####      ]/cover                                                                                                                    292.9MiB [          ] /Hanz
246.3MiB [          ] /hanz2

ncdu : NCurses Disk Usage

 

Migrating PHP 5.2.x application from Shared Hosting to VPS

Sorry for not post here for long time 🙂 . Getting busy with teaching and consulting make me forgot about this blog. Today I want to share about my experience dealing with php application that run well on 5.2 version. Client need to migrate it to dedicated server but I suggest to check it on vps first before deploy to dedicated server.

The aim of this job is to create a checklist around installation process, modules and others.

For OS I prefer to use Ubuntu server and I used to get it work for Ubuntu LTS (8.04, 10.04 and 12.04). Simply downgrade current PHP version to use Hardy Heron or 9.10 can save my day but now all those option no longer available since Ubuntu close it.

Further search lead me to Debian. Yes, Debian still give me access to Debian 5 repository where PHP 5.2 exist.

A few important things do before  create the server :

1. Choose cheap but good vps provider. I choose Digital Ocean with their $5/month package.

2, Pick Debian 6, 32 bit . (lighter than 64 bit).

3. Change source.list for these lines :

deb http://ftp.us.debian.org/debian squeeze main
deb http://security.debian.org/ squeeze/updates main
deb http://archive.debian.org/debian lenny main contrib non-free

4. Set priority of PHP only use Leny.

/etc/apt/preferences.d/lenny

Package: *
Pin: release n=lenny*
Pin-Priority: 100
Package: libapache2-mod-php5 php5-dev php5-common php5-curl php5-gd php5-mcrypt php5-mysql php5-cli php5-mhash php5-xsl php5-imap php$
Pin: release n=lenny*
Pin-Priority: 999

5. Install all related lamp package

#apt-get update
#apt-get clean#apt-get install libapache2-mod-php5 php5-common php5-curl php5-gd php5-mcrypt php5-mysql php5-cli php5-mhash php5-xsl php5-imap php5-xmlrpc php5-sqlite

#apt-get install mysql-server

6. Add cache ( I use eaccelerator)

#cd /root
#wget -c http://www.debiantutorials.com/static/eaccelerator-0.9.6.1.tar.bz2
#apt-get install php5-dev make

#rm /usr/lib/php5/build/ltmain.sh
#ln -s /usr/share/libtool/config/ltmain.sh /usr/lib/php5/build/ltmain.sh

#rm /usr/lib/php5/build/libtool.m4
#ln -s /usr/share/aclocal/libtool.m4 /usr/lib/php5/build/libtool.m4

#cd /usr/share/aclocal
#cat lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 >> libtool.m4

#cd eaccelerator-0.9.6.1/
#phpize
#./configure --without-eaccelerator-use-inode
#make
#make install

Configuration :

#nano /etc/php5/conf.d/eaccelerator.ini

extension=”eaccelerator.so”
eaccelerator.shm_size=”16″
eaccelerator.cache_dir=”/var/cache/eaccelerator”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=””
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”0″
eaccelerator.shm_prune_period=”0″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″

save.

#mkdir -p /var/cache/eaccelerator
#chmod 0777 /var/cache/eaccelerator
#/etc/init.d/apache2 restart

Check through phpinfo().

Extra step to protect from php shell alike : (editing php.ini)

disable_functions = dl , exec , passthru , pcntl_exec , pfsockopen , popen , posix_kill , posix_mkfifo , posix_setuid , proc_close , proc_open , proc_terminate , shell_exec , system , leak , posix_setpgid , posix_setsid , proc_get_status , proc_nice , show_source , escapeshellcmd

Done.

I can get php application work with 5.2 environment 🙂

Always use absolute path for cron job

Always use Absolute Path for your cron job. Yes, that lesson is another thing I learn from latest Godaddy case.

Temporary solution I use for bad malware that attack my client website is create shell script that overwrite bad .htaccess file with good .htaccess file. By implement this temporary solution downtime for client websites drastically suppressed by.

Until I check my email where I set the report send to. I miss 31 job because system can find shell file.

Yes, I use relative path for cron job. I only set absolute path for program location like /bin/bash for bash location etc. I never see this fail before, mayble because I implement it on virtual private server or dedicated server that use special resource.

Quick solution for this situation is using $HOME. Just add that variable in front of file name and you’ll get perfect cron job.

Simple as 123 🙂

Add new slave for kloxo control panel

My friend came and bring more problem too. He want to use vps hosting as alternative for his shared account that getting soft suspend for using many cpu resources. His work as internet marketing make uptime and downtime is very crusial.

He want to experiment with kloxo but willing to see more and since he want to give me access to new vps server  (via donate) I agree to set new CentOS vps server for him.

Here’s step by step guide install kloxo slave server :

Get new VPS server

So many vps provider outside and I choose one from vps.net

New account set up quickly and I have root access for CentOS 32 bit.

Update Yum

I love to use package management as front end tool for managing package.

#yum update

Install Editor

I prefer nano

#yum install nano

Disable secure linux (selinux)

# echo ‘selinux=disabled’ >> /etc/sysconfig/selinux

More

Kloxo and 500 – Internal Server Error

Kloxo control panel aka lxadmin in the past help me a lot in managing vps operational. I don’t have to touch configuration file for adding new domain, setting virtual host, grant database username and privileges etc. The other best part of this cpanel alternative are :

  1. It’s free ( I can asking for help or install it by myself)
  2. Low resources (specially memory where most  low end vps plan has limited)

Problem came when I must add new domain for my friend blog. I see this message after I enter username and password :

500 – Internal Server Error

I think it just small problem with service and  library conflict.

Restart Kloxo 1 st attempt :

# service kloxo restart

Stopping kloxo: Waiting for the process to die…..
Stopped kloxo

Starting kloxo: 11
mysqld (pid 30515) is running…
Started kloxo

Try again to login and I still get 500 – Internal Server Error message.

More