Recently I’m reading linux kernel 0.12. I setup lxr+glimpse on my Fedora 15 node.
Following is the steps:
1. Prepare…
|
uname=2.6.43.8-1.fc15.i686 |
with following packages installed:
|
httpd-2.2.22-1.fc15.i686 mod_perl-2.0.4-14.fc15.i686 mysql-server-5.5.23-1.fc15.i686 ctags-5.8-3.fc15.i686 perl-5.12.4-166.fc15.i686 perl-CPAN-1.9402-166.fc15.noarch perl-DBD-MySQL-4.018-7.fc15.i686 |
2. Install glimpse…
http://webglimpse.net/trial/glimpse-4.18.6.tar.gz
download/congfigure/make/make install
If any package lost, use yum/cpan to install.
You can inst as default(/usr/local)…
I use prefix=/usr/suse/lxr/glimpse
3. Install lxr…
http://sourceforge.net/projects/lxr/
I download lxr-0.11.1.tgz, no necessary to compile
extra/untar the package and
|
mv lxr-0.11.1/ /usr/suse/lxr/lxr |
4. Configuration…
I configure a single tree here.
|
cd /usr/suse/lxr/lxr (my ${LXR/ROOT}) mkdir lxrconf.d ./scripts/initial-config.sh ./scripts/initdb-config.sh |
.htaccess file will be generated into lxrroot, no need to modify…
config file will be generated into lxrconf.d/
5. handle the configuration files…
modify apache-lxrserver.conf, erase following caret: “alias ^/lxr” –> “alias /lxr”
|
cd lxrconf.d/ cp apache-lxrserver.conf /etc/httpd/conf.d/ |
mysql import lxrconf.d/initdb-mysql-custom.sql with correct user/passwd/dbname.
6. copy lxrconf.d/lxr.conf to ${LXRROOT} and configure…
I paste a copy of my lxr.conf here
lxr.conf
7. prepare some templates html file, ensure httpserver can access the files…
|
cd ${LXRROOT} cp -r templates/html/ to ./html chmod 777 ./html -R |
8. all ready..
|
mkdir ${LXRROOT}/src cd ${LXRROOT}/src echo "0.12" > version |
ln or cp folder of kernel0.12 here, name as “0.12”
9. go to folder ${LXRROOT}, generate Index…
|
./genxref --url=http://localhost/lxr --version=0.12 |
we can see records into db…
10. re/start httpd server.
access http://localhost/lxr/source
all should be ok now…
[debug]
1. Cannot show ident correctly, httpd server errorlog shows
[Thu Jul 5 18:24:33 2012] warning: LXR::Template, line 105: Template file ‘htmlident’ => ‘/usr/suse/lxr/lxr/http/html-ident.html’ does not exist
[Thu Jul 5 18:24:33 2012] fatal: ModPerl::ROOT::ModPerl::RegistryPrefork::usr_suse_lxr_lxr_ident, line 188: ‘htmlident’ template not configured at /usr/suse/lxr/lxr/ident line 188, <FILETYPE> line 4.
just ensure lxr.conf matches step#7. and give folder html enough privilege.
2. No need to copy ${LXRROOT}/lib files to other perl @INC path.
/etc/httpd/conf.d/apache-lxrserver.conf will call following file to include…
/usr/suse/lxr/lxr/lxrconf.d/apache2-require.pl
—————————-
Well , glimpse here can be replaced with swish-e, I have another post to provide swish-e RPMs for fedora15/16.
Any problems on similar configuration, plz feel free to drop me a message.
-s
[update] Aug.17th
About the “src” folder:
In the configure file, writes:
|
, 'variables' => { 'v' => { 'name' => 'Version' , 'range' => [ readfile('src/version') ] , 'default' => '0.12' } , 'a' => { 'name' => 'Architecture' , 'range' => [qw(i386 alpha arm m68k mips ppc sparc sparc64)] } } |
I didnt comment out “range ” values for new versions of linux kernel contains such code.
About the Step8. first time I use “>” and when new version trees come, I use “>>” instead.. like following
|
echo "0.12" > version echo 2.6.32 >> version |
So, if other users who dont handle version intro with this file, please just configure above code, and hard-code modify “range” array.
above I mentioned “ln or cp” trees here, just as Andre suggested it’s not a good idea to put source code inside the app folder.
well I’m now not installing lxr in a standard prefix(like: /usr/local/ or /usr/), so I would like the data integrated
I place source code trees in other place and use soft link to keep update.
|
[suse@suse /usr/suse/lxr/lxr/src]$ls -al total 12 drwxrwxr-x 2 apache apache 4096 Aug 16 14:21 . drwxr-xr-x 14 apache apache 4096 Jul 18 14:56 .. lrwxrwxrwx 1 apache apache 38 Jul 4 15:40 0.12 -> /home/suse/workspace/kernel/linux-0.12 lrwxrwxrwx 1 root root 25 Aug 16 14:21 2.6.11 -> /codes/linux/linux-2.6.11 lrwxrwxrwx 1 root root 26 Jul 18 09:11 2.6.32 -> /codes/linux/linux-stable/ lrwxrwxrwx 1 root root 42 Jul 6 13:04 3.0 -> /home/suse/workspace/kernel/linux-3.0-rc1/ -rw-rw-r-- 1 apache apache 23 Aug 16 14:23 versions |
I think the soft link is alternatively a good choice to avoid data loosing when app update/deinstall.
And of course when new install/upgrade needed, I think we can move away the src folder and softlink back here.
About the err mesg#1 and step7. on folder “/lxr/lxrconf.d/html/”
here I didnt successfully configured the server as I didnt grant enough privilege to the “/lxr/lxrconf.d/html/” dir. it’s why failed.
I mv the folder to “/lxr/http” and grant privilege, it’s ok to access now.
I think it ok not move the folder, just chown/chmod to give enough privilege to let httpserver to access the folder.
My change is not a must, I just think it ok to delete dir “”/lxr/lxrconf.d/” after server successfully running. and the server not rely on this folder now.
and before step#7, invoke “cd ” to ${LXRROOT}, already updated.
Thanks Andre pointing out these issues,
-s