home   |   about us   |   our network   |   services   |   affiliates   |   contact
 
Services
» Web Hosting
» Reseller Hosting
» Dedicated Servers
» Windows/ASP.net Hosting
» Managed Web Hosting
» Server Security / Auditing
» Remote Backup / Storage
» Linux VDS
» Windows VDS
 
Support
» Support Desk
» Client Login
» Forums
» FAQs
» Help Files
» Acceptable Use Policy
» Client Testimonials
» Blog
 
Tutorials
» Dedicated Server Tutorial
» Website Optimization
» Search Engine Optimization
» Web Hosting Tutorials
» Web Programming Tutorials
» Networking Tutorials
» Virtual Server Tutorials
» Resources

The Crucial Blog - Archive

March 31, 2008

Upgrading WordPress from 2.3.3 to 2.5

1. Backup all the relevant files.

mv blog blog.bkp

2. Backup your MySQL database

mysqldump crucialu_blog > crucialu_blog.sql

3. Upgrade necessary plugins and once done, login to WordPress as admin and deactivate all plugins.

Dashboard ->> Plugins ->> Deactivate All Plugins

4. Download the latest wordpress.

wget http://wordpress.org/latest.tar.gz

5. Untar the file and rename it to /blog

mv wordpress blog

6. Copy the wp-config.php from the backup

cp -p blog.bkp/wp-config.php blog/

7. Take the URL http://www.crucial.com.au/blog/wp-admin/upgrade.php and Click on “Upgrade WordPress”

Click on “Continue” to complete the upgrade.

8. Copy the custom files /folder from backup to the new installation folder

