{"id":4066,"date":"2013-09-09T05:10:43","date_gmt":"2013-09-08T19:10:43","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=4066"},"modified":"2024-11-27T06:19:39","modified_gmt":"2024-11-26T20:19:39","slug":"apache-web-on-mac-and-the-three-ps-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/apache-web-on-mac-and-the-three-ps-primer-tutorial\/","title":{"rendered":"Apache WebServer on Mac and The Three P&#039;s Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ThreePs\/Web_Three_Ps.png\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Apache WebServer on Mac and The Three P's Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ThreePs\/Web_Three_Ps.jpg\" title=\"Apache WebServer on Mac and The Three P's Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Apache WebServer on Mac and The Three P's Primer Tutorial<\/p><\/div>\n<p>Today&#8217;s tutorial shows a web scenario that utilizes The Three P&#8217;s with a local Apache web server (at ht<font color=black>tp<\/font>:\/\/localhost\/) on a Mac laptop (Mac OSX 10.7.5, Apache\/2.2.22 (Unix), mod_wsgi\/3.3, Python\/2.6.7, PHP\/5.3.15) opening up its Web Sharing arrangements, building on the previous <a title='Perl Form Validation Primer Tutorial' href='#pfvpt'>Perl Form Validation Primer Tutorial<\/a>.   Please note that any additional MAMP local WebServer can live with this arrangement as a separate local webserver on ht<font color=black>tp<\/font>:\/\/localhost:8888\/<\/p>\n<p>In our tutorial we use a PHP web page HTML form element to perform a dice guessing game via the use of a Python CGI application using the mod_wsgi.so Apache module which required some installation and configuration, for which the links below are of interest:<\/p>\n<ul>\n<li><a target=\"_blank\" title='mod_wsgi.so' href='http:\/\/code.google.com\/p\/modwsgi\/downloads\/detail?name=mod_wsgi-macosx106-ap22py26-3.3.so&#038;can=2&#038;q=' rel=\"noopener\">mod_wsgi.so<\/a><\/li>\n<li><a target=\"_blank\" title='mod_python problem' href='http:\/\/www.gossamer-threads.com\/lists\/python\/python\/219918' rel=\"noopener\">mod_python problem<\/a><\/li>\n<\/ul>\n<p>In the tutorial here, as for the referenced tutorial, we use Perl code to validate a PHP\/HTML form element&#8217;s input tag data using regular expressions, as described by <a target=\"_blank\" title='Regular expressions' href='http:\/\/en.wikipedia.org\/wiki\/Regular_expression' rel=\"noopener\">Wikipedia<\/a> below:<\/p>\n<blockquote>\n<p>In computing, a regular expression (abbreviated regex or regexp) is a sequence of text characters, some of which are understood to be metacharacters with symbolic meaning, and some of which have their literal meaning, that together can automatically identify textual material of a given pattern, or process a number of instances of it that can vary from a precise equality to a very general similarity of the pattern. The pattern sequence itself is an expression that is a statement in a language designed specifically to represent prescribed targets in the most concise and flexible way to direct the automation of text processing of general text files, specific textual forms, or of random input strings. A regular expression patterns a match to a string. It is employed in a search to identify text for further processing, such as displaying the match, or altering it; or it is employed to simply inform of the location or count. The concept arose in the 1950s, when Kleene formalized the description of a regular language, and came into common use with the Unix text processing utilities ed, an editor, and grep (global regular expression print), a filter.<\/p>\n<\/blockquote>\n<p>This Perl form validation client-side technique uses a GET method, but if you want to hide your data and use a POST method, you may need to do form validation from the server-side using  <a target=\"_blank\" title='Alternate Perl client-side Form Validation via GET method' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=1440' rel=\"noopener\">PHP<\/a> , for example.<\/p>\n<p>By the way the format of the telephone number asked for by this tutorial is for an Australian telephone number which is a 2 or 3 digit area code followed by an 8 digit number.   If you can&#8217;t get through maybe you can just listen to a <a target=\"_blank\" title=\"Ring, Ring, Why don't you give me a call\" href='http:\/\/www.youtube.com\/watch?v=-aRBqoZN9rA' rel=\"noopener\">song<\/a>.<\/p>\n<p>Download PHP source code and rename to <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/PHP\/ThreePs\/validateperlpython.php_GETME' rel=\"noopener\">validateperlpython.php<\/a><br \/>\nDownload Perl programming source code and rename to <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/PHP\/ThreePs\/validateperl.cgi_GETME' rel=\"noopener\">validateperl.cgi<\/a><br \/>\nDownload Python programming source code and rename to <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/PHP\/ThreePs\/index.wsgi_GETME' rel=\"noopener\">index.wsgi<\/a> (placed in a pythonplace subdirectory, perhaps)<br \/>\nDownload configuration file and rename to <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/PHP\/ThreePs\/htaccess_GETME' rel=\"noopener\">.htaccess<\/a> (for a pythonplace subdirectory, perhaps)<br \/>\nDownload Apache configuration file and rename to <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/PHP\/ThreePs\/httpd.conf_GETME' rel=\"noopener\">httpd.conf<\/a> (is the Apache configuration file for my Mac laptop environment, so yours could be similar but different (please use care))<\/p>\n<p>Regarding the form validation aspects to this  <a target=\"_blank\" title='click picture' href='http:\/\/www.rjmprogramming.com.au\/Perl\/Perl_Form_Validation.jpg' rel=\"noopener\">topic<\/a> I really like <em>&#8220;Perl and CGI for the World Wide Web&#8221; by Elizabeth Castro<\/em> <\/p>\n<p><!--p>Here is a link regarding <a target=\"_blank\" title='Perl form validation' href='http:\/\/www.unix.com\/shell-programming-scripting\/47005-form-validation-perl.html' rel=\"noopener\">Perl Form Validation<\/a>.<\/p-->\n<p>In researching the form validation aspects to this tutorial topic found the following two sites very useful &#8230; <a target=\"_blank\" title='Hidden fields' href='http:\/\/sislands.com\/coin70\/week7\/hiddenpls.htm' rel=\"noopener\">Hidden fields<\/a>, <a target=\"_blank\" title='Online Perl Interpreter and Debugging Tool' href='http:\/\/ideone.com\/nWGu7G' rel=\"noopener\">Online Perl Interpreter and Debugging Tool<\/a> &#8230; so, thanks.<\/p>\n<hr \/>\n<p id=\"pfvpt\">Previous <a target=\"_blank\" title='Perl Form Validation Primer Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=2227' rel=\"noopener\">Perl Form Validation Primer Tutorial<\/a> is shown blow.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/Perl\/Perl_Form_Validation.jpg\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"Perl Form Validation Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Perl\/Perl_Form_Validation.jpg\" title=\"Perl Form Validation Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Perl Form Validation Primer Tutorial<\/p><\/div>\n<p>In tutorial here we use Perl code to validate an HTML form element&#8217;s input tag data using regular expressions, as described by <a target=\"_blank\" title='Regular expressions' href='http:\/\/en.wikipedia.org\/wiki\/Regular_expression' rel=\"noopener\">Wikipedia<\/a> below:<\/p>\n<blockquote>\n<p>In computing, a regular expression (abbreviated regex or regexp) is a sequence of text characters, some of which are understood to be metacharacters with symbolic meaning, and some of which have their literal meaning, that together can automatically identify textual material of a given pattern, or process a number of instances of it that can vary from a precise equality to a very general similarity of the pattern. The pattern sequence itself is an expression that is a statement in a language designed specifically to represent prescribed targets in the most concise and flexible way to direct the automation of text processing of general text files, specific textual forms, or of random input strings. A regular expression patterns a match to a string. It is employed in a search to identify text for further processing, such as displaying the match, or altering it; or it is employed to simply inform of the location or count. The concept arose in the 1950s, when Kleene formalized the description of a regular language, and came into common use with the Unix text processing utilities ed, an editor, and grep (global regular expression print), a filter.<\/p>\n<\/blockquote>\n<p>This Perl form validation client-side technique uses a GET method, but if you want to hide your data and use a POST method, you may need to do form validation from the server-side using  <a target=\"_blank\" title='Alternate Perl client-side Form Validation via GET method' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=1440' rel=\"noopener\">PHP<\/a> , for example.<\/p>\n<p>By the way the format of the telephone number asked for by this tutorial is for an Australian telephone number which is a 2 or 3 digit area code followed by an 8 digit number.   If you can&#8217;t get through maybe you can just listen to a <a target=\"_blank\" title=\"Ring, Ring, Why don't you give me a call\" href='http:\/\/www.youtube.com\/watch?v=-aRBqoZN9rA' rel=\"noopener\">song<\/a>.<\/p>\n<p><a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/Perl\/validatepl.html_GETME' rel=\"noopener\">Download HTML source code and rename to validatepl.html<\/a><br \/>\n<a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/Perl\/validatepl.cgi_GETME' rel=\"noopener\">Download Perl programming source code and rename to validatepl.cgi<\/a><\/p>\n<p>Regarding this  <a target=\"_blank\" title='click picture' href='http:\/\/www.rjmprogramming.com.au\/Perl\/Perl_Form_Validation.jpg' rel=\"noopener\">topic<\/a> I really like <em>&#8220;Perl and CGI for the World Wide Web&#8221; by Elizabeth Castro<\/em> <\/p>\n<p><!--p>Here is a link regarding <a target=\"_blank\" title='Perl form validation' href='http:\/\/www.unix.com\/shell-programming-scripting\/47005-form-validation-perl.html' rel=\"noopener\">Perl Form Validation<\/a>.<\/p-->\n<p>In researching this tutorial topic found the following two sites very useful &#8230; <a target=\"_blank\" title='Hidden fields' href='http:\/\/sislands.com\/coin70\/week7\/hiddenpls.htm' rel=\"noopener\">Hidden fields<\/a>, <a target=\"_blank\" title='Online Perl Interpreter and Debugging Tool' href='http:\/\/ideone.com\/nWGu7G' rel=\"noopener\">Online Perl Interpreter and Debugging Tool<\/a> &#8230; so, thanks.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d2227' onclick='var dv=document.getElementById(\"d2227\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=Perl\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d2227' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d4066' onclick='var dv=document.getElementById(\"d4066\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=Perl\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d4066' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today&#8217;s tutorial shows a web scenario that utilizes The Three P&#8217;s with a local Apache web server (at http:\/\/localhost\/) on a Mac laptop (Mac OSX 10.7.5, Apache\/2.2.22 (Unix), mod_wsgi\/3.3, Python\/2.6.7, PHP\/5.3.15) opening up its Web Sharing arrangements, building on the &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/apache-web-on-mac-and-the-three-ps-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,33,37],"tags":[85,196,714,730,916,932,1013,1267,1319,1400,1411,1464],"class_list":["post-4066","post","type-post","status-publish","format-standard","hentry","category-elearning","category-software","category-tutorials","tag-apache","tag-cgi","tag-local-web-server","tag-mac-osx","tag-perl","tag-php","tag-pyton","tag-the-three-ps","tag-tutorial","tag-web","tag-web-server","tag-wsgi"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4066"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=4066"}],"version-history":[{"count":3,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4066\/revisions"}],"predecessor-version":[{"id":65759,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4066\/revisions\/65759"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=4066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=4066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=4066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}