Wednesday, June 13, 2012

How to start using php with the Hiawatha webserver (draft)

Step 1: Download Hiawatha by going to http://www.hiawatha-webserver.org/download and downloading the appropriate package such as the debian package at http://files.tuxhelp.org/hiawatha/.

Step 2: If you chose the debian package, run dpkg -i hiawatha*.deb from the command line.

Step 3: Go to Samiux's Almost Secure and Perfect Ubuntu Server blog post, "HOWTO : Highest secured Hiawatha Web Server (6.17.1) on Ubuntu 9.04 Server" at http://secure-ubuntu-server.blogspot.com/2009/10/howto-highest-secured-hiawatha-web.html and repeat step 1. Perhaps all of the packages are not needed, but okay.

Step 4: Construct a default website using HowTo: Defining Websites in on the hiawatha site (http://www.hiawatha-webserver.org/howto/websites). Use Hostname = 127.0.0.1.

Step 5: Uncomment "CGIhandler = /usr/bin/php5-cgi:php,php5" in hiawatha.conf in folder /etc/hiawatha.

Step 6: Uncomment the FastCGIserver block in hiawatha.conf

Step 7: Add "ExecuteCGI = yes" in the default website block in hiawatha.conf.

Step 8: In php-fcgi.conf uncomment: Server = /usr/bin/php5-cgi; 3 ; 127.0.0.1:2005 ; www-data ; /etc/php5/cgi/php.ini

Step 9: Uncomment www-data in hiawatha.conf ?

Step 10: create index.php in /var/www/dummy by typing sudo touch index.php. Make sure that index.php is executable using chmod?

Step 11: Follow the instructions in php-configuration on the hiawatha webserver site (http://www.hiawatha-webserver.org/howto/php_configuration). php.ini should be in the folder: /etc/php5/cgi/php.ini.

Step 12: Run php-fcgi with the kill (-k) option

Step 13: Run php-fcgi with no options to restart the cgi daemons

Step 14: Stop hiawatha with "/etc/init.d/hiawatha stop" from the command line.

Step 15: Start hiawatha with "/etc/init.d/hiawatha start from the command line.

Step 16: Modify index.php in the /var/www/dummy folder by placing the following:

Step 17: If there is a printout at localhost/index.php in the webbrowser, things should be working.

No comments:

Post a Comment