FreeBSD Install Lighttpd Web Server

Posted on in Categories FreeBSD, Howto, lighttpd, php last updated June 30, 2007

I’ve received couple of request about running Lighttpd web server under FreeBSD:

How do I install Lighttpd web server under FreeBSD along with MySQL 5 and PHP5?

lighttpd a secure, fast, compliant and very flexible web-server which has been optimized for high-performance environments. It has a very low memory footprint compared to other webservers and takes care of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth, Output-Compression, URL-Rewriting and many more) make lighttpd the perfect webserver-software for every server that is suffering load problems. Installing lighttpd is quite simple under FreeBSD operating system using ports.

Lighttpd on FreeBSD

First update your port tree by typing following commands:
# portsnap fetch
# portsnap update

Install lighttpd web server under FreeBSD

Lighttpd port is located under /usr/ports/www/lighttpd:
# cd /usr/ports/www/lighttpd
Install lighttpd:
# make
# make install
# make clean

Install MySQL server

Install MySQL server:
# cd /usr/ports/databases/mysql50-server/
# make
# make install
# make clean

Also install mysql client support
# /usr/ports/databases/mysql50-client
# make
# make install
# make clean

Finally install mysql scripts:
# cd /usr/ports/databases/mysql50-scripts
# make
# make install
# make clean

Install php5 for lighttpd

Install PHP5 scripting:
# cd /usr/ports/lang/php5
# make
# make install
# make clean

Next you must install PHP5 extensions such as GB, mysql support and so on. At least select following extensions from menu:

  • ctype: The ctype shared extension for php
  • curl: The curl shared extension for php
  • dom: The dom shared extension for php
  • gd: The gd shared extension for php
  • imap: The imap shared extension for php
  • mbstring: The mbstring shared extension for php
  • mcrypt: The mcrypt shared extension for php
  • mysql: The mysql shared extension for php
  • mysqli: The mysqli shared extension for php
  • pcre: The pcre shared extension for php
  • posix: The posix shared extension for php
  • session: The session shared extension for php
  • simplexml: The simplexml shared extension for php
  • xml: The xml shared extension for php
  • xmlreader: The xmlreader shared extension for php
  • xmlwriter: The xmlwriter shared extension for php
  • zlib: The zlib shared extension for php

Type the following command:
# cd /usr/ports/lang/php5-extensions
# make
# make install
# make clean

Auto start lighttpd and mysql service

You need to enable both services. Open /etc/rc.conf:
# vi /etc/rc.conf
Append following two lines:
mysql_enable="YES"
lighttpd_enable="YES"

Start Mysql Server Under FreeBSD

To start MySQL server, enter:
# /usr/local/etc/rc.d/mysql-server start

Start Lighttpd Server Under FreeBSD

To start Lighttpd server, enter:
# /usr/local/etc/rc.d/lighttpd start

Verify that lighttpd is running:
# netstat -nat

FreeBSD Lighttpd configuration file location

  • Config file location: /usr/local/etc/lighttpd.conf
  • Default documentation root location : /usr/local/www/data/
  • Default username and groupname : www

See also:

Start and stop VMWARE VPS / virtual machine guest operating system from command line

Posted on in Categories Howto, Linux, Linux distribution, RedHat/Fedora Linux, Sys admin, Tips last updated June 30, 2007

Vmware server comes with the nifty vmware-cmd utility. It allows an administrator to perform various operations on a virtual machine from Linux command line / shell prompt such as:

=> Stop / Start VM

=> Get VM status

=> Setup variables

=> Powerdown VM and much more

Task: Lists the virtual machines on the local server

You can list all servers and config file, enter:
# vmware-cmd -l
Output:

/nas/vms/Ubuntu/Ubuntu.vmx
/nas/vms/FreeBSD/FreeBSD.vmx
/nas/vms/OpenBSD/OpenBSD.vmx
/nas/vms/Debian4/Debian4.vmx
/nas/vms/CentOS5/CentOS5.vmx

Turn on VM / Power up VPS

Just pas start option to vmware-cmd,
# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx start

