Kira's Simple Blog Code from CGI Programming 201 (http://www.cgi101.com/advanced) ----------------------------------------------------------------- Legal Stuff Written and copyright 2002 by Jacqueline D. Hamilton (kira@cgi101.com) You may use this code on your own website, however you may not publish or sell any copy or derivative work without permission of the author. If you didn't download this code from cgi101.com, please send mail to kira@cgi101.com with the URL of the site you downloaded it from. The author makes no expressed or implied warranty of any kind, and assumes no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising from the use of this software. This code is unsupported. If you have problems, buy the book, and/or visit our discussion board at http://www.cgi101.com/discuss/ for help. ----------------------------------------------------------------- Requirements You will need Perl, Unix, MySQL, and the Perl modules DBI.pm, CGI.pm, and HTML::TagFilter (all downloadable from http://search.cpan.org). If you aren't sure if these are already installed on your system, try doing 'perldoc modulename' to find out (e.g. 'perldoc HTML::TagFilter'). ----------------------------------------------------------------- Installing the blog 1. Be sure to chmod 755 all of the cgi programs. 2. Create a new MySQL database for your blog: mysqladmin -p create blogname 3. Edit the MySQL privileges (or have your sysadmin do this) to create a new blog user: mysql -p mysql insert into user(Host, User, Password) values ("localhost", "bloguser", password("blogpassword"); insert into db values("localhost", "blogname", "bloguser", "Y","Y","Y","Y","Y","Y","Y","Y","Y","Y"); flush privileges; quit 4. Create the MySQL tables by loading the enclosed sql file: mysql -u bloguser -p blogname < blogdbs.sql 5. Edit the configuration stuff below. ----------------------------------------------------------------- Customizing the blog code for your own site: 1. Edit MyBoard.pm and change the values for the configurable stuff - database name, db username and password, URL for your blog, and the name ($btitle) of your blog. If you want to change the look of your blog (page colors, background etc), you can also modify the do_header and do_footer subroutines. 2. cd to the admin directory. Edit .htaccess and change the path of AuthUserFile from /home/www/advanced/forums/admin/.htpasswd to whatever your actual admin path is. 3. create a .htpasswd file in the admin directory: htpasswd -c .htpasswd yourusername Now your blog should be ready to go. Visit the admin area with your web browser to add a new blog entry. See http://www.cgi101.com/advanced/blog.html for tweaks and additions for improving your blog.