apache + php + mysql + perl installation Detailed Explanation

  Installation of the environment: FreeBSD 5.2.1 
  The necessary software: 

  Installation steps: 
  tar xzvf apache_1.3.31.tar.gz 
  tar xzvf mod_perl-1.29.tar.gz 
  tar xzvf mod_ssl-2.8.18-1.3.31.tar.gz 
  tar xzvf openssl-0.9.7d.tar.gz 
  tar xzvf perl-5.8.3.tar.gz 

  cd openssl-0.9.7d 
  . / config 
  make test 
  make install 

  Installation perl 
  tar xzvf perl-5.8.3.tar.gz 
  sh Configure-de 
  make test 
  make install 

  cd mod_ssl-2.8.18-1.3.31 
  . / configure – with-apache =.. / apache_1.3.31 – with-ssl =.. / openssl-0.9.7d 

  cd mod_perl-1.29 
  perl Makefile.PL APACHE_SRC =.. / apache_1.3.31/src USE_APACI = 1 USE_DSO = 0 EVERYTHING = 1 NO_HTTPD = 1 PREP_HTTPD = 1 
  make install 

  Install apache 
  cd apache_1.3.31 
  SSL_BASE =.. / openssl-0.9.7d \ 
  . / configure – prefix = / usr / local / apache \ 
  — activate-module = src / modules / perl / libperl.a \ 
  — enable-shared = max – disable-shared = perl \ 
  — enable-module = all – enable-module = ssl – enable-suexec \ 
  — suexec-caller = www 
  make install 

  Install mysql 
  tar xzvf mysql-4.1.10a.tar.gz 
  cd mysql-4.1.10a 
  . / configure – prefix = / usr / local / mysql – with-mysqld-user = mysql \ 
  — without-bench – without-debug — with-extra \ 
  charsets = complex – with-mysqld-ldflags =- all-static 
  make install 
  . / scripts / mysql_install_db 
  chown-R mysql: mysql / usr / local / mysql / var 
  chmod-R g + rx / usr / local / mysql / var 
  chmod-R o + rx / usr / local / mysql / var 

  Install php 
  php_version = 4.3.10 
  php_prefix = / usr / local / php 

  for name in apache cgi; do 
  tar zxf php-$ (php_version). tar.gz 
  mv php-$ (php_version) php-$ (php_version) – $ (name) 

  # Apache 
  (cd php-$ (php_version)-apache & & 
  . / configure \ 
  — prefix = $ (php_prefix) \ 
  — with-apxs = / usr / local / modperl / bin / apxs \ 
  — with-mysql = / usr / local / mysql \ 
  — with-gd = / usr / local \ 
  — enable-versioning \ 
  — enable-mbstring \ 
  — enable-mbstr-enc-trans \ 
  — enable-mbregex & & \ 
  make & & \ 
  make install & & \ 
  [-F $ (php_prefix) / lib / php.ini] | | \ 
  cp php.ini-dist $ (php_prefix) / lib / php.ini) 

  # CGI 
  (cd php-$ (php_version)-cgi & & 
  . / configure \ 
  — prefix = $ (php_prefix) \ 
  — enable-force-cgi-redirect \ 
  — with-mysql = / usr / local / mysql \ 
  — with-gd = / usr / local \ 
  — enable-versioning \ 
  — enable-mbstring \ 
  — enable-mbstr-enc-trans \ 
  — enable-mbregex & & \ 

  make install 
  Problems and solutions 1: 
  1, compiled perl module following error: 
  # perl Makefile.PL APACHE_SRC =.. / apache_1.3.31/src USE_APACI = 1 USE_DSO = $ _MOD_PERL_DSO EVERYTHING = 1 NO_HTTPD = 1 PREP_HTTPD = 1 
  Will configure via APACI 
  Configure mod_perl with ../apache_1.3.31/src? [Y] y 
  cp apaci / Makefile.libdir ../apache_1.3.31/src/modules/perl/Makefile.libdir 
  cp apaci / Makefile.tmpl ../apache_1.3.31/src/modules/perl/Makefile.tmpl 
  cp apaci / README ../apache_1.3.31/src/modules/perl/README 
  cp apaci / configure ../apache_1.3.31/src/modules/perl/configure 
  cp apaci / libperl.module ../apache_1.3.31/src/modules/perl/libperl.module 
  cp apaci / mod_perl.config.sh ../apache_1.3.31/src/modules/perl/mod_perl.config.sh 
  cp apaci / load_modules.pl ../apache_1.3.31/src/modules/perl/load_modules.pl 
  cp apaci / find_source ../apache_1.3.31/src/modules/perl/find_source 
  cp apaci / apxs_cflags ../apache_1.3.31/src/modules/perl/apxs_cflags 
  cp apaci / perl_config ../apache_1.3.31/src/modules/perl/perl_config 
  cp apaci / mod_perl.exp ../apache_1.3.31/src/modules/perl/mod_perl.exp 
  PerlDispatchHandler ……… enabled 
  PerlChildInitHandler …….. enabled 
  PerlChildExitHandler …….. enabled 
  PerlPostReadRequestHandler .. enabled 
  PerlTransHandler ………… enabled 
  PerlHeaderParserHandler ….. enabled 
  PerlAccessHandler ……….. enabled 
  PerlAuthenHandler ……….. enabled 
  PerlAuthzHandler ………… enabled 
  PerlTypeHandler …………. enabled 
  PerlFixupHandler ………… enabled 
  PerlHandler …………….. enabled 
  PerlLogHandler ………….. enabled 
  PerlInitHandler …………. enabled 
  PerlCleanupHandler ………. enabled 
  PerlRestartHandler ………. enabled 
  PerlStackedHandlers ……… enabled 
  PerlMethodHandlers ………. enabled 
  PerlDirectiveHandlers ……. enabled 
  PerlTableApi ……………. enabled 
  PerlLogApi ……………… enabled 
  PerlUriApi ……………… enabled 
  PerlUtilApi …………….. enabled 
  PerlFileApi …………….. enabled 
  PerlConnectionApi ……….. enabled 
  PerlServerApi …………… enabled 
  PerlSections ……………. enabled 
  PerlSSI ………………… enabled 
  Will run tests as User: 'nobody' Group: 'wheel' 
  Checking CGI.pm VERSION ………. ok 
  Checking for LWP:: UserAgent …… failed 
  Can't locate LWP / UserAgent.pm in @ INC (@ INC contains:. / Lib / usr/local/lib/perl5/site_perl/5.005/i386-freebsd / usr/local/lib/perl5/site_perl/5.005. / usr/libdata/perl/5.00503/mach / usr/libdata/perl/5.00503) at Makefile.PL line 1157. 

  The libwww-perl library is needed to run the test suite. 
  Installation of this library is recommended, but not required. 

  Checking for HTML:: HeadParser …. failed 
  Can't locate HTML / HeadParser.pm in @ INC (@ INC contains:. / Lib / usr/local/lib/perl5/site_perl/5.005/i386-freebsd / usr/local/lib/perl5/site_perl/5.005. / usr/libdata/perl/5.00503/mach / usr/libdata/perl/5.00503) at Makefile.PL line 1175. 

  The HTML-Parser package is needed (by libwww-perl) to run the test suite. 
  Checking if your kit is complete … 
  Looks good 
  Writing Makefile for Apache 
  Writing Makefile for Apache:: Connection 
  Writing Makefile for Apache:: Constants 
  Writing Makefile for Apache:: File 
  Writing Makefile for Apache:: Leak 
  Writing Makefile for Apache:: Log 
  Writing Makefile for Apache:: ModuleConfig 
  Writing Makefile for Apache:: PerlRunXS 
  Writing Makefile for Apache:: Server 
  Writing Makefile for Apache:: Symbol 
  Writing Makefile for Apache:: Table 
  Writing Makefile for Apache:: URI 
  Writing Makefile for Apache:: Util 
  Writing Makefile for mod_perl 
  Download and install 
  If you need more modules in particular, can be installed through CPAN perl modules, as follows: 
  # perl-MCPAN-e shell 

  / usr/local/lib/perl5/5.8.6/CPAN/Config.pm initialized. 

  CPAN is the world-wide archive of perl resources. It consists of about 
  100 sites that all replicate the same contents all around the globe. 
  Many countries have at least one CPAN site already. The resources 
  found on CPAN are easily accessible with the CPAN.pm module. If you 
  want to use CPAN.pm, you have to configure it properly. 

  If you do not want to enter a dialog now, you can answer 'no' to this 
  question and I'll try to autoconfigure. (Note: you can revisit this 
  dialog anytime later by typing 'o conf init' at the cpan prompt.) 

  Are you ready for manual configuration? [Yes] 

  The following questions are intended to help you with the 
  configuration. The CPAN module needs a directory of its own to cache 
  important index files and maybe keep a temporary mirror of CPAN files. 
  This may be a site-wide directory or a personal directory. 

  First of all, I'd like to create this directory. Where? 

  CPAN build and cache directory? [/ Root / .cpan] 

  If you want, I can keep the source files after a build in the cpan 
  home directory. If you choose so then future builds will take the 
  files from there. If you don't want to keep them, answer 0 to the 
  next question. 

  How big should the disk cache be for keeping the build directories 
  with all the intermediate files? 

  Cache size for build directory (in MB)? [10] 

  By default, each time the CPAN module is started, cache scanning 
  is performed to keep the cache size in sync. To prevent from this, 
  disable the cache scanning with 'never'. 

  Perform cache scanning (atstart or never)? [Atstart] 

  To considerably speed up the initial CPAN shell startup, it is 
  possible to use Storable to create a cache of metadata. If Storable 
  is not available, the normal index mechanism will be used. 

  Cache metadata (yes / no)? [Yes] 

  The next option deals with the charset your terminal supports. In 
  general CPAN is English speaking territory, thus the charset does not 
  matter much, but some of the aliens out there who upload their 
  software to CPAN bear names that are outside the ASCII range. If your 
  terminal supports UTF-8, you say no to the next question, if it 
  supports ISO-8859-1 (also known as LATIN1) then you say yes, and if it 
  supports neither nor, your answer does not matter, you will not be 
  able to read the names of some authors anyway. If you answer no, names 
  will be output in UTF-8. 

  Your terminal expects ISO-8859-1 (yes / no)? [Yes] 

  If you have one of the readline packages (Term:: ReadLine:: Perl, 
  Term:: ReadLine:: Gnu, possibly others) installed, the interactive CPAN 
  shell will have history support. The next two questions deal with the 
  filename of the history file and with its size. If you do not want to 
  set this variable, please hit SPACE RETURN to the following question. 

  File to save your history? [/ Root / .cpan / histfile] 
  Number of lines to save? [100] 

  The CPAN module can detect when a module that which you are trying to 
  build depends on prerequisites. If this happens, it can build the 
  prerequisites for you automatically ( 'follow'), ask you for 
  confirmation ( 'ask'), or just ignore them ( 'ignore'). Please set your 
  policy to one of the three values. 

  Policy on building prerequisites (follow, ask or ignore)? [Ask] 

  The CPAN module will need a few external programs to work properly. 
  Please correct me, if I guess the wrong path for a program. Don't 
  panic if you do not have some of them, just press ENTER for those. To 
  disable the use of a download program, you can type a space followed 
  by ENTER. 

  Where is your gzip program? [/ Usr / bin / gzip] 
  Where is your tar program? [/ Usr / bin / tar] 
  Warning: unzip not found in PATH 
  Where is your unzip program? [] 
  Where is your make program? [/ Usr / bin / make] 
  Warning: lynx not found in PATH 
  Where is your lynx program? [] 
  Warning: wget not found in PATH 
  Where is your wget program? [] 
  Warning: ncftpget not found in PATH 
  Where is your ncftpget program? [] 
  Warning: ncftp not found in PATH 
  Where is your ncftp program? [] 
  Where is your ftp program? [/ Usr / bin / ftp] 
  Warning: gpg not found in PATH 
  Where is your gpg program? [] 
  What is your favorite pager program? [More] 
  What is your favorite shell? [/ Bin / csh] 

  Every Makefile.PL is run by perl in a separate process. Likewise we 
  run 'make' and 'make install' in processes. If you have any 
  parameters (eg PREFIX, LIB, UNINST or the like) you want to pass 
  to the calls, please specify them here. 

  If you don't understand this question, just press ENTER. 

  Parameters for the 'perl Makefile.PL' command? 
  Typical frequently used settings: 

  PREFIX = ~ / perl non-root users (please see manual for more hints) 

  Your choice: [] 
  Parameters for the 'make' command? 
  Typical frequently used setting: 

  – j3 dual processor system 

  Your choice: [] 
  Parameters for the 'make install' command? 
  Typical frequently used setting: 

  UNINST = 1 to always uninstall potentially conflicting files 

  Your choice: [] 

  Sometimes you may wish to leave the processes run by CPAN alone 
  without caring about them. As sometimes the Makefile.PL contains 
  question you're expected to answer, you can set a timer that will 
  kill a 'perl Makefile.PL' process after the specified time in seconds. 

  If you set this value to 0, these processes will wait forever. This is 
  the default and recommended setting. 

  Timeout for inactivity during Makefile.PL? [0] 

  If you're accessing the net via proxies, you can specify them in the 
  CPAN configuration or via environment variables. The variable in 
  the $ CPAN:: Config takes precedence. 

  Your ftp_proxy? 
  Your http_proxy? 
  Your no_proxy? 
  You have no / root / .cpan / sources / MIRRORED.BY 
  I'm trying to fetch one 
  LWP not available 
  CPAN: Net:: FTP loaded ok 
  Fetching with Net:: FTP: 
  Couldn't fetch MIRRORED.BY from ftp.perl.org 
  Fetching with Net:: FTP 
  Couldn't fetch MIRRORED.BY.gz from ftp.perl.org 
  Issuing "/ usr / bin / ftp-n" 
  Trying … 
  Connected to ftp.cpan.ddns.develooper.com. 
  220 Welcome to the ftp.linux.hr FTP service. 
  331 Please specify the password. 
  230 – 
  230-Ovo je ftp.linux.hr, FTP posluzitelj Hrvatske Udruge Linux Korisnika. 
  230 – 
  230-Pogledajte README datoteku za opis sadrzaja na nasem posluzitelju. 
  230 – 
  230-CD ISO imagei su na iso.linux.hr! 
  230 – 
  230 – - ftpadmin@linux.hr 
  230 Login successful. 
  Remote system type is UNIX. 
  Using binary mode to transfer files. 
  Local directory now / root / .cpan / sources 
  250 Directory successfully changed. 
  250 Directory successfully changed. 
  250 Directory successfully changed. 
  200 Switching to Binary mode. 
  local: MIRRORED.BY remote: MIRRORED.BY 
  229 Entering Extended Passive Mode (| | | 47677 |) 
  150 Opening BINARY mode data connection for MIRRORED.BY (159338 bytes). 
  100% |*********************************************** ************************************************** *** | 155 KB 38.58 KB / s 00:00 ETA 
  226 File send OK. 
  159338 bytes received in 00:04 (33.90 KB / s) 
  221 Goodbye. 
  GOT / root / .cpan / sources / MIRRORED.BY 

  Now we need to know where your favorite CPAN sites are located. Push 
  a few sites onto the array (just in case the first on the array won't 
  work). If you are mirroring CPAN to your local workstation, specify a 
  file: URL. 

  First, pick a nearby continent and country (you can pick several of 
  each, separated by spaces, or none if you just want to keep your 
  existing selections). Then, you will be presented with a list of URLs 
  of CPAN mirrors in the countries you selected, along with previously 
  selected URLs. Select some of those URLs, or just keep the old list. 
  Finally, you will be prompted for any extra URLs – file:, ftp:, or 
  http:– that host a CPAN mirror. 

  (1) Africa 
  (2) Asia 
  (3) Central America 
  (4) Europe 
  (5) North America 
  (6) Oceania 
  (7) South America 
  Select your continent (or several nearby continents) [] 2 
  Sorry! Since you don't have any existing picks, you must make a 
  geographic selection. 

  (1) China 
  (2) Hong Kong 
  (3) India 
  (4) Indonesia 
  (5) Iran 
  (6) Israel 
  (7) Japan 
