["?WebServer"]


Apache Web Server

Excellent articles for beginners on Apache configuration:

You can also search the below Apache forum for debian-related questions. If you could not find an answer, you can drill into the appropriate sub forum and post your question there. The post will be forwarded to the appropriate Apache mailing list, and hopefully someone will reply.


?DebianApache packages come configured to run as user 'www-data'. This is potentially confusing: files to be served by apache should not be owned by 'www-data', as apache should not normally be allowed to modify them (i.e. as long as you're not running a wiki).


The http://builder.cnet.com link above does work, but it's not exactly informative about the Debian way of doing things. For Debian, you need first to ensure your /etc/apt/sources.list correctly describes your system. Then start with one of "apt-get update" or "aptitude update", then "apt-cache search apache || less". This will list all the ["apache"] related software available in the Debian repositories. For a newbie, this is where the confusion begins. There's "apache" along with all its related packages (-doc, -dev, -common, -perl, ...) and there's "apache2" and its related packages. In "Sarge" (12Jan2005 Debian testing), there's also "apache2-mpm-perchild" along with its related "-prefork", "-threadpool", and "-worker".

Once you've figured out which packages you need to install, one or the other of "apt-get install apache apachetop ..." or "aptitude install apache apachetop ..." will bring them down and start setting them up. If you're adventurous, you could even install and build them from source. Newbiedoc would be a good place to go for information on how to do this.

In my case, I'm trying to get [http://www.raxnet.net/ Cacti] working to display Cisco [http://www.cisco.com/warp/public/732/Tech/nmp/netflow/index.shtml NetFlow] data. I know this relies on [["PHP4"] http://www.php.net/], so I'm going to have to hunt around for that too.

I'll come back when I'm done and update this with what I find out.


I'm back. :-)

It works. :->

So, I did "aptitude install cacti" and that grabbed a whole pile of things. I later decided to go with apache-ssl, so had to grab that on its own. Do I need both apache and apache-ssl running to make cacti work? No. "/etc/init.d/apache stop"

Now you need to futz with "dpkg-reconfigure blah" where "blah" == cacti, apache-ssl, mod-php4, & etc.

You may even need to hammer ?"MySQL" passwords into place. You may need to "adduser" a cacti userid.

I opted to go with cacti-cactid, which is (apparently) immune to a bug that locks up cactid (?). [I really ought to script sessions like this. Thank ${DEITY} that "history" is there.]

A few choice tid-bits:

aptitude install cacti-cactid

dpkg-reconfigure -plow cacti

dpkg --configure cacti-cactid

less /etc/php4/apache/php.ini

cd /usr/share/doc/cacti

w3m html/index.html

less README

less README.Debian

dpkg-reconfigure php4-mysql

[more to come]

Note that the install creates the ["MySQL"] tables, so you don't need to use the cacti.sql.gz mentioned in /usr/share/doc/cacti to create them yourself.

dpkg-reconfigure apache-ssl

Sigh.

I imagine the real trick to this procedure is to notice /etc/cacti/apache.conf

That needs to be stuffed into /etc/apache-ssl/httpd.conf, and any php-ish stuff in there needs to be uncommented.

  ---------------------  snip  --------------------------

<?IfModule mod_alias.c>

    Alias ''icons'' /usr/share/apache/icons/

    <Directory /usr/share/apache/icons>
         Options Indexes MultiViews
         AllowOverride None
         Order allow,deny
         Allow from all
    </Directory>

    Alias ''images'' /usr/share/images/

    <Directory /usr/share/images>
         Options MultiViews
         AllowOverride None
         Order allow,deny
         Allow from all
    </Directory>
    Alias /cacti /usr/share/cacti

    <DirectoryMatch /usr/share/cacti/>
        Options +FollowSymLinks
        AllowOverride None
        order allow,deny
        allow from all
        <IfModule mod_php4.c>
            AddType application/x-httpd-php .php

            php_flag magic_quotes_gpc Off
            php_flag short_open_tag Off
            php_flag register_globals On
            php_flag register_argc_argv On
            php_flag track_vars On
            php_value include_path .
            php_value display_errors Off
            DirectoryIndex index.php
        </IfModule>
    </DirectoryMatch>

<?/IfModule>

  ---------------------  snip  --------------------------

You may need to "chown -R cacti:cacti /var/www/cacti"

What a mess. It does work, but it's a huge tool set with many interlocking parts, lots of security related issues, and beta grade software. If you need help, mail me at keeling @ spots.ab.ca and I'll dive into my config for details.

At the end of it all, you should be able to point a browser at:

    https://your.servers.address/cacti

and see a cacti login screen. *IT WILL IMMEDIATELY DEMAND THAT YOU CHANGE YOUR PASSWORD*.

You can't imagine how happy my boss is seeing that this is working. :-) Free software is going to give his users access to their traffic accounting, and it's going to tell him how much to charge them, based on their usage. Woohoo!