Monday, February 13, 2012

Setting up Joomla! as a test website

Joomla! has quite a lot of sample data that is useful for HTTP stress-testing. It provides a variety of resources that can be parsed and retrieved by the http_bot of botloader. Setup is easy, but I thought I'd put it on record so people can follow the installation quickly.

  1. On Ubuntu and other versions of Linux you'll need to install Mysql, php5 and apache2. To get the php to work you'll need the apache php module (libapache2-mod-php5). For the mysql you'll need to install both the server and client. When you install mysql server it asks for a user name and password. Use "root" and give any password, but remember it, because you'll need it later.
  2. Now download Joomla!. Unzip the files and rename the directory to "joomla". Now copy the joomla directory to /var/www or wherever your web-root is located:
    cp -r joomla /var/www
    Now make sure that the installer can modify the joomla directory. cd into /var/www and type:
    sudo chown -R www-data joomla
    At least on Ubuntu 'www-data' is the name of the user who is running apache. Or you can use chmod -R +w joomla if you prefer, but that's a lot less secure, though it doesn't matter on a local testbed.
  3. Now edit index.html, which you'll find in /var/www, and add a line somewhere in the body of the HTML:
    <p>Why not visit our wonderful <a href="/joomla/">Joomla! site</a>?</p>
    This provides a link into the main sample data which http_bot will follow when attacking the site. Otherwise it will only find index.html, and keep downloading that - pretty ineffective. So this step is important
  4. Now run the Joomla! installer. It's located at http://localhost/joomla/. Click through the pages, making sure that it detects Mysql.
    • If it says that the installation directory is unwritable, try the chmod -R +w joomla command from /var/www.
    • If it says that mysql is undetectable you need to install something - check that you have the mysql plugin for Apache.
    • When it asks for the mysql username and password give the ones you specified above in step 1.
    • When it asks if you want to install sample data, say YES.
    • For the rest, just follow the suggested options
  5. Now test the installation. Navigate to http://localhost, click on the link you created earlier and make sure that the website is all working. If it says "downloading" when you access a php page, you must have failed to install php5 correctly.

No comments:

Post a Comment