ubuntu-8.04-apache-easy-install-and-configuration-and-source-build apt-get purge x-11 ed install emacs21-bin-common install emacs21-common install emacs21-el install emacs21-nox install emacsen-common gnome-bin install gnome-libs-data install joe mailx install psa-courier-imap install psa-courier-imap-add install psa-qmail install sendmail-base deinstall sendmail-bin deinstall sendmail-cf install sendmail-doc install - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - THE EASY WAY WITH APT-GET apt-get install apache2.2-common - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SHOWS YOU WHAT'S ALREADY INSTALLED dpkg --get-selections > installed-software.txt apt-get autoremove dpkg --set-selections < installed-software.txt dselect //allow to unselect packages? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - If required you can remove & install apache2-common again apt-get purge apache2-common cd /etc/apache2 rm -R * //be careful that you really are in /etc/apache2!!!! cd .. rmdir apache2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The configuration file is at (Ubuntu) /etc/apache2/apache2.conf Log files at /var/log/apache2/access.log (error.log) Whenever you modify a configuration file you will have to run the following commands (ubuntu specific) /etc/init.d/apache2 stop /etc/init.d/apache2 start To see the changes… or a slightly “nicer” command is to use the Apache control command: /usr/sbin/apache2ctl directive e.g. sudo apache2ctl graceful Directives: start / stop / graceful (restarts w/ aborting connections) / restart / status / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SECURITY: SEE apache-setup-security.txt for tips on how to make it more secure... e.g. ServerTokens Full to Server Tokens Prod ServerSignature Off UseCanonicalName Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ports.conf contains the listen ports config, e.g. Listen 80 Listen 443 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SLIGHT OPTIMIZATIONS: /etc/apache2/apache2.conf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - STATISTICS AND PERFORMANCE apt-get install apache2.2-common apt-get install apache2 df -h goes from 450MB to 461MB DEFAULT: free returns 118MB used ps -aux USER PID CPU MEM VSZ RSS TTY START COMMAND root 4417 0.0 0.6 10472 2584 ? Ss 15:30 0:00 /usr/sbin/apache2 -k start www-data 4418 0.0 0.4 10244 1780 ? S 15:30 0:00 /usr/sbin/apache2 -k start www-data 4420 0.0 0.6 231808 2396 ? Sl 15:30 0:00 /usr/sbin/apache2 -k start www-data 4424 0.0 0.6 231808 2400 ? Sl 15:30 0:00 /usr/sbin/apache2 -k start VSZ is a decimal integer, the size in kilobytes of the process in virtual memory. VSZ includes RSS... Virtual memory usage of entire process = VmLib + VmExe + VmData + VmStk RSS is real memory (resident set) size of the process in pages in 1KB units Thus VSZ for apache2 = 231,808 KB x 2 = 500KB... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Dynamically loaded modules: code is loaded when the module is required Static mode comes at a price — the more modules, the more memory you use. Thus, a forked multi-processing module can have a significant effect on the machine's memory requirements. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MPM WORKER versus PREFORK Multi-Processing Module with PHP... http://brian.moonspot.net/2008/02/13/apache-worker-and-php/ mpm_prefork_module each apache/php process allocates it's own memory, at ~15MB per process x 50 = 750MB RAM Having a prefork Apache/PHP process that has 15MB of RAM allocated serve a 10k jpeg image or some CSS file is a waste of resources. mpm_worker_module each worker process can have 5 child processes with 10 threads BUT they can reuse memory from other threads in the same process YOU cannot use radical php extensions ...