tf23's Friends' Journals tf23's Friends' Slashcode Journals en-us Copyright 2004, OSTG - Open Source Technology Group, Inc. All Rights Reserved. 2012-01-25T03:25:51+00:00 Me Technology hourly 1 1970-01-01T00:00+00:00 tf23's Friends' Journals PHP with Apache and Mod Perl For others and so I have a log myself here's how I got PHP to work with mod_perl and apache:<br> <br> Here are the versions of software I used:<blockquote><div><p>Apache 1.3.27<br> Mod Perl 1.27<br> PHP 4.3.0</p></div> </blockquote><p> The following needs to be done first so PHP's<nobr> <wbr></nobr>./configure doesn't complain:<br> In Apache directory:</p><blockquote><div><p>./configure --prefix=<b>&lt;path to apache install&gt;</b> --activate-module=src/modules/php4/libphp4.a --activate-module=src/modules/perl/libperl.a</p></div> </blockquote><p> In PHP directory:</p><blockquote><div><p>./configure --with-mysql=<b>&lt;path to mysql install&gt;</b> --with-apache=<b>&lt;path to apache root source&gt;</b> --enable-track-vars<br><nobr> <wbr></nobr>./make<br><nobr> <wbr></nobr>./make install</p></div> </blockquote><p> In mod_perl directory:<br> Edit the Makefile.PL file and look for the line (was line number 1029 for me) that has the following:</p><blockquote><div><p>$cmd<nobr> <wbr></nobr>.= "./configure " . "--activate-module=src/modules/perl/libperl.a";</p></div> </blockquote><p> Add this to the end of the quotes (but before the semi-colon):</p><blockquote><div><p> . " --activate-module=src/modules/php4/libphp4.a"</p></div> </blockquote><p> Save this file and now run this:</p><blockquote><div><p>perl Makefile.PL APACHE_SRC=<b>&lt;path to apache root source&gt;</b> DO_HTTPD=1 USE_APACI=1 PERL_MARK_WHERE=1 EVERYTHING=1 APACHE_PREFIX=<b>&lt;path to apache install&gt;</b></p></div> </blockquote><p> The output of the perl command should be something like this:</p><blockquote><div><p>Will configure via APACI<br> cp apaci/Makefile.libdir<nobr> <wbr></nobr>../apache_1.3.27/src/modules/perl/Makefile.libdir<nobr> <wbr></nobr> <br> cp apaci/Makefile.tmpl<nobr> <wbr></nobr>../apache_1.3.27/src/modules/perl/Makefile.tmpl<br> cp apaci/README<nobr> <wbr></nobr>../apache_1.3.27/src/modules/perl/README<br> cp apaci/configure<nobr> <wbr></nobr>../apache_1.3.27/src/modules/perl/configure<br> cp apaci/libperl.module<nobr> <wbr></nobr>../apache_1.3.27/src/modules/perl/libperl.module <br><nobr> <wbr></nobr> cp apaci/<nobr> <wbr></nobr>../apache_1.3.27/src/modules/perl/mod_perl.config<nobr>.<wbr></nobr> sh<br> cp apaci/<nobr> <wbr></nobr>../apache_1.3.27/src/modules/perl/<nobr> <wbr></nobr> <br> cp apaci/find_source<nobr> <wbr></nobr>../apache_1.3.27/src/modules/perl/find_source<br> cp apaci/apxs_cflags<nobr> <wbr></nobr>../apache_1.3.27/src/modules/perl/apxs_cflags<br> cp apaci/perl_config<nobr> <wbr></nobr>../apache_1.3.27/src/modules/perl/perl_config<br> cp apaci/mod_perl.exp<nobr> <wbr></nobr>../apache_1.3.27/src/modules/perl/mod_perl.exp<br> PerlDispatchHandler.........enabled<br> PerlChildInitHandler........enabled<br> PerlChildExitHandler........enabled<br> PerlPostReadRequestHandler..enabled<br> PerlTransHandler............enabled<br> PerlHeaderParserHandler.....enabled<br> PerlAccessHandler...........enabled<br> PerlAuthenHandler...........enabled<br> PerlAuthzHandler............enabled<br> PerlTypeHandler.............enabled<br> PerlFixupHandler............enabled<br> PerlHandler.................enabled<br> PerlLogHandler..............enabled<br> PerlInitHandler.............enabled<br> PerlCleanupHandler..........enabled<br> PerlRestartHandler..........enabled<br> PerlStackedHandlers.........enabled<br> PerlMethodHandlers..........enabled<br> PerlDirectiveHandlers.......enabled<br> PerlTableApi................enabled<br> PerlLogApi..................enabled<br> PerlUriApi..................enabled<br> PerlUtilApi.................enabled<br> PerlFileApi.................enabled<br> PerlConnectionApi...........enabled<br> PerlServerApi...............enabled<br> PerlSections................enabled<br> PerlSSI.....................enabled<br> PERL_MARK_WHERE.............enabled (experimental)<br> Will run tests as User: 'nobody' Group: 'root'<br> (cd<nobr> <wbr></nobr>../apache_1.3.27 &amp;&amp; CC="gcc" CFLAGS=" -DPERL_MARK_WHERE=1 -D_REENTRANT -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdb<br> m"<nobr> <wbr></nobr>./configure --activate-module=src/modules/perl/libperl.a --activate-module=src/modules/php4/libphp4.a --disable-rule=EXPAT --prefix=/home/justin/tempapach<br> e)<br> Configuring for Apache, Version 1.3.27<br> + using installation path layout: Apache (config.layout)<br> + activated perl module (modules/perl/libperl.a)<br> + activated php4 module (modules/php4/libphp4.a)<br> Creating Makefile<br> Creating Configuration.apaci in src<br> + id: mod_perl/1.27<br> + id: Perl/v5.8.0 (linux) [/usr/bin/perl]<br> Creating Makefile in src<br> + configured for Linux platform<br> + setting C pre-processor to gcc -E<br> + checking for system header files<br> + adding selected modules<br> o perl_module uses ConfigStart/End<br> + mod_perl build type: OBJ<br> + setting up mod_perl build environment<br> + adjusting Apache build environment<br> + enabling Perl support for SSI (mod_include)<br> o php4_module uses ConfigStart/End<br> + checking sizeof various data types<br> + doing sanity check on compiler and options<br> Creating Makefile in src/support<br> Creating Makefile in src/os/unix<br> Creating Makefile in src/ap<br> Creating Makefile in src/main<br> Creating Makefile in src/modules/standard<br> Creating Makefile in src/modules/perl<br> Creating Makefile in src/modules/php4<br> Checking VERSION..........ok<br> Checking for LWP::UserAgent......ok<br> Checking for HTML::HeadParser....ok<br> Writing Makefile for Apache<br> Writing Makefile for Apache::Connection<br> Writing Makefile for Apache::Constants<br> Writing Makefile for Apache::File<br> Writing Makefile for Apache::Leak<br> Writing Makefile for Apache::Log<br> Writing Makefile for Apache::ModuleConfig<br> Writing Makefile for Apache::PerlRunXS<br> Writing Makefile for Apache::Server<br> Writing Makefile for Apache::Symbol<br> Writing Makefile for Apache::Table<br> Writing Makefile for Apache::URI<br> Writing Makefile for Apache::Util<br> Writing Makefile for mod_perl</p></div> </blockquote><p> Take note of these two lines:</p><blockquote><div><p> + activated perl module (modules/perl/libperl.a)<br> + activated php4 module (modules/php4/libphp4.a)</p></div> </blockquote><p> If those two lines are present then both php and mod_perl will be staticly linked in apache (i.e. no DSO involved)<br> <br> Now in mod_perl directory:</p><blockquote><div><p>./make<br><nobr> <wbr></nobr>./make install</p></div> </blockquote><p> The<nobr> <wbr></nobr>./make should compile mod_perl and php into apache (basically by running apache's Makefiles) and then<nobr> <wbr></nobr>./make install will install apache into the APACHE_PREFIX specified earlier.<br> <br> Now edit httpd.conf and add or uncomment this line:</p><blockquote><div><p>AddType application/x-httpd-php<nobr> <wbr></nobr>.php<nobr> <wbr></nobr>.php3<nobr> <wbr></nobr>.phtml</p></div></blockquote><p> Now install Slash (and whatever perl modules are necessary). Don't forget to copy PHP's php.ini file to<nobr> <wbr></nobr>/usr/local/lib and edit it as necessary.</p> MoonFacedAssassin 2003-01-03T19:50:51+00:00 apache successful upgrades to cvs branch so after what felt like a rather rapid summer, this labour day weekend i was finally able to put aside some time to again attempt an upgrade to the cvs branch.<p>this time i was successful, thanks in large part to the development of the <a href="">sql/mysql/upgrades</a> file. <br>however one thing that was missing from it, that i added was the line:<br> <tt> INSERT into users_hits (uid) select uid from users;</tt> <br>which was the last touch to ensure that previous users were imported.</p><p>the rest was fairly straight forward, with various tinkering needed, but nothing too serious. outside of the obvious; which is ensuring proper configuration (especially of topics and sections), the main thing i'm going to focus on now is the use of sections and subsections. i'm hoping this will allow me to collapse a few slash sites into one.</p> laotan 2002-09-03T12:41:54+00:00 tips attempt at an upgrade to the current cvs branch so <a href="">we</a> run a number of different slash sites, the large majority of which running the 2.2.5 release. however i've setup and have been maintaining a few using the current cvs version of slash. the juxtaposition of the two has really enamored me to the cvs, and several times daily i pine to have all my sites running on the cvs (or at least the pre-2.3/4 code).<p>so i took it upon myself to attempt an upgrade, thanks in large part due to the existence of the <a href="">sql/mysql/upgrades</a> file. the problem however, was that there's a gap between where 2.2.5 left off, and the upgrades file began. so another purpose of my travails was to try and induce the schema that's missing.</p><p>my model for the upgrade was the file <a href="">utils/slash2toslash2.2</a> which i had used and loved when upgrading from 2.0 to 2.2.</p><p>so i started by backing up the files, templates, and sql dump for <a href="">the old</a> site. i then proceeded to install a fresh slash install this time using the cvs version. it seemed much saner to me to start with a fresh install, and then import the data, rather than try and impose it over the old.</p><p>the tables in the old site that i figured i should in some way be interested in were: blocks, comment_text, comments, discussions, pollanswers, pollquestions, section_topics, sections, stories, story_text, story_param, templates, topics, users*, and vars. i then proceeded to run all of the sql upgrades from the sql/mysql/upgrades file to my old sql. in my mind this was a way to help the data get ready for the attempted transplant. once that was done i one by one inserted the old db table data into the new slash db.</p><p>now mind you, i was being selective about what i wanted to import. i didn't keep all blocks, and i didn't really care about things like the abusers table. however there were some problems, and some omissions from the ugprades file. the obviouis sql changes that i noticed were not in upgrades:</p><blockquote><div><p> <tt>ALTER TABLE blocks ADD rss_template varchar(30) default NULL;<br>ALTER TABLE blocks ADD items smallint(6) NOT NULL default '0';<br> <br>ALTER TABLE pollquestions ADD flags enum('ok','delete','dirty') NOT NULL default 'ok';</tt></p></div> </blockquote><p>the import of the few blocks i wanted to keep was tricky, and i found i had to move the fields around a little to make them work. the real trouble however was with the users*.</p><p> the first thing i noticed was the lack of users_hits in the ugprade notes, and yet this seems to me to be a key part of why/how users* runs into trouble. i did however note this reference later in the upgrades file:</p><blockquote><div><p> <tt>ALTER TABLE users_hits ADD COLUMN hits_bought_today SMALLINT UNSIGNED DEFAULT 0 NOT NULL AFTER hits_bought;</tt></p></div> </blockquote><p>so i had to create users_hits, and then apply this sql statement. i also found i had to run:</p><blockquote><div><p> <tt>ALTER TABLE users_info add people blob;</tt></p></div> </blockquote><p>although in the end i was unable to really get the users* working, which really, was the most valued part of the upgrade for me. i sent an email to the slash-devel list and <a href="">ericdano</a> replied indicating he had the same experience during his <a href=";tid=4">attempted upgrade</a>.</p><p>mind you i've still been playing with the <a href="">new</a> site, learning about the new release, playing with the templates, sections, etc. yet the users* still doesn't work. all the old users can log in, but don't stay logged in, new users can create an account, but as admin i cannot grant seclev or author access to other users. so i've still got some debugging ahead.</p><p>i made this attempt a few days ago, took some time to reflect, i've now written up this journal entry, and then perhaps from here i'll continue on to working on this users* problem.</p><p> <b>Update</b>:after posting this journal entry, <a href="/~peloy">peloy</a> pointed out that <a href="/~tf23">tf23</a> had submitted a <a href=";aid=571813&amp;group_id=4421&amp;atid=304421">patch</a> for the upgrades file to sourceforge. yipee. will have to try again<nobr> <wbr></nobr>:)</p> laotan 2002-06-26T12:09:23+00:00 bugs final thoughts on 2.2.5 ironically enough the last time i made a journal entry it was as i upgraded to 2.2 from 2.0. in hindsight i have to say that 2.2.x has been a fairly steady stable ride. the sites i've run have had few bugs, and even less problems. <a href="">we've</a> done a number of small perl modifications, as well as stretch template design a fair bit from the "out-of-the-box" slashcode.<p>alas, i've got my eye on cvs again, and i'm getting eager to jump. there seems to have been a lot of changes, as well as the addition of some new plugins. with this in mind, rather than focus on releasing for 2.2.x, <a href="">we're</a> gonna start working on 2.3/4, first with upgrades, then by releasing a theme and plugin or two. cause i have a number of 2.2.x sites that would benefit from an upgrade, i'm gonna first focus on what is involved in such a task/migration.</p> laotan 2002-06-12T20:15:24+00:00 slash New Flag in the code <p>I really should use this to keep a record of what I do with slash. What I wanted to write was that there is a new flag in the code that keeps admin page views, except for from being recorded in the accesslog. For small sites this means that you can get an actual record of just how many people are looking at your site who are not admins.<br>Patg just finished up work on the new RSS template code so you can now do a lot more formatting of your block data (which is way cool in my opinions). Secondary topics will be one of the next features added by him.<br>The first round of Zoo aka Friends/Foe is running. Its nice but it was mainly to figure out what was and was not going to work. I have a new schema that should hit CVS soon and I will have to put up a not to tell people how to convert their data. The next schema should work a lot better as we add more then just friends and foes to the system.</p><p>And I picked some really ugly icons for friends and foes since Rob wants to keep Slashdot's mac like buttons for just Slashdot.<br>I am hoping this makes someone want to give us a better set of icons.</p> Krow 2002-01-17T08:46:45+00:00 slash Side note Since someone asked, I keep my actual Journal at here, I just use this one for testing mainly. Krow 2002-01-04T02:38:02+00:00 markup finally upgraded all sites <p>i finally got all of my slash sites upgraded to the lastest cvs code. there are still a few bugs here and there, but everything seems to have worked relatively painlessly. now i can take some time to setup a few new slash sites, a couple for clients, and one for my home (icecast based) radio station<nobr> <wbr></nobr>:)</p> laotan 2001-12-28T19:53:34+00:00 slashsites Setup a site to showcase the slashcode work we've been doing, as well as offer hosting and consulting services. It's at <a href=""></a>. laotan 2001-07-27T10:57:27+00:00 bugs went to YAPC <p>and saw pudge give an <a href="">interesting presentation</a> on the life of the slashcode. definitely worth the trip to montreal. i don't think i'll make it to san diego though<nobr> <wbr></nobr>;)</p> laotan 2001-06-16T02:09:06+00:00 bugs started working on fry <p>got a few bender sites up and running: <a href="">nologo</a> and <a href="">awid</a>. now its time to move on to fry, version 2.1 of the slashcode. its got messaging!</p> laotan 2001-06-03T19:50:50+00:00 bugs Hehee... <p>Ok, you can now pull RSS feeds from the different<br>top10 Journal feeds. So, that means that it is cake<br>to now turn them into a portald box<nobr> <wbr></nobr>:)</p> Krow 2001-04-17T22:19:38+00:00 bugs On a side note <p>After looking through Doug's talk on mod_perl 2.0, I do not<br>think that we will actually have to do much to support it.<br>Yipee<nobr> <wbr></nobr>:)</p> Krow 2001-04-06T17:34:08+00:00 bugs Comments.... <p>Soon, soon. Must complete comments.</p><p>On a side note, somenone should make an entire themed site around<br>the jouranl plugin.</p><p>Undocument hack, try:<br></p> Krow 2001-03-27T23:28:25+00:00 bugs test <tt>test-fu&nbsp; &nbsp;adsfasd&nbsp; &nbsp; &nbsp; <br> <br>&nbsp; &nbsp; &nbsp;asdfasd</tt> pudge 2001-03-23T20:34:15+00:00 bugs successful apache install so i finally got the super apache bundle compiled: <p> <i>Apache/1.3.19 PHP/4.0.4pl1 mod_perl/1.25 mod_ssl/2.8.1 OpenSSL/0.9.6</i> <br>and got it working with slash <br>my install notes are included with tf's notes: <br> <a href=""></a></p> laotan 2001-03-16T14:27:28+00:00 bugs