The FreeBSD Daemon

A Blog dedicated to BSD loving

FreeMailServ - A FreeBSD Mail server for the masses

Hello,

After seeing the success of projects like pfSense, FreeNAS and the new kid on the block Askozia I’ve decided to try and build a mail server based on the m0n0wall project.

The project will be called FreeMailServ and it’s main aim will be to allow the rapid deployment of a FreeBSD exim mail server using the m0n0wall interfcace with the option of running anti-spam, anti-virus, webmail and various other goodies.

If anyone is keen to offer some advise or lend a hand please drop me a mail: rudi at freebsd-daemon.net.

Cheers
Rudi

2 comments

Cvsup is dead long live csup

It gives me great pleasure to tell you all that cvsup (cvsup-without-gui for most of us) is dead and has been replaced by csup.

Csup has been part of the FreeBSD base distribution since FreeBSD 6.2-RELEASE. If you have a pre 6.2 version of FreeBSD you can install csup from ports: cd /usr/ports/net/csup/ && make install clean.

Taken from the handbook:

“The csup utility is a rewrite of the CVSup software in C. Its biggest advantage is, that it is faster and does not depend on the Modula-3 language, thus you do not need to install it as a requirement. Moreover, if you are using FreeBSD 6.2 or later, you can use it out-of-the-box, since it is included in the base system. Older FreeBSD versions do not have csup(1) in their base system but you can easily install the net/csup port, or a precompiled package. The csup utility does not support CVS mode, though. If you want to mirror complete repositories, you will still need to use CVSup. If you decided to use csup, just skip the steps on the installation of CVSup and substitute the references of CVSup with csup while following the remainder of this article.”

Link to handbook: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html
Link to Csup site: http://mu.org/~mux/csup.html

Rudi

No comments

Upgrading FreeBSD using freebsd-update: major and minor versions

In my previous post I briefly touched on using freebsd-update to bring your freebsd system up to date with the latest security patches.

You can also use freebsd-update to upgrade your system to a new minor version (6.1 to 6.3) or to a major versions (6.3 to 7.0)

! This method is best utilized if you are not using a custom kernel !

Minor upgrades e.g. 6.1 to 6.2

1) To kick things off you need to obtain the latest freebsd-update script. (If you are running FreeBSD 7.0-RC1 or FreeBSD 6.3-RC1 or later then you can skip this step)

- mkdir /usr/local/freebsd-update
- fetch http://www.daemonology.net/freebsd-update/freebsd-update-upgrade.tgz

2) Extract the script

- tar -xf freebsd-update-upgrade.tgz

3) Run the script, changing the version number to the required version:

- sh freebsd-update.sh -f freebsd-update.conf -r 6.3-RELEASE upgrade

or even

- sh freebsd-update.sh -f freebsd-update.conf -r 6.3-BETA1 upgrade

4) Install the new updates

- sh freebsd-update.sh -f freebsd-update.conf install

5) Reboot

- shutdown -r now

6) Install the last of the updates

- sh freebsd-update.sh -f freebsd-update.conf instal

7) Check that the correct version has been installed

- uname -a

Done!


Major upgrades e.g. 6.1 to 7.0 beta 4

1) We need to ensure that the ports tree is update before we begin
- portsnap fetch update2) We also need to make sure that all our installed ports have are updated to the latest versions- cd /usr/ports/ports-mgmt/portupgrade && make install clean
- portupgrade -a3) Obtain the latest version of the freebsd-update script. (If you are running FreeBSD 7.0-RC1 or FreeBSD 6.3-RC1 or later then you can skip this step)- mkdir /usr/local/freebsd-update
- fetch http://www.daemonology.net/freebsd-update/freebsd-update-upgrade.tgz

4) Extract the script

- tar -xf freebsd-update-upgrade.tgz

5) Run the script chaning the version number as required:

- sh freebsd-update.sh -f freebsd-update.conf -r 7.0-BETA4 upgrade

6) If everything runs fine with no errors install the updates:

- sh freebsd-update.sh -f freebsd-update.conf install

7) Restart the system:

- shutdown -r now

8) Run the script again to finish of the installation:

- sh freebsd-update.sh -f freebsd-update.conf install

9) Update all ports for the new version:

- portsnap -I update

10) Run the script one last time:

- sh freebsd-update.sh -f freebsd-update.conf install

11) Reboot last time:

- shutdown -r now

12) Finished, check the new version:

- uname -a

Done!

Check out these pages for more information:

http://www.daemonology.net/blog/2007-11-11-freebsd-major-version-upgrade.html

http://www.daemonology.net/blog/2007-11-10-freebsd-minor-version-upgrade.html

No comments

How to install Lighttpd, eAccelerator and Cacti on FreeBSD 6.2

