WPNoise.com » LiteSpeed WebServer on Slicehost VPS

LiteSpeed WebServer on Slicehost VPS

What is VPS ?

A virtual private server (VPS, also referred to as Virtual Dedicated Server or VDS) is a method of splitting a server. Each virtual server can run its own full-fledged operating system, and each server can be independently rebooted.

The practice of partitioning a single server so that it appears as multiple servers has long been common practice in mainframe computers, but has seen a resurgence lately with the development of virtualization software and technologies for other architectures.

What are the benefits of using VPS ?

It is faster that shared hosting, so putting this to simple words your websites will work & load faster with VPS. You will have full control of your system plus many other benefits.

My hosting history

I start with cheap shared hosting but after sometime I moved all my sites to VPS. I was testing many companies for long time but from almost 2 years I am using slicehost and I am pretty happy with them.

In this post I try to show you howto setup good VPS hosting server and use it for your websites. It was written by my friend Dru who helped me setup my VPS and I think it will be a good howto for all of you.

Basic Details:

When I am starting new project, website I need to create couple of things:

1. Create user

a.) create a user using webmin

- Click on System in the sidebar, then on users and groups
- Click on create new user
- for the username ALWAYS use the domain name for the name of the user. So in this case: example.org do the same for the group (choose new group and name it the same way – THIS IS VERY IMPORTANT)
- then click save

When you create the user in webmin there should be a field where you can set the group, that will let you pick the www-data group before you create the user.

b.) shell method (i prefered this method)

I use this one: adduser username –ingroup www-data –force-badname

where username = whatever you want the user to be called, ie

adduser example.org –ingroup www-data –force-badname

2. Create LiteSpeed folders

Now you need to FTP in (don’t use ssh or sftp it has to be ftp). (use the server ip, the username will be whatever you called the user and the password will be whatever you configured)

Once you’ve done that create the following folders: config public_html cgi-bin

3. New site in LiteSpeed

Login to litespeed http://your_IP/index.php (user: **** password: ****)

Go to configuration, then virtualhost templates.
Click on PHP_SuEXEC

Where it says Member Virtual Hosts click the add link to the right of it, then fill in the following:

- virtualhost name – should be the domain name (example.org)
- domain name – should be the same as the above
- aliases – should be the same as the above except with www. at the start (www.example.org)
- virtualhost root – Leave Blank

Save, and then go to actions and graceful restart to restart the webserver.

FTP your files into the public_html folder and you should be able to access them in your browser.

4. Importing Databases

when you move website between hostings

First create a blank database with phpmyadmin.

Then in the commandline, navigate to the folder where the sql file is. Then do this command:

mysql -u user -p user_dbname < file.sql

where dbname = name of the blank database
where file.sql = the SQL file you're importing.

It will ask you for the root password and then in a few seconds it'll be done.

5. BONUS TIPS & TRICKS

a.) How to move files when migrating to new server ?

On old server backup files with tar, you use one command line to backup all files to one tar or tar.gz file.

Put this file in public_html folder on this server. Next go to new server and:

wget link_to_the_gzip_file_on_the_old_server

Next untar the files to proper place and that is it.

b.) Problem with file permissions

Sometimes when i move files from one server to another i got problems with file permissions on new server. To fix I use this method:

cd /home/example.org

and then do

chown -R example.org:www-data public_html

and then

chmod 770 -R public_html.

c.) MySQL problem with coding, default charset

Sometimes i got problem (Wordpress UTF-8 Charset Woes) with coding in sql base, there was strange coding problems in text and i need to fix that. I use this solution:

$ mysql –user=frog -p –execute=”DROP DATABASE dbname;
CREATE DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;”

$ mysql –user=frog –max_allowed_packet=16M -p –default-character-set=utf8 dbname < dump_utf8.sql

and it works for me..

To find more about this one look here: Convert latin1 to UTF-8 in MySQL

So good luck with great hosting Slicehost and webserver LiteSpeed, for me it works really great for almost 2 years now!

3 Responses to “ LiteSpeed WebServer on Slicehost VPS ” {+}

  1. comment by jack

    Hi Peter.. Good info here.. Wonder if you had to rebuild PHP from source using the Litespeed patch to get Wordpress working ? Reason I’m asking, I’m in the process of rebuilding a box on Slicehost (long story) and the default PHP binary is 4.4.x, but during the wordpresss install, I’m getting no output at all. The server log is of no help. . Not sure if there is a debug method in WP during install, but as of now I’m stuck … Never had this issue using a prior version of WP (on the SLicehost VPS), but I DID build php 5.3.x using Litespeed patch, which worked fine..

  2. comment by Peter Slabosz

    @JACK

    Never played with it… but I can promise You that when I find some free time (it will be hard) I will search for some answers that can help you.

    I am still using VPS on Debian 4 with system updates and it works great…

    One time I have problems with memory but it was because of spam attacks on my forum.

  3. comment by Magdalene Rodela

    No,no,no. There is always a choice to choose from. If you want full customer service you better go to one small hosting company called linuxhostinghub(.)com and see what you need.

Leave a Reply