-3

Where are website's files stored exactly in a server (XAMP)? For example, if index.php is in the public_html directory, does it mean it is Linux server's file system or is it in the Apache server?

  • `public_html` is a linux folder. Apache just reads files from the file system. It doesn't have it's own structure for files. – Jonathan Kuhn May 18 '15 at 19:11

2 Answers2

1

The files are in the host file system (the Linux file system if you are using Linux of course). The Apache config maps to a directory, commonly through the use of a VirtualHost setting. The mapping would be a port or host name to a physical directory.

Very basic example for Windows XAMP to map localhost

<VirtualHost *>
  DocumentRoot "C:\xampp\htdocs"
  ServerName localhost
</VirtualHost>

Hope that gives you the basic idea of it.

Asta
  • 1,569
  • 13
  • 23
  • Ty, that is what I thought. Could you also tell where database data is stored in, if Apache and MySQL are on the same Linux server? Is RDBMS(MySQL) stored in the Linux file system and the database itself belongs to MySQL? – user2992251 May 18 '15 at 19:26
  • Same idea, MySQL stores the databases as files on the host file system. In this case you don't need to worry quite so much about where it stores them as you will mostly never need to access them that way (unless backing up or something). I'm sure you could probably configure each DB to store in a specific place, the one that comes to mind is Mongo DB . – Asta May 18 '15 at 19:36
  • Even if you are backing up, it is best to use command line tools such as `mysqldump` or web clients such as phpMyAdmin. A file backup of your database is not much use if you need to import it into a different version of MySQL - it is likely it won't import correctly. – halfer May 18 '15 at 19:37
0

Your document root should be specified in the Apache config.

See here.

Community
  • 1
  • 1
jtarleton
  • 57
  • 1
  • 5