The Ogden Area Linux Users Group


March 31, 2007 IRC Meeting Report

Posted in Meeting Report by Aaron on the April 2nd, 2007

The IRC logs can be found here.

This meeting was held just two days ago about VSFTPD. The meeting was given by Clint Savage of the Provo Linux Users Group, and was quite informative. For those that missed it, no worries- we’ll be holding the same meeting in person in May, this time, in more detail, and probably hands on.

Details to follow.

Jan 17, 2007 Meeting Report: Part 1

Posted in Howto, Meeting Report by Kevin on the January 22nd, 2007

For the meeting on the 17th Kevin Carter talked about the installation and configuration of Apache and PHP from source. What follows is a detailed howto from that meeting. First off though is some links that were presented in the meeting.

VirtualBox goesopen source http://virtualbox.org/
Linux Kernel in a Nutshell book available for free download http://www.kroah.com/lkn/
Description of Linux filesystem hierarchy http://www.pathname.com/fhs/

Now onto the howto….

LAMP stands for Linux, Apache, MySQL, and PHP/Python/Perl. A couple of easy ways to get a LAMP server running is the SLAMPP LiveCD or Ubuntu Server. Those are good if you are ok running the default configurations. I am a web developer and I have a need to have things running with special configurations. So instead of using apt-get or yum or whatever package manager to install 20 packages to get the functionality I desire, I would rather just install them from source. So in this article I will talk about configuring and installing Apache and PHP. In the future I may go over MySQL as well.

To get started I am using Ubuntu 6.06 as the base. But this will work with any linux if you have the prerequisites. For starters Ubuntu does not come with the tool necessary to compile software. The easiest way to get these is to do

sudo apt-get install gcc g++ make flex

PHP will also require you to have libxml2 installed you can do this manually or with apt. The package you need with apt is libxml2-dev. That gets you the necessary header files that PHP uses to compile XML support. Also if you want MySQL integrated with this you will need to have it pre-installed. The Ubuntu packages are mysql-server and libmysqlclient15-dev.

OK now we have some of the dependencies out of the way. If your unsure how to compile for source please read this.

Lets start with apache. You can obtain the Apache server from here. This guide will go over version 2.0 but 2.2 should work just as well. The standard ./configure, make, make install will get you the default instillation of apache. This means that it will put everything under /usr/local/apache2 The folder it contains are as follows.


bin –Where the binaries are
build –Tools for build modules
cgi-bin –Location of PERL CGI scripts
conf –The conf files
error –Pages that are displayed when an error happens. eg 404
htdocs –Where all your website files go
icons –Icons used by apache when it create directory listing pages
include –Apache's header files
lib –Library files
logs –Where it keeps its logs
man –The manual pages
manual –The apache 2.0 manual
modules –where any modules are kept

Now I don’t like this layout. I think that your site files should be kept in either /var or /srv and the conf files should be in /etc and the logs should be in /var/log

One way to get a better layout is by some configure flags.

./configure --prefix=/usr/local/apache --datadir=/srv/www –sysconfdir=/etc/httpd --mandir=/usr/local/man

This is good but you would still have to move the location of the log files in the httpd.conf file. Apache makes use of a file called config.layout This file contains several layout variations to choose from or you could create your own. If you wanted you could also choose a layout that is close to what you want and then use some other flags to make a few changes. I figure if I’m going to compile Apache every time a new version comes out I might as well just write a layout out for myself. My layout looks as follows.


<Layout Kevin>
   prefix: /usr/local/apache
   exec_prefix: ${prefix}
   bindir: ${exec_prefix}/bin
   sbindir: ${exec_prefix}/bin
   libdir: ${exec_prefix}/lib
   libexecdir: ${exec_prefix}/modules
   mandir: /usr/local/man
   sysconfdir: /etc/httpd
   datadir: /srv/www
   installbuilddir: ${datadir}/build
   errordir: ${datadir}/error
   iconsdir: ${datadir}/icons
   htdocsdir: ${datadir}/htdocs
   manualdir: ${datadir}/manual
   cgidir: ${datadir}/cgi-bin
   includedir: ${prefix}/include
   localstatedir: /var/log
   runtimedir: /var/run
   logfiledir: ${localstatedir}/apache
   proxycachedir: ${localstatedir}/proxy
