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
Web Application Deployment - Linux - General [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 [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 [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 [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.