( Cool Malaysia
  (9) Philippines 
  (10) Republic of Korea 
  (11) Russian Federation 
  (12) Saudi Arabia 
  (13) Singapore 
  (14) Taiwan 
  (15) Thailand 
  (16) Turkey 
  Select your country (or several nearby countries) [] 1 
  Sorry! Since you don't have any existing picks, you must make a 
  geographic selection. 

  (1) ftp://mirrors.hknet.com/CPAN 
  (2) http://cpan.linuxforum.net/ 
  (3) http://mirrors.dayouit.com/CPAN/ 
  Select as many URLs as you like (by number), 
  put them on one line, separated by blanks, eg'1 4 5 '[] 2 

  Enter another URL or RETURN to quit: [] 
  New set of picks: 

  commit: wrote / usr/local/lib/perl5/5.8.6/CPAN/Config.pm 
  Terminal does not support AddHistory. 

  cpan shell – CPAN exploration and modules installation (v1.7601) 
  ReadLine support available (try 'install Bundle:: CPAN') 


  OK, in the above "cpan>" can be used, methods of operation: 
  Get help 
  cpan> h 

  CPAN listed on a list of all modules 
  cpan> m 

  Installation of modules, such as the installation of DBI. 
  cpan> install DBI 
  Automatically downloaded from the DBI module to install the entire process. 

  cpan> q 

  If CPAN can not be used, the following error 
  You have no / root / .cpan / sources / MIRRORED.BY 
  I'm trying to fetch one 

  Please, install Net:: FTP as soon as possible. CPAN.pm installs it for you 
  if you just type 
  install Bundle:: libnet 

  Issuing "/ usr / bin / ftp-n" 
  ftp:connect: Operation timed out 
  Not connected. 
  Local directory now / root / .cpan / sources 
  Not connected. 
  Not connected. 
  Not connected. 
  Not connected. 
  Not connected. 
  Bad luck … Still failed! 
  Can't access URL ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY. 

  Please check, if the URLs I found in your configuration file () are valid. 
  The urllist can be edited. Eg with “ o conf urllist push ftp://myurl/'' 

  Cannot fetch MIRRORED.BY 

  Couldn't open: No such file or directory at / usr/libdata/perl/5.00503/CPAN/FirstTime.pm line 417, <STDIN> chunk 22. 

  Not only download and install libnet-1.19.tar.gz, and then running the CPAN. 
  2, the page can not be opened to view the logs are as follows: 
  [Wed Feb 22 21:20:19 2006] [error] Can't locate HTML / Template.pm in @ INC (@ INC contains: / usr / local / kablog / lib / usr/local/lib/perl5/site_perl / 5.8.2/mach / usr/local/lib/perl5/site_perl/5.8.2 / usr/local/lib/perl5/site_perl/5.6.1 / usr/local/lib/perl5/site_perl / usr / local / lib / perl5/5.8.2/BSDPAN / usr/local/lib/perl5/5.8.2/mach / usr/local/lib/perl5/5.8.2. / usr / local / modperl / / usr / local / modperl / lib / perl) at / usr / local / kablog / exec / siteInfo line 10. \ nBEGIN failed – compilation aborted at / usr / local / kablog / exec / siteInfo line 10. \ n 

  Perl module due to the lack of relevant HTML-Template-2.7.tar.gz 
  Modules can be installed. 
  tar xzvf HTML-Template-2.7.tar.gz 
  cd HTML-Template-2.7 
  perl Makefile.PL 
  make test 
  make install 

  Of course, can also be referred to me upstairs the CPAN way to install. 
  3, apache start when errors are as follows: 
  # / usr / local / modperl / bin / apachectl start 
  Syntax error on line 16 of / usr / local / modperl / conf / misc.conf: 
  Can't locate Apache / DBI.pm in @ INC (@ INC contains: / usr/local/lib/perl5/site_perl/5.005/i386-freebsd / usr/local/lib/perl5/site_perl/5.005. / Usr / libdata / perl/5.00503/mach / usr/libdata/perl/5.00503 / usr / local / modperl / / usr / local / modperl / lib / perl) at (eval 3) line 3. 

  / usr / local / modperl / bin / apachectl start: httpd could not be started 

  The reasons for the lack of perl module, download and install the Apache-DBI-0.9901.tar.gz, can also CPAN installation, problem-solving. 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google
  • DZone
  • Netvouz
  • NewsVine
  • Technorati

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button