To stop VM/VPS, enter:
# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx stop

To reset VM/VPS, enter:
# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx reset

To suspend VM/VPS, enter:
# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx suspend

Find out if OpenBSD VM is on or off:
# vmware-cmd /disk2.vmware/vms/OpenBSD/OpenBSD.vmx getstate
Output:

getstate() = off

vmware-cmd offers other options, please consult VMWARE documentation for more information.

Download Linux Google desktop application

Posted on in Categories Download of the day, Linux desktop, Linux distribution, RedHat/Fedora Linux, Ubuntu Linux last updated June 28, 2007

Google Desktop is a desktop search application that gives you easy access to information on your computer and from the web. Desktop makes searching your own email, files, music, photos, and more as easy as searching the web with Google.

Earlier this application was only available on Windows or Mac system. Now google released Linux version. This is done almost three years after the product’s launch for the Windows operating system.

=> Search your computer as easily as you search the web with Google

=> Find information in your documents, emails, web history, and more

=> Open files with just a few keystrokes

Google Desktop for Linux runs on Debian 4.0, Fedora Core 6, Ubuntu 6.10, SUSE 10.1, and Red Flag 5.

On a related note if privacy is a big concern try old good find command or Linux GUI desktop search application.

Download Linux Google Desktop

Hans Reiser: Once a Linux Visionary, Now Accused of Murder

Posted on in Categories Links, Linux, News last updated June 26, 2007

Hans Reiser is best known for ReiserFS a general-purpose, journaled computer file system for Linux. He is deeply involved in the Linux kernel development with his widespread ReiserFS journaling file system and its successor Reiser4. Since October 10, 2006, he is charged with the murder of his missing estranged wife, Nina Reiser, and is currently being held on remand.

This article provides some insight about Hans and his current situation:

Hans Reiser is waiting for me, standing on the other side of an imitation-wood table. The room is small, the concrete walls bare. A guard locks the steel door from the outside. There is no sound. Reiser is wearing the red jumpsuit of a prisoner in solitary confinement, though he has been allowed to meet with me in this chilly visiting room. There was a time when he was known as a cantankerous but visionary open source programmer. His work was funded by the government; he was widely credited (and sometimes reviled) for rethinking the structure of the Linux operating system. Now he is known as prisoner BFP563. I stick out my hand. It’s an awkward moment — his wrists are chained to his waist. It’s mid-December now, and he’s been in this jail 40 miles east of San Francisco for two months, ever since the Alameda County District Attorney’s office accused him of murdering Nina Reiser, his estranged wife.

Read more

Postfix mail server block Malware with blacklist

Posted on in Categories Howto, Linux, Mail server, Networking, Postfix, RedHat/Fedora Linux, Security, Shell scripting, Suse Linux, Sys admin, Tips, Ubuntu Linux, UNIX last updated June 25, 2007

Malware is used for a malicious purpose. It can be in your software or hardware. Email and pirated software is the most powerful way to spread malware. Malware inserted in a system without user notification.
Continue reading “Postfix mail server block Malware with blacklist”

Install and configure MySQL on Windows XP or Vista or 2003 server

Posted on in Categories GNU/Open source, MySQL, Windows, Windows server last updated June 25, 2007

There is a nice small article about using MySQL on Windows 2003 or Vista desktop system.

I honestly have to say that, now after years of using MySQL on Windows, I find it to be my favorite database/platform combination of choice. In my opinion, it’s easier to use than Microsoft’s own database on their platform, the performance and feature set will meet 90+% of the needs that Windows/Web applications have, it consumes less resources than SQL Server, and the reliability is stellar.

This article shows you why you should believe this to be the case and why, if you haven’t started using MySQL on Windows yet, you really should think about doing so.

MySQL on Windows? Absolutely! [mysql.com]

Postfix mail server block .bat, .exe .com .vbs mime attachments – common virus spreading files

Posted on in Categories Howto, Linux, Mail server, Postfix, RedHat/Fedora Linux, UNIX last updated June 20, 2007