cp -rpf blog.bkp/wp-content/* blog/wp-content/

9. Login to wordpress as admin and Activate the required plugins.

Dashboard ->> Plugins

After upgrade, if you are getting a blank screen while accessing the site, you might have forgotten to copy the themes and templates. Go to step 8 in that case.

Tags:

No Comments

Filed under: Uncategorized by — aaron @ 11:40 pm


March 31, 2008

LVM: pvcreate /dev/sda4 gives error Device /dev/sda4 not found (or ignored by filtering).

If you are using the pvcreate command something like this:

pvcreate /dev/sda4

And it gives an error like this:

Device /dev/sda4 not found (or ignored by filtering).

This can sometimes be resolved by rebooting the server (if the LVM partition was just created, and the server has not yet been rebooted).

Tags: ,

No Comments

Filed under: Uncategorized by — aaron @ 6:38 pm


March 27, 2008

Creating and Running a Ruby On Rails application in cPanel – Crucial Paradigm

A number of clients have approached us asking how to get their Ruby on Rails application running on , so we wrote a tutorial to help alleviate some of doubt:

  1. Login to cPanel.
  2. Click on the icon for “Ruby on Rails”.
  3. Check the box for “Load on boot?”
  4. Fill in the “App Name” box with the application name”.
  5. Application Path will be automatically filled as public_html/application_name
  6. Select “production” for the Environment, which should already be selected as the default.
  7. Click “Create”

After starting the application, you can access it using the URL : http://domainname/app_name/public/
Avoid : http://domainname/app_name/public

Each application will be using a port above 12000(>12000). The application will be automatically assigned a port when we are creating the application from cpanel.

Note : If we are creating the application under public_html directory, the application’s source code and configuration files can be viewed by anyone on the web. So, to avoid this you have two options:

  • Create the application in the public_html directory and change config file permission to 600. Especially the database.yml (/home/username/public_html/application_name/config/database.yml) file in which all the mysql access details are specified.
  • Create the application in home directory and use the rewrite option.

You can create the application in the home directory (/home/username) and then use the rewrite option in cpanel(Cpanel >> Ruby On Rails >> Create A Rewrite). On the right hand side of each application, click the link “Create Rewrite” and save the required rewrite rule. For example: if you want to redirect the main domain to your rails application port, say http://domainname:12002, Select the main domain in “Domain & URL to be redirected to rails app” section and click save. Similarly, you can redirect a subdomain to the rails application by selecting the corresponding subdomains from the list(Domain & URL to be redirected to rails app). But before that you should create that particular subdomain in cPanel.

Each user can run 4 rails applications at a time.

Simple test application :
========================

  • Create the application from cpanel, for exampe: Application name : example
  • Generate the test controller, via SSH:

#cd /home/username/public_html/example/
#ruby script/generate controller home

  • Create corresponding directory to store views, via SSH:

#cd /home/username/public_html/example/appl/views/
# mkdir home
# vi index.rhtml
<h1>Welcome</h1>
And save index.rhtml file.
#cd ..
#chown -R username:username home

  • Start the application
  • You can access the application from http://domainname:port/home/

When you access the URL http://domainname:port, the default ruby welcome page will be displayed. If you want to see the application on the main page, set the corresponding route in the configuration file routes.rb.

For example: In the above test application example, to display the welcome page of our home controller, instead of rails welcome page, uncomment and change the following line in routes.rb (home/username/public_html/example/config/routes.rb).
map.root :controller => “welcome”
==> map.root :controller => “home”

Move the default rails welcome index file “/home/username/public_html/example/public/index.html” to another name(index.html.bak) or you can remove the file.

  • Now you can access the home page from http://domainname:port

Creating a simple database application :
========================================

  • Create the application from cPanel, application name, eg: testdata.
  • Create the database. Use db migration to create the database. Create a database user with privileges and assign this user to the database in cPanel.
  • Edit /home/username/public_html/testdata/config/database.yml

production:
adapter: mysql
database: username_databasename
username: username_databaseusername
password: *******
host: localhost

  • Use scaffolding to generate the controller, models and views.

#ruby script/generate scaffold Test

Rails strongly recommends the following:

  • Use ‘id’ as your primary key in a table.
  • Name of the model should be the singularization of the name of the database table.
  • Use rake db:migrate to migrate the database.
  • Start the application from cpanel. You can access the application from http://domainname:port/tests/
  • The scaffold generater by default will create some views and controllers. The scaffolded actions and views are: index, list, show, new, create, edit, update, destroy. You can see these simple views in http://domainname:port/tests/. This scaffolding offers skeleton code frameworks from which we can generate the application.

Rails Environments :

  • Test : For testing, where we can use sample data.
  • Development : For development which will use most of the time when we develop the application. In this environment your application’s code is reloaded on every request.
  • Production : Production for the “real deal”, or when the site goes live.

Mongrel :

Cpanel uses Mongrel webserver for rails applications.

Starting mongrel :

  • Cpanel >> Ruby On Rails >> application name >> Click “Run”. Or from command line,

# cd <path to application>
#mongrel_rails start -p 12004 -d -e production -P log/mongrel.pid
p –> port
d –> daemon
e –> environment
P –> path to mongrel pid file (default path: /home/username/public_html/application/log/mongrel.pid)

NOTE: Thanks to Anusha for this great article! 

Tags: ,

No Comments

Filed under: Uncategorized by — aaron @ 6:28 pm


March 25, 2008

Gallery Upgrade Error: Some files and or directories in your storage directory are not writeable by the webserver user

While upgrading , you may come across with the following error while doing Step 2: System Checks

Error: Some files and or directories in your storage directory are not writeable by the webserver user.
Run chown -R webserverUser /home/abcduser/public_html/gallery/g2data/
OR run chmod -R 777 /home/abcduser/public_html/gallery/g2data/.

Even if you change the permissions / ownerships for g2data, you will get the same error.

This occurs when the versions.dat file is missing in the storage folder (g2data folder). You can create one by entering the following:

1.2.0.6
2.2

The second line is not significant. But you should enter the first line correctly. It must be the version of the g2 core module installed in the current gallery installation. You can get the version by executing this query in the MySQL database used by gallery.

SELECT g_parameterValue FROM g2_PluginParameterMap WHERE g_pluginId = ‘core’ and
g_parameterName = ‘_version’;

The output will be something like this:

+——————+
| g_parameterValue |
+——————+
| 1.2.0.6 |
+——————+

Once you create the versions.dat file, run the upgrade/index.php and run “System Checks”.

Tags: ,

No Comments

Filed under: Uncategorized by — aaron @ 12:08 am


March 19, 2008

HyperVM: VM creation has failed. Reason: Could not download __path_program_ or no_template_and_could_not_download []

with Error when trying to rebuild a , or when trying to setup a new :

VM creation has failed. Reason: Could not download __path_program_

Or

no_template_and_could_not_download []

Solutions:

  1.  Ensure firewall is not running on slave, or incoming and outgoing port 8889 is allowed.
  2. Set the permissions to 644 to the template (which is creating the error message) on the master server in the /home/hypervm/xen/template directory.
  3. Ensure that the FQDN (fully qualified domain name) for the HyperVM master server ( -> localhost -> Information) is resolving to the correct IP.
Tags: , , , ,

No Comments

Filed under: Uncategorized by — aaron @ 10:12 pm


March 18, 2008

FreeBSD Installation Issues/Problems Error: BTX halted

When you receive the following error:

BTX loader 1.00 BTX version 1.01
Console: internal video/keyboard
BIOS CD is cd0
BIOS drive A: is disk0
BIOS drive C: is disk1
BIOS drive D: is disk2

BIOS 639kB/523264kB available memory

/i386 bootstrap loader, Revision 1.1
(root at wvu1.btc.adaptec.com, Mon Feb 23 18:35:51 GMT 2004)

int=0000000d err=00000000 efl=00030246 eip=00003034
eax=0000205d ebx=00000004 ecx=00002000 edx=0000288c
esi=00000904 edi=0006290c epb=00001538 esp=00001502
cs=f000 ds=ee00 es=ee00 fs=0000 gs=0000 ss=ee00
cs:eip=0f 20 dd 81 e5 00 f0 0f-20 c2 0f 01 e0 a8 01 75
08 80 e2 fe e8 53 ff eb-21 0f 20 e0 a9 30 00 75
ss:esp=0c 29 06 00 04 09 00 00-38 15 00 00 22 15 00 00
04 00 00 00 8c 28 00 00-04 00 00 00 5d 28 00 00
BTX halted

This error can occur when installing via a USB CD-ROM drive, or if you have a USB hard drive. The solution to this is to unplug them, and install without using that device.

Tags: ,

No Comments

Filed under: Uncategorized by — aaron @ 1:56 am


March 16, 2008

Spamd child process causing high server load

Sometimes, spamd child process for a particular user can cause high server load. This is a bug with spamassassin and is reported here:

https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5612

To fix the issue, apply the patch mentioned in the bug.

For , run the following scripts:

/scripts/autorepair spamd_dbm_fix
/etc/init.d/ restart

Tags: , , ,

No Comments

Filed under: Uncategorized by — aaron @ 2:59 pm


March 13, 2008

Accesing 3ware RAID Card (8006-2LP) from Linux Command Line – tw_cli

If you are wanting to access 3Ware cards (which are great btw!), either the 8006-2LP you can use the tw_cli utility, which you can download from the 3ware website. This is a great way to manage most aspects of the card while your system is running, such as rebuilding an array, detecting failed drives, etc.

More info can be found here: https://twiki.cern.ch/twiki/bin/view/FIOgroup/Tw_cli

Tags: , ,

No Comments

Filed under: Uncategorized by — aaron @ 5:20 pm


March 13, 2008

MySQL error: supplied argument is not a valid MySQL result resource in /home/user/public_html/somepage.php

Common Errors:

- mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/user/public_html/somepage.php
- mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/user/public_html/somepage.php

Solution:

Most of the time, this happens because the database user doesn’t have enough permissions on the concerned database. When you check the permissions, even if shows all right, please grant the permissions once again. This should fix it :)

No tags for this post.
No Comments

Filed under: Uncategorized by — aaron @ 1:35 am


March 13, 2008

Gem Error Ruby on Rails cPanel: uninitialized constant Gem::GemRunner (NameError)

Error: uninitialized constant Gem::GemRunner (NameError)

When: Installing Ruby on Rails gem on

Solution:

1. Open the file

/usr/bin/gem
or
/home/username/ruby/bin/gem

2. Simply add the line to that file
require ‘rubygems/gem_runner’
after
require ‘rubygems’

3. Save and exit

Tags: , ,

No Comments

Filed under: Uncategorized by — aaron @ 1:34 am




     

Quick Links: Debian Dedicated Servers, Direct Deposit Hosting, Unmetered Dedicated Servers, Virtual Dedicated Servers, Windows Server Management, High Traffic Web Hosting - Load Balanced Clusters, Windows 2008 Server Virtual Dedicated Servers