Installation of Apache Objectives Install Apache webserver Contents
Installation of Apache • Objectives – Install Apache webserver • Contents – – Compile in module support Compile sourcecode Installing apache Verify installation • Practical – Install Apache • Summary
Unzip & Preconfigure Apache source • Download latest version of Apache 2 # cd /usr/local/src # wget http: //apache. dataphone. se/httpd-2. 2. 0. tar. gz • ”Unzip” Apache # tar xvfz httpd-2. 2. 0. tar. gz – This creates a directory with same name as filename above – This is called the Apache source tree • Get Apache dependencies YAST: YAST: openldap-devel is needed by httpd-2. 2. 0 -1 db 4 -devel is needed by httpd-2. 2. 0 -1 expat-devel is needed by httpd-2. 2. 0 -1 pkgconfig is needed by httpd-2. 2. 0 -1 doxygen is needed by apr – Install them with yast if you do not have much time leftover • Please remove existing apache installations before
Unzip & Preconfigure Apache source • Get Apache Portable Runtime # # cd /usr/local/src wget http: //ftp. solace. mh. se/pub/mirrors/www. apache. org/apr-1. 2. 2. tar. gz wget http: //ftp. solace. mh. se/pub/mirrors/www. apache. org/apr-util-1. 2. 2. tar. gz wget http: //ftp. solace. mh. se/pub/mirrors/www. apache. org/apr-iconv-1. 1. 1. tar. gz • Unzip and make all 3 APR’s # tar xvfz apr-1. 2. 2. tar. gz && cd apr-1. 2. 2 &&. /configure && make install # tar xvfz apr-util-1. 2. 2. tar. gz && cd. . /apr-util-1. 2. 2 &&. /configure --with-apr=/usr/local/apr # make && make install tar xvfz apr-1. 2. 2 -iconv-1. 1. 1. tar. gz && cd. . /apr-1. 2. 2 -iconv-1. 1. 1 &&. /configure – #edit /etc/ld. so. conf and add /usr/local/apr/lib # make && make install • Preconfigure Apache sourcecode – Process take between 5 to 30 minutes to complete! # cd. . /httpd-2. 2. 0 #. /configure --enable-layout=Su. SE --libexecdir=/usr/lib/httpd/modules --enable-mods-shared=all • Please remove existing apache installations before.
Compile and Install Apache • Compile Apache, using previous created config # make – This procedure can take anything between 10 to 90 minutes • Install Apache # make install – This will install Apache binaries and modules at proper places – Also configuration files are installed • Backup your Apache config files – You will soon start to mess with them, good to keep handy # cd /etc/httpd # cp httpd. conf. org – Apache have backed up in /etc/httpd/original • We selected layout=Su. SE – Configuration files: /etc/httpd and /etc/httpd/extra – Documentroot /usr/local/httpd/htdocs – Logfiles /var/log/httpd
Apache statistical engine • Open Apache configuration file /etc/httpd. conf then find and uncomment: # Real-time info on requests and configuration # Include /etc/httpd/extra/httpd-info. conf • Like this: # Real-time info on requests and configuration Include /etc/httpd/extra/httpd-info. conf • Now open /etc/httpd/extra/httpd-info. conf and modify: <Location /server-status> Set. Handler server-status Order deny, allow Deny from all Allow from localhost, . my-site. com </Location> • Start apache 2 for first time – First time logfiles are missing so we start and stop apache one time, check the logbook at /var/log/httpd/access and /var/log/httpd/error # apachectl start ; apachectl stop ; apachectl start
- Slides: 5