Introduction:
There are a lot of small vps offered in Lowendtalk and other forums. These are ok to run a blog, normally personal and fair traffic blog. I am going to introduce you to a very light and good blog software. It’s called “Nibbleblog“.
Objective:
We will need a lightweight server and php to run this blog.(I have used Debian-7 minimal 64 bit in 128mb vps) I have always been a fan of Lighttpd. So I will guide you to install
- Lighttpd
- php5
Also I will tweak the server to allow larger uploads and clean urls.
Step-01: Install Lighttpd.
First make sure repository is updated and all softwares are upgraded.
1 |
apt-get update;apt-get dist-upgrade |
Now install lighttpd.
1 |
apt-get install lighttpd |
You will be able to browse the default index page now by ip address. Now edit /etc/lighttpd/lighttpd.conf and make sure you change this
to this
Change the portnumber ONLY if you are using a lowendspirit vps and restart lighttpd.
1 |
service lighttpd restart |
Step-02: Configure Virtualhost.
Create default folder of your domain.
1 |
mkdir /var/www/domain.com |
Now edit /etc/lighttpd/lighttpd.conf and put below line there and save.
1 |
include "domain.com.conf" |
Now create “domain.com.conf” file in /etc/lighttpd/
1 |
touch /etc/lighttpd/domain.com.conf |
Edit that file and put below code and save and restart lighttpd.
1 2 3 4 |
$HTTP["host"] =~ "(^|\.)domain.com$" { server.document-root = "/var/www/domain.com/" cache.enable = "enable" } |
1 |
service lighttpd restart |
Step-03: Install php
1 |
apt-get install php5-common php5-cgi php5 php5-gd php5-mcrypt |
Enable php on lighttpd.
1 |
lighty-enable-mod fastcgi-php |
and restart lighttpd.
1 |
service lighttpd restart |
Now create a php file to check if php is enabled or not.
1 |
touch /var/www/phpinfo.php |
1 |
nano /var/www/phpinfo.php |
Put below code and save that file.
1 2 3 |
< ?php phpinfo(); ?> |
If you access that page by ip/phpinfo.php and you see a page starting php version and logo then your installation so far is ok. You will find “upload_max_filesize” as 2M that means you can upload a filenot more that 2M. Find php.ini and let’s tweak it to upload larger files.
1 |
find / -type f -name php.ini |
It should give output-
1 |
/etc/php5/cgi/php.ini |
Edit that file with nano and find the line “upload_max_filesize” by ctrl+w and increase the value, example 10M. We have to find the “post_max_size” line too. The value should be double of “upload_max_filesize“, that means as example you have put 10M in that line so you have to put 20M for uploading 10M file.
Save it and restart lighttpd.
1 |
service lighttpd restart |
Now if you visit that phpinfo.php you will see “upload_max_filesize 10M“.
Step-04: Install Nibbleblog
Go to the domains directory.
1 |
cd /var/www/domain.com |
and download the archive file of nibbleblog from http://www.nibbleblog.com/download/en/ I will chose ‘Nibbleblog v4.0.3 “Coffee”‘, this is totally html input but you can download markdown only platform too.
1 |
wget http://sourceforge.net/projects/nibbleblog/files/v4.0/nibbleblog-v4.0.3.zip |
Install unzip to extract this file.
1 |
apt-get install unzip |
Now extract it.
1 |
unzip nibbleblog-v4.0.3.zip |
It will extract to a folder named nibbleblog. Let’s move all files from that fodler to domains root folder.
1 |
mv /var/www/domain.com/* /var/www/domain.com/ |
Delete the now empty folder.
1 |
rm -rf /var/www/domain.com/nibbleblog |
Now from browser goto http://domain.com/ where you will see installation windows.
Set Blog name,Slogan,username and email and then press/click install. It will show you installation complete window.
You can manage blog and post from http://domain.com/admin.php and it will show you a login area.
Step-05: Clean Url and Security
After login in go to Settings>SEO Options Scroll below and enable Friendly URLS. Those codes are for apache server. You have to edit “/etc/lighttpd/domaincom.conf” and make sure it looks like below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
$HTTP["host"] =~ "(^|\.)domain.com$" { server.document-root = "/var/www/domain.com/" cache.enable = "enable" #Clean urls url.rewrite-once = ( "^/(.*)\.(.+)$" => "$0", "^/category/([^/]+)/page-([0-9]+)$" => "index.php?controller=blog&action=view&category=$1&number=$2", "^/category/([^/]+)/$" => "index.php?controller=blog&action=view&category=$1&number=0", "^/tag/([^/]+)/page-([0-9]+)$" => "index.php?controller=blog&action=view&tag=$1&number=$2", "^/tag/([^/]+)/$" => "index.php?controller=blog&action=view&tag=$1&number=0", "^/page-([0-9]+)$" => "index.php?controller=blog&action=view&number=$1", "^/post/([^/]+)/$" => "index.php?controller=post&action=view&post=$1", "^/post-([0-9]+)/(.*)$" => "index.php?controller=post&action=view&id_post=$1", "^/page/([^/]+)/$" => "index.php?controller=page&action=view&page=$1", "^/feed/$" => "feed.php", "^([^/]+)/$" => "index.php?controller=page&action=$1" ) #Secure file access url.access-deny = ( ".xml", "shadow.php", "keys.php", ) #Disable Directory Listing dir-listing.activate = "enable" } |
You will have to restart the lighttpd.
1 |
service lighttpd restart |
Now everything should be ok with clean url.
Conclusion:
This is a very lightweight blog. It will give you pleasure to write. You can get and make very beautiful themes easily. A little knowledge needed to make it beautiful. Hope you enjoy it. Happy Blogging. 🙂
3 comments for “Easy,Fast,Light Nibbleblog using Lighttpd”