{"id":157,"date":"2010-07-04T17:12:17","date_gmt":"2010-07-04T21:12:17","guid":{"rendered":"http:\/\/littlesvr.ca\/masters\/?p=157"},"modified":"2010-07-04T17:12:17","modified_gmt":"2010-07-04T21:12:17","slug":"setting-up-reviewboard","status":"publish","type":"post","link":"http:\/\/littlesvr.ca\/masters\/2010\/07\/04\/setting-up-reviewboard\/","title":{"rendered":"Setting up ReviewBoard"},"content":{"rendered":"<p>Last week I&#8217;ve spent a couple of days setting up reviewboard. It wasn&#8217;t as painless a process as I had hoped, but in the end it worked so I&#8217;m happy.<\/p>\n<p>Partly the problem with installing it is that I&#8217;ve never installed a python-based website before. The closest I ever got to setting up a Web2.0 website was setting up my blogs (this being one of them). But WordPress is written in PHP (which Slackware has support for out of the box) and they&#8217;ve put a lot of effort into making the installation as dummy-proof as possible.<\/p>\n<p>I downloaded the ReviewBoard .egg file as the instructions suggested, but apparently that wasn&#8217;t needed at all. I also downloaded and installed setuptools, which is a sort of a python package manager that automatically without prompting downloads python modules (or apps?) that are dependencies for what I asked for.<\/p>\n<p>The easy_install app from setuptools isn&#8217;t very hard, but it&#8217;s scary. It downloaded and installed a dozen things without asking me a thing, stuff like Django which I&#8217;d really want to know where it&#8217;s installed and for what purpose. I guess if I really wanted to understand what was being done I should have done a manual install, but given my lack of knowledge in the field and my lack of spare time &#8211; that would have taken weeks.<\/p>\n<p>Luckily I haven&#8217;t done this on littlesvr.ca (my production server) but on a secondary, disposable server. This one is on a DSL like so its upload is pretty poor (50KB\/s) but it should work for the experiment. It may even be a good thing that it&#8217;s slower than normal since my tablet is pretty old too (at times it&#8217;s obvious when you scroll quickly).<\/p>\n<p>The next challenge was the prerequisites that the easy_install didn&#8217;t handle. One of them is a choice between mod_fastcgi and mod_python. Slackware didn&#8217;t have either installed. I tried fastcgi first guessing it would be easier, but it wasn&#8217;t &#8211; I couldn&#8217;t even figure out what it&#8217;s supposed to do, so it was hard to guess how to set it up. So I installed mod_python instead. A manual install, but wasn&#8217;t hard.<\/p>\n<p>I brushed up on my MySQL admin knowledge and set up a database and a user with the right permissions. I wish I didn&#8217;t have to google this every time. The MySQL manual is really good, but it lacks the first time barebone setup I do once or twice a year.<\/p>\n<p>While messing with the above I had to run <em>rb-site install <\/em>a couple of times. The second time it didn&#8217;t work and I had to delete all the tables it created the first time. There is no command in MySQL to dump all the tables from a database, but I found a <a href=\"http:\/\/www.cyberciti.biz\/faq\/how-do-i-empty-mysql-database\/\">handy script<\/a> that I used successfully.<\/p>\n<p>The most difficult part of the process was the Apache setup. even not counting the failed fastcgi installation attempts it took quite a few tries to get it right. The final solution (not ideal, but it works) was to create \/etc\/httpd\/extra\/httpd-vhosts.conf included from httpd.conf with these contents:<\/p>\n<blockquote><p>NameVirtualHost *:80<br \/>\n&lt;VirtualHost *:80&gt;<br \/>\nServerName homesvr.littlesvr.ca<br \/>\nDocumentRoot &#8220;\/home\/www\/htdocs\/rb\/htdocs&#8221;<\/p>\n<p># Error handlers<br \/>\nErrorDocument 500 \/errordocs\/500.html<\/p>\n<p># Serve django pages<br \/>\n&lt;Location &#8220;\/&#8221;&gt;<br \/>\nPythonPath &#8220;[&#8216;\/home\/www\/htdocs\/rb\/conf&#8217;] + sys.path&#8221;<br \/>\nSetEnv DJANGO_SETTINGS_MODULE reviewboard.settings<br \/>\nSetEnv PYTHON_EGG_CACHE &#8220;\/home\/www\/htdocs\/rb\/tmp\/egg_cache&#8221;<br \/>\nSetHandler mod_python<br \/>\nPythonHandler django.core.handlers.modpython<br \/>\nPythonAutoReload Off<br \/>\nPythonDebug Off<br \/>\n# Used to run multiple mod_python sites in the same apache<br \/>\nPythonInterpreter reviewboard_rb<br \/>\n&lt;\/Location&gt;<\/p>\n<p># Serve static media without running it through mod_python<br \/>\n# (overrides the above)<br \/>\n&lt;Location &#8220;\/media&#8221;&gt;<br \/>\nSetHandler None<br \/>\n&lt;\/Location&gt;<br \/>\n&lt;Location &#8220;\/errordocs&#8221;&gt;<br \/>\nSetHandler None<br \/>\n&lt;\/Location&gt;<\/p>\n<p>&lt;Directory &#8220;\/home\/www\/htdocs\/rb\/htdocs&#8221;&gt;<br \/>\nAllowOverride All<br \/>\n&lt;\/Directory&gt;<\/p>\n<p># Alias static media requests to filesystem<br \/>\nAlias \/media &#8220;\/home\/www\/htdocs\/rb\/htdocs\/media&#8221;<br \/>\nAlias \/errordocs &#8220;\/home\/www\/htdocs\/rb\/htdocs\/errordocs&#8221;<br \/>\n&lt;\/VirtualHost&gt;<\/p><\/blockquote>\n<p>This is almost the same as the sample httpd.conf ReviewBoard created for me, except for the first line. It would have been nice if somewhere in the docs it was mentioned that ReviewBoard requires a dedicated host to run on, but that&#8217;s ok &#8211; I already mentioned this is a disposable server.<\/p>\n<p>After I finally got to see my ReviewBoard setup in a Firefox and changed the default username\/password &#8211; there was just the matter of posting a patch into it. Again this was strangely difficult to do. It appears that a ReviewBoard instance is intended to work with one and only one source repository. I&#8217;m used to svn and have a server set up so I tried to connect it to that. I found (after <a href=\"http:\/\/www.mail-archive.com\/reviewboard@googlegroups.com\/msg03121.html\">googling it<\/a>) that I need pysvn, so I installed it.<\/p>\n<p>Then I was still confused about how I would go about posting a diff. I stumbled through it, and found one combination of &#8220;Base Directory&#8221; and &#8220;Diff&#8221; that worked. For this one I had to do a diff (specifically with <em>LANG=en_CA<\/em> svn diff -rx:y). That&#8217;s fine, I can just commit whatever I want reviewed into my homework repo.<\/p>\n<p>Here&#8217;s what it looks like:<\/p>\n<p><a href=\"http:\/\/littlesvr.ca\/masters\/wp-content\/uploads\/2010\/07\/reviewboard-test.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-160\" title=\"reviewboard test\" src=\"http:\/\/littlesvr.ca\/masters\/wp-content\/uploads\/2010\/07\/reviewboard-test-300x233.png\" alt=\"\" width=\"300\" height=\"233\" srcset=\"http:\/\/littlesvr.ca\/masters\/wp-content\/uploads\/2010\/07\/reviewboard-test-300x233.png 300w, http:\/\/littlesvr.ca\/masters\/wp-content\/uploads\/2010\/07\/reviewboard-test-1024x796.png 1024w, http:\/\/littlesvr.ca\/masters\/wp-content\/uploads\/2010\/07\/reviewboard-test.png 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last week I&#8217;ve spent a couple of days setting up reviewboard. It wasn&#8217;t as painless a process as I had hoped, but in the end it worked so I&#8217;m happy. Partly the problem with installing it is that I&#8217;ve never installed a python-based website before. The closest I ever got to setting up a Web2.0 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/littlesvr.ca\/masters\/wp-json\/wp\/v2\/posts\/157"}],"collection":[{"href":"http:\/\/littlesvr.ca\/masters\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/littlesvr.ca\/masters\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/littlesvr.ca\/masters\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/littlesvr.ca\/masters\/wp-json\/wp\/v2\/comments?post=157"}],"version-history":[{"count":5,"href":"http:\/\/littlesvr.ca\/masters\/wp-json\/wp\/v2\/posts\/157\/revisions"}],"predecessor-version":[{"id":163,"href":"http:\/\/littlesvr.ca\/masters\/wp-json\/wp\/v2\/posts\/157\/revisions\/163"}],"wp:attachment":[{"href":"http:\/\/littlesvr.ca\/masters\/wp-json\/wp\/v2\/media?parent=157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/littlesvr.ca\/masters\/wp-json\/wp\/v2\/categories?post=157"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/littlesvr.ca\/masters\/wp-json\/wp\/v2\/tags?post=157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}