Sunday sitepoint time !
1. Perl Module Mechanics was last edited in 2007. It is reasonable to consider it out of date by now. Stommespoes is right, you really should refer to perlmonks.org, stackoverflow.com and, one of my favourite reference sites, perl.org.
2. It would really help to understand your server arrangement better. From what you have written you seem to have access to the apache config files which implies, in the minimum, a virtual machine.
3. I have never had a problem using apache2ctl on a Debian server as an admin. You won't get far using it as a normal user. The startup script, /etc/init.d/apache, should also work but here's the options for apache2ctl
Code:
apache2ctl
Usage: /usr/sbin/apache2ctl start|stop|restart|graceful|graceful-stop|configtest|status|fullstatus|help
/usr/sbin/apache2ctl <apache2 args>
/usr/sbin/apache2ctl -h (for help on <apache2 args>)
Code:
apache2ctl -h
Usage: /usr/sbin/apache2 [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
-S : a synonym for -t -D DUMP_VHOSTS
-t -D DUMP_MODULES : show all loaded modules
-M : a synonym for -t -D DUMP_MODULES
-t : run syntax check for config files
-T : start without DocumentRoot(s) check
-X : debug mode (only one worker, do not detach)
All taken from a Debian server.
Historical note: back in the day when Apache 2.x came out, /usr/sbin/apachectl and /usr/bin/apache2ctl both existed independently on Debian systems. One restarted the Apache 2 server, and the other any Apache 1.x server. The Apache server on a Debian machine is still identified as apache2 in a process listing, and I think the Apache 1.x were identified by http. Now, /usr/sbin/apachectl, on my systems, at least, is linked to /usr/bin/apache2ctl but I have got into the habit of using /usr/sbin/apache2ctl directly.
4. When you make changes to your apache config files, use
to check the config files are at least syntactically correct before restarting your server. It should come up with either an error message or 'Syntax OK'.
5. On my system, the graceful and restart options do not change the process ID number of the apache process. The stop andn start approach does. I can detect what is happening by looking at /var/log/apache2/error.log. (In which we'll all notice that FastCGI perhaps isn't so graceful !)
Code:
[Sun Nov 20 20:52:05 2011] [notice] Graceful restart requested, doing restart
[Sun Nov 20 20:52:05 2011] [alert] (2)No such file or directory: FastCGI: read() from pipe failed (0)
[Sun Nov 20 20:52:05 2011] [alert] (2)No such file or directory: FastCGI: the PM is shutting down, Apache seems to have disappeared - bye
[Sun Nov 20 20:52:05 2011] [notice] FastCGI: process manager initialized (pid 562)
[Sun Nov 20 20:52:05 2011] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
[Sun Nov 20 20:52:05 2011] [notice] mod_python: using mutex_directory /tmp
[Sun Nov 20 20:52:05 2011] [notice] Apache/2.2.21 (Debian) mod_fastcgi/2.4.6 PHP/5.3.8-1 with Suhosin-Patch mod_python/3.3.1 Python/2.7.2+ mod_perl/2.0.5 Perl/v5.12.4 configured -- resuming normal operations
[Sun Nov 20 20:52:28 2011] [notice] SIGHUP received. Attempting to restart
[Sun Nov 20 20:52:28 2011] [notice] FastCGI: process manager initialized (pid 581)
[Sun Nov 20 20:52:28 2011] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
[Sun Nov 20 20:52:28 2011] [notice] mod_python: using mutex_directory /tmp
[Sun Nov 20 20:52:28 2011] [notice] Apache/2.2.21 (Debian) mod_fastcgi/2.4.6 PHP/5.3.8-1 with Suhosin-Patch mod_python/3.3.1 Python/2.7.2+ mod_perl/2.0.5 Perl/v5.12.4 configured -- resuming normal operations
[Sun Nov 20 20:52:39 2011] [notice] caught SIGTERM, shutting down
[Sun Nov 20 20:52:48 2011] [notice] FastCGI: process manager initialized (pid 599)
[Sun Nov 20 20:52:48 2011] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
[Sun Nov 20 20:52:48 2011] [notice] mod_python: using mutex_directory /tmp
[Sun Nov 20 20:52:48 2011] [notice] Apache/2.2.21 (Debian) mod_fastcgi/2.4.6 PHP/5.3.8-1 with Suhosin-Patch mod_python/3.3.1 Python/2.7.2+ mod_perl/2.0.5 Perl/v5.12.4 configured -- resuming normal operations
The last part shows the effect of apache2ctl stop followed by the effect of apache2ctl start command.
Here endeth the apache lesson - possibly
6a.. Your original setup looks like it used mod_perl. This is okay. mod_perl is cool but it is rare to have it unless you have a sysadmin that knows what they are doing.
6b. Your current arrangement may not have mod_perl installed or may be configuring it differently.
7. Your current arrangement at least has a user 'staging'. I deduce that from
Code:
DOCUMENT_ROOT = /home/staging
8. http://www.perlmonks.org/?node_id=867860 has a fairly recent discussion on PERL5LIB. Particularly note the fourth reply, from toolic
Code:
perl does not require that the PERL5LIB environment variable be set. Typically, the variable will not be set to any value.
One common usage scenario is to set the variable to a directory which contains Perl modules that you have developed.
And I have just noticed the OP has fixed the problem according to his satisfaction
I should wake up and read the full thread!
I'll post this anyway in case it helps anyone else looking here.
Bookmarks