Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
Python and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Lua, etc
 
Linux and httpd file system layout - LAMP server

The Linux / Unix file system tree is a complex one ... but for the administrator of a LAMP server, there are just a few critical directories / areas he'll be working in most of the time.

THE UNIX / LINUX FILE TREE


1. Extra software you install - perhaps a version of httpd that you've compiled yourself, MySQL, and Java and Tomcat if you're using them - go in /usr/local

2. Configuration files go in /etc

3. User's own information, and potentially the web site documents, go under /home

4. Log files, mail queues, print spools, etc., go under /var; I'm sure there's a standard and easy word to represent this grouping, but I can't come up with it

5. /tmp is an area that processes use for temporary storage, and sometimes it might need to be cleaned up

6. Process startup and shutdown scripts are kept in /etc/init.d, with symbolic links in directories such as rc3.d to control which of them are run (and in what order).

THE APACHE HTTPD FILE TREE

The Apache httpd server, when installed from source, defaults to a clean install in /usr/local/apache2. You'll want to move the web site, and log files too, to other areas as you configure it.


The main executable files are in the bin subdirectory (1) ...

 httpd - the main daemon
 apachectl - the daemon controller to start and stop
 apxs - to tell other software builds the release & config

The configuration file is in the conf directory (2) ... a file called httpd.conf. Other sample files are provided too in order to help you change the daemon's behaviour easily by reference to examples.

Log files (3) can be kept in the server area but they'll commonly be move out elsewhere, together with the documents and programs directories ...


The document root will be in a directory called - well - you've a big choice of name and there's no real standard - htdocs or html or www or website or public_html or httpdocs ... (4)

Programs to be run under the Common Gateway Interface are placed in cgi-bin (5) ... even if they're not really binary programs very often these days, but rather scripts in Perl or Python.

Directories such as data, private and include (6) are used to hold information needed as the website runs through CGI scripts or embedded languages such as PHP, but which shouldn't have their own URLs.



See also Linux Web Server training

Please note that articles in this section of our web site were current and correct to the best of our ability when published, but by the nature of our business may go out of date quite quickly. The quoting of a price, contract term or any other information in this area of our website is NOT an offer to supply now on those terms - please check back via our main web site

Related Material

Web Application Deployment - Linux - General
  [4259] Upgrading our training systems to all the current stable versions - (2014-04-07)
  [3902] Shell - Grep - Sed - Awk - Perl - Python - which to use when? - (2012-10-22)
  [3219] How do I become a Linux System Administrator? - (2011-03-28)
  [2035] 1234567890 ... coming up on Friday 13th - (2009-02-11)
  [2023] sw_vers - what version of OSX am I running? - (2009-02-03)

Web Application Deployment - Backups and File System Management
  [4481] Extracting data from backups to restore selected rows from MySQL tables - (2015-05-01)
  [4405] Backup procedures - via backup server - (2015-01-24)
  [4400] Commenting out an echo killed my bash backup script - (2015-01-19)
  [4390] Checking MySQL database backups have worked (not failed) - (2015-01-10)
  [4115] More or less back - what happened to our server the other day - (2013-06-14)
  [4063] Backups by crossover between network centres - setting up automatic scp transfers - (2013-04-13)
  [4056] An overpractical test of our backup strategy! - (2013-03-30)
  [2299] How much space does my directory take - Linux - (2009-07-20)
  [1893] Some Linux and Unix tips - (2008-11-18)
  [1801] Will your backups work if you have to restore them? - (2008-09-18)
  [1765] Dialects of English and Unix - (2008-08-21)
  [1648] The tourists guide to Linux - (2008-05-20)
  [1439] Linux / Unix - layout of operating system files - (2007-11-20)
  [1288] Linux run states, shell special commands, and directory structures - (2007-08-03)
  [1023] Finding public writeable things on your linux file system - (2007-01-06)
  [1013] Copy multiple files - confusing error message from cp - (2006-12-30)
  [754] tar, jar, war, ear, sar files - (2006-06-10)
  [735] Boys will be boys, saved by Ubuntu - (2006-05-27)
  [703] Copying files and preserving ownership - (2006-04-28)
  [593] Finding where the disc space has gone - (2006-02-06)
  [554] What backup is adequate? - (2006-01-04)
  [334] Symbolic links and hard links - (2005-06-02)
  [153] Linux - where to put swap space - (2004-12-16)

