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 ”Unzip” Apache –This creates a directory with same name as filename above –This is called the Apache source tree Get Apache dependencies –Install them with yast if you do not have much time leftover Please remove existing apache installations before # cd /usr/local/src # wget # cd /usr/local/src # wget YAST: openldap-devel is needed by httpd YAST: db4-devel is needed by httpd YAST: expat-devel is needed by httpd YAST: pkgconfig is needed by httpd YAST: doxygen is needed by apr YAST: openldap-devel is needed by httpd YAST: db4-devel is needed by httpd YAST: expat-devel is needed by httpd YAST: pkgconfig is needed by httpd YAST: doxygen is needed by apr # tar xvfz httpd tar.gz
Unzip & Preconfigure Apache source Get Apache Portable Runtime Unzip and make all 3 APR’s –edit /etc/ld.so.conf and add /usr/local/apr/lib Preconfigure Apache sourcecode –Process take between 5 to 30 minutes to complete! Please remove existing apache installations before. # cd /usr/local/src # wget # wget # wget # cd /usr/local/src # wget # wget # wget # cd../httpd #./configure --enable-layout=SuSE \ --libexecdir=/usr/lib/httpd/modules \ --enable-mods-shared=all # cd../httpd #./configure --enable-layout=SuSE \ --libexecdir=/usr/lib/httpd/modules \ --enable-mods-shared=all # tar xvfz apr tar.gz && cd apr &&./configure && make && make install # tar xvfz apr-util tar.gz && cd../apr-util &&./configure --with-apr=/usr/local/apr # make && make install # tar xvfz apr-util tar.gz && cd../apr-util &&./configure --with-apr=/usr/local/apr # make && make install # tar xvfz apr iconv tar.gz && cd../apr iconv &&./configure # make && make install # tar xvfz apr iconv tar.gz && cd../apr iconv &&./configure # make && make install
Compile and Install Apache Compile Apache, using previous created config –This procedure can take anything between 10 to 90 minutes Install Apache –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 –Apache have backed up in /etc/httpd/original We selected layout=SuSE –Configuration files: /etc/httpdand /etc/httpd/extra –Documentroot /usr/local/httpd/htdocs –Logfiles /var/log/httpd # make # make install # cd /etc/httpd # cp httpd.conf httpd.conf.org # cd /etc/httpd # cp httpd.conf httpd.conf.org
Apache statistical engine Open Apache configuration file /etc/httpd/httpd.conf then find and uncomment: Like this: Now open /etc/httpd/extra/httpd-info.conf and modify: Start apache2 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 # Real-time info on requests and configuration # Include /etc/httpd/extra/httpd-info.conf # Real-time info on requests and configuration # Include /etc/httpd/extra/httpd-info.conf # Real-time info on requests and configuration Include /etc/httpd/extra/httpd-info.conf # Real-time info on requests and configuration Include /etc/httpd/extra/httpd-info.conf SetHandler server-status Order deny,allow Deny from all Allow from localhost,.my-site.com SetHandler server-status Order deny,allow Deny from all Allow from localhost,.my-site.com # apachectl start ; apachectl stop ; apachectl start