</Layout>

The choice is really up to you on where you put everything. Thats the great part about compiling from source. To use a layout you would use the flag –enable-layout=[NAME]

One last note before I finish up talking about configuration, Apache has a few different MPMs (Multi-Processing Modules). These control the way in which Apache handles its connections. You can read about the different ones here. But PHP says that it runs its best with the prefork MPM. So to enable this we use –with-mpm=prefork

At this point you should have decided what configure flags you would like to use. There are other that I haven’t talked about that you may want, read the provided documentation to see if there is anything else you want. And then we can do the make and make install to install Apache.

Configuration

Now I will talk about some settings in the httpd.conf and setting up things like log rotation and init scripts.

In the httpd.conf file is where you set your various configuration on how apache should run. The default should be fine but if you want to make some changes you can. Some config options of note are:


Listen 80 --This sets the port on which Apache operates. Another popular choice is 8080
User/Group --You can set the user and group Apache runs as with the User and Group options, by default its User nobody and Group -1
ServerAdmin --This is the email address that will be shown when errors are generated.
DocumentRoot sets the path to the website files. “/srv/www/html” in my setup, “/usr/local/apache2/htdocs” in the defaul setup.
ServerTokens and ServerSignature specify how much in will be given out about Apache. Such things as what version Apache is and what modules you are running.

The other configuration options are well documented in the httpd.conf file so give it a read if your curious about other things.

So now you have Apache installed how do you start it? As root run “apachectl start” depending on where you put the apache bin files this may or may not be in your path. apachectl takes the following commands: start,stop,restart,graceful,startssl,and configtest. This is nice but we want to have Apache start itself when the system starts. For this we use an init script. Depending on what Linux systemyou use, your init scripts may be different. But Ubuntu 6.06 uses the SysV init style. The apachectl program is made to act like a init script, so you can like directly to it for your init. So in /etc/init.d create a link to the apachectl program.


cd /etc/init.d
ln -s /usr/local/apache/bin/apachectl httpd

Then put the link to start it on system bot in the proper runlevel folder. By default Ubuntu boots to runlevel 2.


cd /etc/rc2.d
ln -s ../init.d/httpd S80httpd

Change the number depending on when in the sequence you want it to start. Also add a link in the rc0.d and rc6.d folders with a K instead of an S to stop Apache on system shutdowns and reboots.

Finally for Apache we’ll talk about log rotation. There are two ways to do log rotation with Apache. The first is the rotatelog script that comes with Apache. To use it you put something like the following in your httpd.conf file.

TransferLog “| /path/to/rotatelogs logfile rotation_time_in_seconds”

The other option is to use logrotate. Logrotate is a fairly common system utility designed to handle the log rotation for many program. It is run once a day by cron. To use it all you have to do is drop a config file for the logs you want to rotate into /etc/logrotate.d An example config is as follows


/var/log/apache/access_log {
   missingok
   compress
   rotate 5
   #mail webmaster@yourdomain.com
   size 10M

   postrotate
      /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
   endscript
}

The script says to take the log file found at /var/log/apache/access_log.
missingok says if its not there don’t issue an error.
compress compresses the old files using gzip
rotate 5 says to rotate the logs 5 time before deleting. So you end up with access_log,access_log.1,access_log.2,etc
mail email@address makes it so logrotate will email you the log files instead of deleting them
size 10M will cause the log to be rotated only when it has become larger than 10 megs
And that part after postrotate causes Apache to restart so it will start writing to a new log file.

Read the man page for logrotate to see some more of its options.

Thats it for Apache. Stay tuned for part 2 where I’ll go over the installation of PHP.

Installing software from source

