(Note: every use of "example.com" in the following steps should be replaced by your desired hostname. This should be obvious, but sometimes it's not.)
Step 1: Install Apache2, MySQL
This is the easiest part, run: "sudo apt-get install apache2 mysql-server"
. This is not an Apache2 or MySQL tutorial though, so get that configured the way you like to and move on to the next step. Make sure you get and remember the administration password for mysql because you'll need that later. Hint: If you do forget (shame on you), you can always check /etc/mysql/debian.cnf
and reset the password based on what is in there.
Step 2: Prepare our build environment
Lots of people have different ways to build, if you don't have one already just follow these instructions.
run:
sudo mkdir -p /usr/local/src/
sudo chown `whoami` /usr/local/src/
sudo mkdir -p /var/www/example.com
sudo chown `whoami` /var/www/example.com
The "normal" installation grabs source from CPAN and compiles the modules for you, which can sometimes be a frustrating for installing scoop. Since you're using Debian though, you don't have to as most of what you need is conveniently available in precompiled package form.
run:
"sudo apt get install build-essential libcrypt-cbc-perl libcrypt-rijndael-perl wwwconfig-common libdbi-perl libdata-showtable-perl libmd5-perl libterm-readkey-perl libdbd-mysql-perl libapache-dbi-perl libapache-mod-perl libclass-singleton-perl libcrypt-unixcrypt-perl libcrypt-blowfish-perl libmail-sendmail-perl libstring-random-perl libtime-modules-perl libimage-size-perl liburi-perl libhtml-tagset-perl libhtml-parser-perl libwww-perl libxml-parser-perl libxml-rss-perl libextutils-xsbuilder-perl libapache2-mod-perl2-dev apache2-dev wget checkinstall cvs apt-file"
It's a mouthful, but it should install everything you need in my experience. If I missed something, please let me know in a comment and I'll try to get an admin to edit the article accordingly.
Step 3: Install Apache2::Request
Unfortunately as of this time Debian has yet to package Apache2::Request, which we need to run scoop on Apache2. So we'll download and compile that now:
as a normal user account, run:
cd /usr/local/src
wget http://apache.oregonstate.edu/httpd/libapreq/libapreq2-2.07.tar.gz
tar xzvf libapreq2-2.07.tar.gz
cd libapreq2-2.07
./configure --with-apache2-apxs=`which apxs2` --enable-perl-glue
make
sudo checkinstall --nodoc
(follow checkinstall instructions, defaults are ok)
Step 4: Grab Scoop from CVS
run:
cd /usr/local/src
cvs -d:pserver:anonymous@scoop.versionhost.com:/cvs/scoop login
(password: 'anonymous')
cvs -z3 -d:pserver:anonymous@scoop.versionhost.com:/cvs/scoop co scoop
Step 5: Configure Scoop
run:
cd /usr/local/src/scoop
scripts/install.pl
(yes to continue)
(yes to continue)
(enter to default path suggestion)
(yes to configure database)
(follow the steps to configure your database according to your local settings)
(enter to default apache server suggestion)
(enter to default mysql server suggestion)
(enter to default mysql port suggestion)
(1 to create a new database)
(your preferred database name goes here)
(enter to default DB Dump)
(follow the instructions to set your URL path)
(your preferred scoop administration account name, password, email address)
(No to configure apache)
cp -r /usr/local/src/scoop/html/* /var/www/example.com
Step 6: Configure and install Apache2/Scoop file
The process to configure apache we declined in Step 5 is something we have to do manually now. In your favourite text editor, paste the following text:
NameVirtualHost *
<VirtualHost *>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com
UserDir disabled
PerlModule mod_perl2
PerlModule Bundle::Apache2
<Perl>
use lib qw( /usr/local/src/scoop/lib );
require "/usr/local/src/scoop/etc/startup.pl";
$Location{"/"} = {
SetHandler => "perl-script",
PerlHandler => "Scoop::ApacheHandler",
Options => "ExecCGI",
};
</Perl>
PerlSetVar DBType mySQL
PerlSetVar mysql_version 3.23
PerlSetVar db_name example #your database name, usually "scoop"
PerlSetVar db_host localhost
PerlSetVar db_user example #your mysql username, usually "scoop"
PerlSetVar db_pass example #your mysql password
PerlSetVar cookie_host .example.com #notice the preceding dot, it's important
PerlSetVar SMTP localhost
PerlSetVar site_id myscoopsite
PerlSetVar site_key 94abb6d940dc52d6a6409f30038d8c5ca59493e2c5544d95d74342bb #needs to be unique
PerlSetVar dbdown_page /pages/dbdown.html
PerlRequire /usr/local/src/scoop/etc/startup.pl
# If you're running scoop in a subdirectory, what you answered in (enter to default path suggestion) in step 5, the following <Location> tags need to be be updated as well.
<Location />
SetHandler perl-script
PerlHandler Scoop::ApacheHandler
</Location>
<Location /images>
SetHandler default-handler
</Location>
<Location /pages>
SetHandler default-handler
</Location>
<Location ~ "^/(robots.txt|favicon.ico)$">
SetHandler default-handler
</Location>
</VirtualHost>
Whew. Now save/upload that to /etc/apache2/sites-available/example.com and run:
"sudo ln -s /etc/apache2/sites-available/example.com /etc/apache2/sites-enabled/example.com"
Step 7: Patch Scoop for Apache2
Now you're going to need to patch your scoop files to run on Apache2 instead of the Apache1 that scoop expects. I've done the work already and created a patch against the current scoop cvs, but if you don't trust me I explain what needs to be done in a postscript and you can re-write it yourself.
run:
cd /usr/local/scoop/
wget http://www.ryanthiessen.com/uploads/ryanthiessen-apache2-c.diff
patch -p0 < ryanthiessen-apache2-c.diff
Step 8: restart Apache2
run:
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start
That's it! You should be up and running with scoop on Apache2 now. Please let me know if these instructions fail in any way, and I'll try to update them accordingly.
Notes:
This HOWTO suggests that you do certain things that other people have different ideas about and some administrators do things different ways. I suggest using "sudo command" instead of "su root; command" and so adjust your system accordingly. I also use "checkinstall" instead of "make install", but again that's a judgement call so if you know what you're doing and prefer that just substitute that and it's ok. I suggest "/usr/local/src" as your compile directory, but if you have another one that is fine. I suggest you place your html files (Apache2 DocumentRoot) at /var/www/example.com but if you've got another scheme already use that instead and adjust accordingly.
Finally, these were all tested on Ubuntu, but any debian or debian-derived distribution should work the same.
Troubleshooting:
If the Apache log tells you that you are missing a file "Example::Example.pm", try running "sudo apt-file update; apt-file search Example/Example.pm" and see what package that file exists in and then install the appropriate package with apt-get.
If you're having trouble installing libapreq2, it's possible that a build tool is required that I didn't mention in the prerequisites.
If you're having trouble with checkinstall, just use "make install" instead. checkinstall is just a front-end that creates a .deb package so you can easily remove it later, but it's not required.
This is a kludge, hopefully there will be a smoother way to install scoop on apache2 using default installation procedures. Until that time though, I hope this guide is helpful to those who need it.
PS: Scoop Patch explanation
(this is only for people who want to know what the patch does:)
As you can see, there were some minor changes to startup.pl that I
could not track down: I could not figure out how that was supposed to
work with mod_perl2 and so I just commented it out.
The biggest change follows in the different from the way that
Apache::Request and Apache2::Request work. Unlike the older version,
Apache2::Request needs the object directly from the handler to
construct the request object that scoop needs. But once it does in
ApacheHandler and Scoop it handles fine.
The majority of the patch is adjusting for that change in variable
passing and in simply renaming from apache::request to
apache2::request.
And finally, I have to note that I have not yet tested file uploads
but they will most likely not work at all but will be pretty trivial
to rewrite for apache2::Request if need be.