Web Application Deployment - Apache httpd - Sourcing, Installation, Testing
  [4437] Adding a PHP build option, rotating an image based on camera data, and a new look at thumbnails in PHP - (2015-02-22)
  [3426] Automed web site testing scripted in Ruby using watir-webdriver - (2011-09-09)
  [2520] Global and Enable - two misused words! - (2009-11-30)
  [2184] Choosing the right version of Java and Tomcat - (2009-05-16)
  [2096] Where is my new Apache httpd installed - (2009-03-22)
  [2080] Using ApacheBench and jconsole to test and monitor Tomcat - (2009-03-14)
  [1945] Summary - Apache httpd build on Linux - (2008-12-14)
  [1768] What is built in to this httpd and PHP? - (2008-08-23)
  [1731] Apache httpd, MySQL, PHP - installation procedure - (2008-08-01)
  [1707] Configuring Apache httpd - (2008-07-12)
  [1455] Connecting to MySQL 5 from PHP on Mac OSX Leopard - (2007-12-03)
  [1449] Upgrade Mac OSX to Leopard, Web Server Apache httpd config lost - (2007-11-29)
  [1292] DHCP automatic IP address v Static IP - (2007-08-06)
  [1095] Apache httpd , browser, MySQL and MySQL client downloads - (2007-02-28)
  [982] Notes from the white board - (2006-12-14)
  [907] Browser -> httpd -> Tomcat -> MySQL. Restarting. - (2006-10-28)
  [660] Stopping and restarting Apache httpd cleanly - (2006-03-29)
  [550] 2006 - Making business a pleasure - (2006-01-01)
  [526] Apache httpd - serving web documents from different directories - (2005-12-12)
  [523] Apache httpd release 2.2 - (2005-12-10)

Web Application Deployment - Further httpd Configuration
  [4307] Identifying and clearing denial of service attacks on your Apache server - (2014-09-27)
  [4001] Helping search engines with appropriate 400 error codes - (2013-02-11)
  [3955] Building up from a small PHP setup to an enterprise one - (2012-12-16)
  [3862] Forwarding a whole domain, except for a few directories - Apache http server - (2012-09-17)
  [3635] Parse error: parse error, unexpected T_STRING on brand new web site - why? - (2012-03-03)
  [3449] Apache Internal Dummy Connection - what is it and what should I do with it? - (2011-09-19)
  [3133] An image from a website that occasionally comes out as hyroglyphics - (2011-01-14)
  [2900] Redirecting a page - silent, temporary or permanent? - (2010-08-03)
  [2478] How did I do THAT? - (2009-10-26)
  [2272] Monitoring and loading tools for testing Apache Tomcat - (2009-07-07)
  [2060] Database connection Pooling, SSL, and command line deployment - httpd and Tomcat - (2009-03-01)
  [1974] Moving a directory on your web site - (2009-01-03)
  [1955] How to avoid duplicating web page maintainance - (2008-12-20)
  [1954] mod_rewrite for newcomers - (2008-12-20)
  [1939] mod_proxy_ajp and mod_proxy_balancer examples - (2008-12-13)
  [1778] Pointing all the web pages in a directory at a database - (2008-08-30)
  [1767] mod_proxy and mod_proxy_ajp - httpd - (2008-08-22)
  [1762] WEB-INF (Tomcat) and .htaccess (httpd) - (2008-08-20)
  [1707] Configuring Apache httpd - (2008-07-12)
  [1636] What to do if the Home Page is missing - (2008-05-08)
  [1619] User and Group settings for Apache httpd web server - (2008-04-22)
  [1566] Strange behaviour of web directory requests without a trailing slash - (2008-03-06)
  [1564] Default file (MiMe types) for Apache httpd and Apache Tomcat - (2008-03-04)
  [1554] Online hotel reservations - Melksham, Wiltshire (near Bath) - (2008-02-24)
  [1551] Which modules are loaded in my Apache httpd - (2008-02-23)
  [1381] Using a MySQL database to control mod_rewrite via PHP - (2007-10-06)
  [1377] Load Balancing with Apache mod_jk (httpd/Tomcat) - (2007-10-02)
  [1355] .php or .html extension? Morally Static Pages - (2007-09-17)
  [1351] Compressing web pages sent out from server. Is it worth it? - (2007-09-14)
  [1207] Simple but effective use of mod_rewrite (Apache httpd) - (2007-05-27)
  [1121] Sharing the load with Apache httpd and perhaps Tomcat - (2007-03-29)
  [1080] httpd.conf or .htaccess? - (2007-02-14)
  [1009] Passing GET parameters through Apache mod_rewrite - (2006-12-27)
  [934] Clustering, load balancing, mod_rewrite and mod_proxy - (2006-11-21)
  [853] To list a directory under httpd on a web server, or not? - (2006-09-02)
  [755] Using different URLs to navigate around a single script - (2006-06-11)
  [662] An unhelpful error message from Apache httpd - (2006-03-30)
  [649] Denial of Service ''attack'' - (2006-03-17)
  [631] Apache httpd to Tomcat - jk v proxy - (2006-03-03)
  [550] 2006 - Making business a pleasure - (2006-01-01)
  [526] Apache httpd - serving web documents from different directories - (2005-12-12)
  [466] Separating 'per instance' data from binaries and web sites - (2005-10-16)
  [345] Spotting a denial of service attack - (2005-06-12)

resource index - Deployment
Solutions centre home page

You'll find shorter technical items at The Horse's Mouth and delegate's questions answered at the Opentalk forum.

At Well House Consultants, we provide training courses on subjects such as Ruby, Lua, Perl, Python, Linux, C, C++, Tcl/Tk, Tomcat, PHP and MySQL. We're asked (and answer) many questions, and answers to those which are of general interest are published in this area of our site.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2019: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01225 708225 • FAX: 01225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/solutions/general- ... erver.html • PAGE BUILT: Wed Mar 28 07:47:11 2012 • BUILD SYSTEM: wizard