Postfix provides Mime header check for all incoming messages. You can put restrictions on .exe / .bat / .vbs files and block all attachments.

mime_header_checks directive allows you to define file, you will place a restriction for any file extensions that you do not want to have passing through your mail sever system.

On most mail server the first thing that needs to be done is to enable header checks and block dangerous files.

Define mine header checks

Open main.cf file:
# vi /etc/postfix/main.cf
Append / set mime_header_checks directive as follows:
mime_header_checks = regexp:/etc/postfix/mime_header_checks

Save and close the file.

Block attachments

Now open /etc/postfix/mime_header_checks file:
# vi /etc/postfix/mime_header_checks
Append following line:
/name=[^>]*\.(bat|com|exe|dll|vbs)/ REJECT
Save and close the file.

Restart postfix

First create postfix lookup table for mime_header_checks file:
# /etc/init.d/postfix restart

Watch log file

You should see rejected mail log in /var/log/maillog file:
# tail -f /var/log/maillog
Output:

Jun 20 14:28:06 server postfix/smtpd[5442]: connect from web31601.mail.mud.yahoo.com[68.142.198.147]
Jun 20 14:28:07 server postfix/smtpd[5442]: 245F913906EE: client=web31601.mail.mud.yahoo.com[68.142.198.147]
Jun 20 14:28:07 server postfix/cleanup[5492]: 245F913906EE: message-id=<[email protected]>
Jun 20 14:28:07 server postfix/cleanup[5492]: 245F913906EE: reject: header Content-Type: application/x-msdos-program; name="updatebankdetails.bat" from web31601.mail.mud.yahoo.com[68.142.198.147]; from= to= proto=SMTP helo=: Message content rejected

For more information please read postfix and header_checks man page.

Red Hat and Canonical (Ubuntu) rejected any patent deals with Microsoft

Posted on in Categories GNU/Open source, Linux, Linux desktop, Linux distribution, News, Windows last updated June 20, 2007

This is really good news. Both Redhat and Canonical (Ubuntu’s parent company) has rejected nasty Microsoft patent deals.

Following Linux distributions and companies made a patent deals with Microsoft:
[a] Novell Suse Linux
[b] Linspire Linux desktop
[c] Xandros Linux desktop
[d] LG Electronics

The drama started last November, when Microsoft inked a deal with Novell to foster interoperability and technical collaboration between the open- and closed-source operating systems. Novell also got protection from possible patent suits as part of the agreement.

Soon after, Microsoft came out with allegations that the open-source camp is infringing on 235 of its patents, and the software giant began making moves to form alliances with other Linux providers. The company was successful in negotiating partnerships with Xandros and Linspire, but has hit a wall with Ubuntu and Red Hat.

Canonical chief executive Mark Shuttleworth has made it clear that Ubuntu isn’t interested in forming a deal with Microsoft along the lines of those recently reached by Linspire, Xandros and Novell.

Red Hat Says No to Microsoft ‘Innovation Tax’

Amarok audio player for Linux / UNIX Tips and Howto

Posted on in Categories Linux, Linux desktop last updated June 19, 2007

Amarok is an audio player for Linux and Unix-like operating systems. This article offers some good tips for new Linux users:

Amarok is one of the best audio players for Linux, but there is a lot more it can do than just play your tunes. We are taking a look at our top five tips of things you can do with this amazing player. A part of the KDE suite of applications, Amarok has been around for a while. It continues to be one of the most widely used audio players in Linux, partly in thanks to the fact that it’s included in many distros. It was originally developed as a means to replace and outperform XMMS, and oddly enough it was those goals that made me first give it a try. Despite the fact that I’ve been using Amarok for a few years now, I continue to stumble on features I didn’t know existed, and also easier ways of handling simple tasks.

In this short article, I will be relaying a few of my favorite features of Amarok that you just may not know about. I have to mention that depending on your distro or method or installation, some features may not be automatically available to you. Also, some of these features are more obvious than others, but might be largely ignored for those lacking investigative motivation

http://techgage.com/article/top_five_amarok_tips