Posted in Howto, Meeting Report by Kevin on the January 22nd, 2007

Installing software from source is a fairly simply process once you learn the proper commands. Most software is compiled with a simple

./configure
make
make install

Only the last one needs to be run as root (provided your installing it in the normal system location). A lot of sofware can take flags on the

./configure
command to change the way the software is configured. A standard one is
--prefix=[PATH]
to change the location the software is installed into. To find out what flags are available for a particular piece of software you can run
./configure --help
Also always read the INSATLL and README files that come with the software and any documentation that is available.

Dec 14th Mettin Report: Xen

Posted in Meeting Report by Kevin on the January 5th, 2007

My apologies for the lateness of this post. I meant to post it shortly after the presentation but got swept up with the holidays…

Monte Wingle gave a great presentation on Xen. Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. Basically it allows you to run two operating systems at the same time. With the right kind of hardware it is possible to run Linux and Windows side-by-side.

Here are some links to help get you started on playing with Xen your self.

Official home page at University of Cambridge: http://www.cl.cam.ac.uk/research/srg/netos/xen/

Download Xen source and binaries: http://www.xensource.com/

Installing Xen on Ubuntu 6.06 – http://www.howtoforge.com/xen_3.0_ubuntu_dapper_drake

Xen on Fedora Core 6 Quickstart - http://fedoraproject.org/wiki/FedoraXenQuickstartFC6

Give it a try and hit up #oalug on freenode.net for help.

Dec 2, 2006 Meeting Report

Posted in Meeting Report by Aaron on the December 5th, 2006

The IRC meeting logs can be found here.

In the long run, this meeting was short, but productive. Many topics were covered, planned and executed. Here are a few of the topics covered:

  • Creating an OALUG Constitution using a wiki hosted under http://wiki.oalug.com.
  • Benefits of being an “official member” of OALUG.
  • Dec 14th Meeting: Xen Virtualization.
  • Planning the PHP Workshop in January.

A Constitution is already in the works, and can be found at http://wiki.oalug.com/constitution. We encourage everyone to register an account, and get active it the process of creating it. This affects you as a member of the group, so you should be involved if you want to see certain aspects of the group realized. See other topics on the main wiki page.

I’d like to thank Monte Wingle for stepping up to the plate for the Meeting on the 14th. Xen Virtualization is a good topic- one that you won’t want to miss. With more and more hardware manufacturers getting on the virtualization bandwagon, this is a skill that you will want to keep with you.

Stay tuned on the mailing list for the details of the PHP Workshop on January 27th. It will be a great success, and I’m looking forward to working with everyone who will be involved. Already, we are in the talks of having a Ruby Workshop for February that will build on the success of the PHP Workshop.

Nov 18th Meeting Report: Linux Games

Posted in Meeting Report by Kevin on the November 22nd, 2006

Tristan gave a great overview of some awesome linux games. Gaming has really come far on linux. Below is a list of the games presented. If you know a good one thats not on this list leave a comment.

Turn-based Strategy
Battle for Wesnoth - http://www.wesnoth.org/
UFO: Alien Invasion - http://ufo.myexp.de/

Guitar Hero clone
Frets on Fire - http://louhi.kempele.fi/~skyostil/uv/fretsonfire/

Real Time Strategy Shooter
SAVAGE: The Battle for Newerth - http://www.s2games.com/savage/ (Not open source)

Scrolling Space Shooter
AstroMenace - http://www.viewizard.com/astromenace/index_linux.php (Not open source)

First-person shooter
True-Combat Elite (requires Enemy territory) - http://www.truecombatelite.net/
AlienArena 2007 - http://red.planetarena.org/
Warsow - http://www.warsow.net/
Sauerbraten - http://sauerbraten.org/
Nexuiz - http://www.alientrap.org/nexuiz/

MMORPG
Planeshift - http://www.planeshift.it/

Rally Car racing
Trigger - http://www.positro.net/trigger/

Role Playing Game
Hero of Allacrost - http://www.allacrost.org/