Apache: Difference between revisions

From CLONWiki
Jump to navigation Jump to search
Boiarino (talk | contribs)
No edit summary
Boiarino (talk | contribs)
No edit summary
Line 3: Line 3:
   su
   su
   download 'httpd-2.2.3.tar.gz' from web to '/usr/local/download/'
   download 'httpd-2.2.3.tar.gz' from web to '/usr/local/download/'
   cp /usr/local/download/httpd-2.2.3.tar.gz /usr/local/src
   cp /usr/local/downloads/httpd-2.2.3.tar.gz /usr/local/src
   cd /usr/local/src
   cd /usr/local/src
   gunzip httpd-2.2.3.tar.gz
   gunzip httpd-2.2.3.tar.gz
Line 24: Line 24:
   su
   su
   download 'php-5.2.0.tar.gz' from web to '/usr/local/download/'
   download 'php-5.2.0.tar.gz' from web to '/usr/local/download/'
   cp /usr/local/download/php-5.2.0.tar.gz /usr/local/src
   cp /usr/local/downloads/php-5.2.0.tar.gz /usr/local/src
   cd /usr/local/src
   cd /usr/local/src
   gunzip php-5.2.0.tar.gz
   gunzip php-5.2.0.tar.gz

Revision as of 09:02, 4 January 2008

Apache

 su
 download 'httpd-2.2.3.tar.gz' from web to '/usr/local/download/'
 cp /usr/local/downloads/httpd-2.2.3.tar.gz /usr/local/src
 cd /usr/local/src
 gunzip httpd-2.2.3.tar.gz
 tar xvf httpd-2.2.3.tar
 mv httpd-2.2.3 httpd-2.2.3_clonweb
 cd /usr/local/src/httpd-2.2.3_clonweb
 ./configure --enable-module=so --prefix=/www/apache2.2.3
 make
 make install

make sure that user set to 'apache' (should exist already):

 grep "^User" /www/apache2.2.3/conf/httpd.conf
 emacs /www/apache2.2.3/conf/httpd.conf
 set User (and Group) to 'apache' if necessary


PHP

 su
 download 'php-5.2.0.tar.gz' from web to '/usr/local/download/'
 cp /usr/local/downloads/php-5.2.0.tar.gz /usr/local/src
 cd /usr/local/src
 gunzip php-5.2.0.tar.gz
 tar xvf php-5.2.0.tar
 mv php-5.2.0 php-5.2.0_clonweb
 cd /usr/local/src/php-5.2.0_clonweb
 ./configure --with-mysql --with-apxs2=/www/apache2.2.3/bin/apxs
 make
 ##make install
 cp /usr/local/src/php-5.2.0_clonweb/libs/libphp5.so /www/apache2.2.3/modules

Fix apache config file /www/apache2.2.3/conf/httpd.conf:

 DirectoryIndex index.php index.html
 LoadModule php5_module modules/libphp5.so
 AddType application/x-httpd-php .php
 AddType application/x-httpd-php .php3
 AddType application/x-httpd-php .phtml

Edit /www/apache2.2.3/htdocs/index.html file.

To start/stop apache server do following:

 /www/apache2.2.3/bin/apachectl start
 /www/apache2.2.3/bin/apachectl stop

If it started fine, fix startup script '/etc/rc.d/init.d/httpd' setting correct pathes:

 # config: /www/apache2.2.3/conf/httpd.conf
 # pidfile: /www/apache2.2.3/logs/httpd.pid
 apachectl=/www/apache2.2.3/bin/apachectl
 httpd=${HTTPD-/www/apache2.2.3/bin/httpd}
 pidfile=${PIDFILE-/www/apache2.2.3/logs/httpd.pid}

Modified file is saved as /www/apache2.2.3/httpd.for_etc_init_d, copy it as /etc/init.d/httpd.

Now apache can be controled by following commands:

 /etc/init.d/httpd stop
 /etc/init.d/httpd start
 /etc/init.d/httpd restart

Add apache to the list of services to be started at boot time using:

 /usr/bin/system-config-services