Perl Error When Reading Local Site .cfg
error_log (happens loading twiki configure URL) Perl error when reading LocalSite.cfg: BEGIN failed--compilation aborted at /etc/httpd/twiki/lib/TWiki.pm line 454. Compilation failed in require at /etc/httpd/twiki/lib/TWiki/UI/View.pm line 39. BEGIN failed--compilation aborted at /etc/httpd/twiki/lib/TWiki/UI/View.pm line 39. Compilation failed in require at /etc/httpd/twiki/bin/view line 30. BEGIN failed--compilation aborted at /etc/httpd/twiki/bin/view line 30. Environment TWiki version: TWikiRelease04x01x02 TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin Server OS: Mandrake Linux Web server: Apache 2.2.3 Perl version: 5.8.6 Client OS: N/A Web Browser: N/A Categories: Installation -- Alexandra1Stehman - 12 Jul 2007 Answer If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box. It sounds like you have a perl error in your LocalSite.cfg. Try this; from the command line, $ cd lib $ perl LocalSite.cfg If perl barfs, you should be able to see what the problem is. -- CrawfordCurrie - 13 Jul 2007 See, that is part of the problem, tho' - the twiki distro I dl'ed does not include that file anymore. -- Alexandra1Stehman - 13 Jul 2007 That file is not part of the distro. It is generated when you first run configure. Check that you followed all steps in the installation instructions. -- CrawfordCurrie - 14 Jul 2007 presuming that Crawford's pointer helped -- SvenDowideit - 26 Aug 2007 Yeah, I had this problem two and it was because I tried to use the login script before the configure script but in my defense non of the scripts were working at first because of a problem with the shebang -- JohnCreighton - 2009-07-20 Change status to: AskedQuestions AssignedQuestions AnsweredQuestions ClosedUnanswered WebForm SupportStatus AnsweredQuestions Edit|Attach|Watch|Print version|History: r7 Blog Extensions Documentation Community Development Tasks Download Support You are here: Foswiki>Support Web>SupportQuestions>Question229 (11 Dec 2009, CrawfordCurrie)Edit AttachThis question about Installation of Foswiki: Answered Can't run configure script Hello. I am installing foswiki 1.0.6 on CentOS 5.3. I have set up LocalLib.cfg to point to the lib directory of foswiki. Also, set up apache config file . When I go to http://localhost/foswiki/bin/configure http://www.twiki.org/cgi-bin/view/Support/ConfigureScriptBombing , I get "perl error reading LocalSite.cfg" (see below). I then manually created lib/LocalSite.cfg following the instructions for maual installation in the guide. I then get a "Topic 'Configure' does not exist" page. I get the same "Topic 'X' does not exist" https://foswiki.org/Support/Question229 when trying different links such as WelcomeGuest or UserRegistration. What am I doing wrong? Thanks in advance. == Software error: Content-type: text/plain Perl error when reading LocalSite.cfg: Please inform the site admin. at /usr/lib/perl5/5.8.8/CGI/Carp.pm line 356 CGI::Carp::realdie('Content-type: text/plain\x{a}\x{a}Perl error when reading LocalSite.c...') called at /usr/lib/perl5/5.8.8/CGI/Carp.pm line 437 CGI::Carp::die('Content-type: text/plain\x{a}\x{a}Perl error when reading LocalSite.c...') called at /var/www/foswiki/lib/Foswiki/Configure/Load.pm line 56 Foswiki::Configure::Load::readConfig() called at /var/www/foswiki/lib/Foswiki.pm line 269 Foswiki::BEGIN() called at LocalSite.cfg line 498 eval {...} called at LocalSite.cfg line 498 require Foswiki.pm called at /var/www/foswiki/bin/view line 43 main::BEGIN() called at LocalSite.cfg line 498 eval {...} called at LocalSite.cfg line 498 BEGIN failed--compilation aborted at /var/www/foswiki/lib/Foswiki.pm line 498. at /var/www/foswiki/lib/Foswiki.pm line 498 require Foswiki.pm called at /var/www/foswiki/bin/view line 43 main::BEGIN() called at /var/www/foswiki/lib/Foswiki.pm line 498 eval {...} called at /var/www/foswiki Q&A Tutorials Poetry RecentThreads NewestNodes Donate What'sNew on Dec 29, 2001 at 10:38UTC ( #135082=categorized question: print w/replies, xml ) Need Help?? Contributed by Voytek on Dec 29, 2001 at 10:38UTC Q&A > input and output Description: Hey! I http://www.perlmonks.org/?node_id=135082 looked through the site, and I couldn't really find this. What I would like to do is have Perl (in CGI, I don't know if this makes a difference - I https://blog.webernetz.net/2014/01/06/mrtg-with-rrdtool-and-routers2-installation-from-scratch/ don't think it would) create a file with some variables in it... I know how to do this. But in the future, how can I open this file again and get perl error the different numbers in it to become certain variables? Thanks a lot, VoytekAnswer: Reading Variables from a Filecontributed by Kanji See Object Serialization Basics for a few pointers, but it might be easier to use CGI.pm's (alt.) own save() and restore_paramaters() functions, along with your open() and flock()s. --k. Answer: Reading Variables from a Filecontributed by Chrisf Say you have perl error when written the numbers to the file and have delimited them with | so the data in the file looks like this: 1111|2222|3333 You can then read them into your variables like so: #!/usr/bin/perl -w use strict; # declare your variables my $varFile = "variables.txt"; my ($var1,$var2,$var3); # open the file open DATA, $varFile or die "Can't open file: $!"; while () { # chomp the line chomp; # split the line into values and assign them to your variables ($var1,$var2,$var3) = split /\|/; } # close the file close DATA; [download] The length of the code can be reduced substantially, but this gives you an idea of what's going on.Answer: Reading Variables from a Filecontributed by gav^ use Storable; store \%hash, 'data'; $hr = retrieve 'data'; [download] Answer: Reading Variables from a Filecontributed by msemtd I quite often provide Perl apps compiled into executables with perl2exe for deployment on systems without Perl installed. As such I always provide a back-door means by which the configuration can be adjusted e.g.: - use strict; my $cake = 'chocolate'; my $pie = 'apple'; eval slurp("config.pl"); [ Scratch 2014-01-06Linux, MRTG/Routers2, Network, Tutorial/HowtoApache, Installation, Monitoring, MRTG, Routers2.cgi, RRDtool, SNMP, UbuntuJohannes Weber I always wanted to monitor my private network with an open source tool. Since I knew some nice statistics, e.g. from the DE-CIX (printed with RRDtool) or from the Uni-Gießen (generated with MRTG), I had the idea of installing such a system by myself. Luckily I found a book from Steve Shipway, called "Using MRTG with RRDtool and Routers2", which actually disappointed me because it did not offer a complete installation guide but mainly further information about fine-tuning the appropriate tools. Therefore, I want to show a complete step-by-step installation of all the needed tools in order to monitor a network with MRTG, RRDtool and Routers2. "From scratch" means that there are no prerequisite to this installation guide except a plain Linux server (in my case a Ubuntu Linux) such as presented here. Okay, let's go: Preparation In order to use all features that I explain in the next sections, the following tools must be installed on the system. Of course, all these packages can be installed step-by-step, but I think it is easier to install them at once. Here is the list: 1 sudo apt-get install mrtg mrtg-ping-probe rrdtool librrds-perl snmp snmpd snmp-mibs-downloader apache2 libapache2-mod-perl2 libnet-snmp-perl libgd-gd2-perl The installation requires round about 60 packages. Attention: The installation process from MRTG asks a single question, whether or not the root user should be the only one who can read the default configuration file from MRTG (/etc/mrtg.cfg). In our scenario, this can be answered with "Yes", which is also the default option in this question. Webserver: Apache We just installed the apache web server. 😉 It is already running in the background and can be tested with a browser that accesses the IP address/domain name of the server. If you see the standard "It works!" page you are right. (The following paragraph is only for further investigations on it.) You can see whether the apache server is running via ps -A | grep apache which should show a few apache2 processes. Furthermore, the command netstat -l should show at least one tcp process that LISTENs on port 80 (http). If you have IPv6 enabled, another tcp6 process also LISTENs on port 80. The configuration can be edited with sudo nano /etc/apache2/apache2.conf (since I am using Ubuntu. Other Linux distributions are using httpd.conf). If you get an error message in your logs sim