Tag Archives: freebsd

Install Varnish with Apache on FreeBSD 9.2

Today I want to try to install Varnish on FreeBSD. A few scenarios  on my mind. Install varnish with nginx, lighttpd or cherokee with different port under Apache as front end. Due to lack of experience with Varnish I’ll start with Varnish using Apache first. Others will follow :-)

Lets get started

Check Apache installation

# pkg_info | grep apache
apache22-2.2.26     Version 2.2.x of Apache web server with prefork MPM.

Check location of varnish

# whereis varnish
varnish: /usr/ports/www/varnish

Install varnish

# cd /usr/ports/www/varnish && make install

……….

===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/sbin/varnishd
/usr/local/bin/varnishtest

This port has installed the following startup scripts which may cause
these network services to be started at boot time.
/usr/local/etc/rc.d/varnishncsa
/usr/local/etc/rc.d/varnishd
/usr/local/etc/rc.d/varnishlog

If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type ‘make deinstall’
to deinstall the port if this is a concern.

For more information, and contact details about the security
status of this software, see the following webpage:
http://www.varnish-cache.org/
Great.

Check it

# pkg_info | grep varnish
varnish-3.0.4       The Varnish high-performance HTTP accelerator

Configure Varnish

Add varnish on rc.conf

# echo 'varnishd_enable=YES' >> /etc/rc.conf

Starting Varnish

# /usr/local/etc/rc.d/varnishd start
Starting varnishd.
Classic hash: 16383 buckets

Check if varnish really run?

# /usr/local/etc/rc.d/varnishd status
varnishd is not running.

Ok…ok..ok.

View varnish configuration

# ee /usr/local/etc/varnish/default.vcl

Inside the file I see these :

 # Default backend definition.  Set this to point to your content
# server.
#
# backend default {
#     .host = “127.0.0.1”;
#     .port = “8080”;
# }

It means the content need to run on port 8080.

Remove all # mark to be like this :

backend default {
.host = “127.0.0.1”;
.port = “8080”;
}

save the file.

Change apache configuration to run on port 8080.

# ee /usr/local/etc/apache22/httpd.conf

change

Listen 80

to

Listen 8080

save the fle.

Restart apache

# /usr/local/etc/rc.d/apache22 restart
Performing sanity check on apache22 configuration:
Syntax OK
Stopping apache22.
Waiting for PIDS: 770.
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.

# ps -ax | grep httpd
944 ??  Ss    0:00.11 /usr/local/sbin/httpd -DNOHTTPACCEPT
945 ??  S     0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
946 ??  I     0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
947 ??  I     0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
948 ??  I     0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
949 ??  I     0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT

Retry to run varnish

# /usr/local/etc/rc.d/varnishd start
Starting varnishd.
Classic hash: 16383 buckets

Check varnish
# ps -ax | grep varnish
963 ??  Ss    0:00.00 varnishd: Varnish-Mgr freebsd92.rasyid.net (varnishd)
964 ??  S     0:00.03 varnishd: Varnish-Chld freebsd92.rasyid.net (varnishd)
966  0  R+    0:00.00 grep varnish

Check Varnish

Check via phpinfo file, I can see it run on Varnish :

varnish_freebsd92

Interesting. I’ll continue this experiment with different web server as soon as possible.

See you.

P.S : you can enable varnish log

# echo 'varnishlog_enable=YES' >> /etc/rc.conf
# /usr/local/etc/rc.d/varnishlog start
Starting varnishlog.

FreeBSD 6.4-RC2

From FreeBSD lists :

The second Release Candidate for FreeBSD 6.4 is now available.  FreeBSD
6.4-RC2 should be the last of the public test builds for the FreeBSD 6.4
release cycle.  Unless a big show-stopper is found from this round of
testing we should begin the 6.4-RELEASE builds in about a week and a
half.  We encourage you to test out 6.4-RC2 and report any problems by
submitting PRs or via email to the freebsd-stable list.

One of the things that could use some testing is the late-arriving
patches to sysinstall that should eliminate the excessive disc swapping
that previous releases had if things like gnome or kde were installed as
part of the initial CDROM install.  Things selected before you reach the
“Package Selection Menu” are handled as separate passes from the things
that get selected at that menu.  So depending on what you install before
you reach that menu (e.g. Xorg selected as part of the distributions)
and what you select at that menu there may still be some disc swapping
involved.  But “worst case” given the current layout it should ask for
any given disc no more than twice.

Full release

Iso download

PC-BSD 7.0.1

From PCBSD :

After much hard work and testing the PC-BSD Team is happy to announce the availability of PC-BSD 7.0.1, i.e. the first upgrade in the 7 series, with FreeBSD 7.0 under the hood.

Version 7.0.1 contains a number of bugfixes and improvements. For a full list of changes, please refer to the changelog. Some of the changes are:

* KDE 4.1.2
* AMD64 version
* NTFS write support
* Adobe Flash 9 support (Linux -flashplugin9)
* Better WIFI support
* Updates to the System Updater

This version of PC-BSD can be downloaded and installed as a fresh install or, alternatively, can be updated to from PC-BSD 7.0 via the System Update tool.

Full release information

FreeBSD in Wikipedia