How to install Lighttpd, eAccelerator and Cacti on FreeBSD 6.2 +

Software Instalation:

1) Install FreeBSD

- http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/install.html

2) Update FreeBSD with security patches and latest version of ports

- portsnap fetch extract
- freebsd-update fetch install
- restart

3) Install lighttpd

- cd /usr/ports/www/lighttpd && make install clcean

4) Install eAccelerator

- cd /usr/ports/www/eaccelerator/ && make install clean

3) Install Cacti

- cd /usr/ports/net-mgmt/cacti/ && make install clean

4) Install Cactid

- cd /usr/ports/net/cactid/ && make install clean

5) Install MySql Server

- cd /usr/ports/dataase/mysql50-server && make install clean

Install portaudit

- cd /usr/ports/ports-mgmt/portaudit && make install clean

Software Setup:

1) Lighttpd:

Log Files:

mkdir /var/log/lighttpd/
touch /var/log/lighttpd/access.log
touch /var/log/lighttpd/error.log
chown -R www:www /var/log/lighttpd

vi newsyslog.conf

Add: /var/log/lighttpd/*.log www:www 644 10 500000 168 W0D10G /var/run/lighttpd.pid

Config File:

vi /usr/local/etc/lighttpd.conf

Unhash “mod_fastcgi”, under server.modules.
Change “/var/log/lighttpd.error.log” to “/var/log/lighttpd/error.log”
Change “/var/log/lighttpd.access.log” to “/var/log/lighttpd/access.log

Uncomment fastcgi section and edit as per below:

fastcgi.server = ( ".php" =>

( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/local/bin/php-cgi"
)
)
)

Add virtual host Section, edit YourSiteName with your site name.

$HTTP["host"] == “www.YourSiteName.com” {
server.document-root = “/usr/local/www/data/cacti”
accesslog.filename = “/var/log/lighttpd/cacti.access.log”
}

Startup Script:

/usr/local/etc/rc.d/lighttpd start

Startup at boot:

echo “lighttpd_enable=”YES”" >> /etc/rc.conf

cp php.ini-recommended php.ini

2) eAccelerator:

vi /usr/local/etc/php.ini

Find the section called ; Dynamic Extensions and underneath add:

extension=”eaccelerator.so”
eaccelerator.shm_size=”16″
eaccelerator.cache_dir=”/tmp/eaccelerator”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=”"
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”0″
eaccelerator.shm_prune_period=”0″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″

mkdir /tmp/eaccelerator
chown www /tmp/eaccelerator
chmod 700 /tmp/eaccelerator

3) MySql:

echo “mysql_enable=”YES”" >> /etc/rc.conf

/usr/local/etc/rc.d/mysql-server start

/usr/local/etc/rc.d/mysql-server stop

/usr/local/bin/mysqld_safe –user=mysql &

Change the newpassword to your new root password:

/usr/local/bin/mysqladmin -u root password newpassword

/usr/local/etc/rc.d/mysql-server restart

4) Setup MySql & Cacti

mysqladmin -u root -p create cacti

Change cactipass and/or cactiuser to a new details:

echo “GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY ‘673bfbfgsf2f’; FLUSH PRIVILEGES;” | mysql -p

mysql -p cacti < /usr/local/share/cacti/cacti.sql

vi /usr/local/share/cacti/include/config.php

Edit the file per the above db settings used.

Add symlink to cacti install

ln -s /usr/local/share/cacti /usr/local/www/data/cacti

Go to www.YourSiteName.com and click next, next next..

When prompted for the username and password enter:

Username: admin
Password: admin

Change password.

Click on Settings, Paths and under Cactid Poller File Path enter: /usr/local/bin/cactid
Click save

Click on Poller, change Poller Type to cactid
Click Save

5) Final Admin task:

vi /etc/rc.conf

#Syslog
syslogd_enable=”YES”
syslogd_flags=”-ss”

# Sendmail
sendmail_enable=NO

vi /etc/aliases
Uncomment & edit:
# root: me@my.domain

type: newalias

vi /etc/crontab
add:

#Cacti
*/5 * * * * cacti /usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null 2>&1

Done!!

References: http://osresources.com/5_11_en.html

**Update**

Added G to newsyslog entry to make it work
Added portaudit

7 comments

In the beginning . . .

Welcome to the FreeBSD Daemon.

This is my space on the internet where I can share and learn more about FreeBSD.

FreeBSD is UNIX like operating system which is free to use, free to change, free to sell under the BSD license. You can get more information by checking out the wiki and also the FreeBSD website.

If you are new to FreBSD I would also recommend checking out the  FreeBSD Handbook and also the excellent book written by Greg Lehey The Complete FreeBSD.

Enough blah blah for now, watch this space for more interesting developments.

Rudi

No comments