One of the most powerful and functional software combinations for the web today is Apache and PHP combined with a database. For my purposes, Apache, PHP and MSQL are the way to go (see MySQL notes below.) And of course all of this software is not only stable and great, its FREE (check licenses, of course, MSQL is not free for commercial use.)Besides being the best webserver there is, Apache has much more capability than simply serving your HTML. Many modules are available from Apache including proxy, env, authentication and more. Besides using Apache mods that are built by Apache other vendors have recognized the acceptance and performance of Apache and have created products specifically for use with Apache. My favorite and a great web tool is PHP. PHP is an HTML embedded scripting language that is VERY powerful and quite easy to use (much better than ASP, JSP people will argue, but no contest with ASP.) With a rockin webserver and scripting language, you want a backend database, right? Of course, thats where MSQL comes in (there are others, such as MySQL which is purportedly better and truly Open Source, but most of my experience is with MSQL, so for the purposes of this HOWTO, I will stick with that.) The combo of Apache + PHP + MSQL is unstoppable for building killer web sites and apps (for example, Screaming-Penguin.)Besides wanting Apache to use the PHP modules and PHP to work with MSQL, I also require Apache to be my home proxy server, so I include that here as well. Apache is actually a quite good proxy server and is very configurable. HOWTO:Prerequisites: This HOWTO assumes you have Linux on X86 and is intended for use with RedHat (but should be easily used with other distros as well.)Start by obtaining Apache, PHP and MSQL via the above links. Put the tar files all in the same directory (I prefer /opt for new installs so I will use that for my examples.) Then unpack em, all three. (tar -xvzf package_name)First install your database, in this case MSQL
change to the distro directory cd /opt/msql_x/ and then
make install
then change to the target dir for your distro cd target/Linux_x
run the setup from the target dir ./setup
then make all
then make install
then change to the default MSQL dir cd /usr/local/Hughes and edit the msql.conf file to your liking (I use the defaults)
then create the user msql adduser msql
then change ownership to msql user chown -R msql /usr/local/Hughes
thats it! I recommend you add the /usr/local/Hughes/bin to your path, but thats optional
start the server with the msql2d daemon command from the bin dir (and add it to your startup scripts if desired.)Done with MSQL installation, for usage instruction check the included documentation, its quite good (even pretty easy for non SQL people.)Next Install PHP
from the distro root /opt cd /apache_x
then initial configure Apache ./configure --prefix=/www
then cd to the PHP dir cd ../php* and configure it
./configure --with-msql --with-apache=../apache_x --enable-track-vars
then make and subsequently make installDone deal for PHP, thats it.Nexy install and configure Apache (with all of these options)
first change to the apache dir cd ../apache_x
then configure with options
./configure --prefix=/www -enable-module=proxy --enable-shared=proxy --activate-module=src/modules/php/libphp3.a
then make and subsequently make install
I recommend that you add the Apache bin dir to your path also, and of course, add it to startups scripts as well if desired.Thats does it for Apache too, all set, you should now have Apache installed in the /www directory with PHP (with MSQL) and proxy support.Then configure Apache by modifying the httpd.conf file to your liking. Its located in /www/conf and the new apache uses this file for all options (forget srm and access.) Make sure to enable the Addmodule PHP sections of the default by simply un-remming them and do the same (un-rem) for the proxy options you want (you must allow proxy, and be careful, all hosts are denied access by default, you must configure what you need.)Test the new stuff, Apache, PHP, MSQL and ProxyOnce configured you can start and stop Apache with the newer apachectl start and apachectl stop commands respectively. Test it by simply firing up your browser and plugging in your machines hostname or IP address. You should get the default Apache "it worked" page.Make a sample PHP file to test PHP. Create a text file with only the line ?phpinfo()? (with the PHP brackets also, of course.) Then hit this file in your url (whatever you named it, phptest.php3 for example.) You, obviously, must hit it via the webserver, so put in the full URL - http://ipaddress/phptest.php3. It should display all the PHP info and verify that your PHP works.Then make sure your proxy server is connected to the Internet and test a client by configuring a browser to point to it (again, make sure you allowed access after install by modifying the httpd.conf properly.) Once a client is configured, and the proxy server is Internet connected, simply surf to test.Now you are really ready to go, use the msqldmin program to create an MSQL database and get rolling with PHP and MSQL on your new Apache webserver. For further MSQL stuff, see the documentation or the site (beyond the scope if this doc.)For more details or troubleshooting, check the included doumentation or the respective vendors website documentation. For some sample database MSQL stuff, check the Hughes site and for PHP check not only PHP.net but also PHPbuilder.com. Armed with that info and that software, you can create killer web sites and apps and utilize the amazing functionality of PHP.
Chatter
16 hours 51 min ago
1 week 1 day ago
1 week 2 days ago
1 week 3 days ago
1 week 5 days ago
2 weeks 15 hours ago
2 weeks 15 hours ago
2 weeks 1 day ago
2 weeks 1 day ago
2 weeks 1 day ago