Which Linux directory is often used for web server files and data?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Prepare for the Red Hat Certified Architect Exam with our comprehensive quiz. Master your skills with multiple choice questions and detailed explanations. Gear up to excel!

The /srv directory is the appropriate choice for storing files and data related to services provided by the system, including web servers. The Filesystem Hierarchy Standard (FHS) defines /srv as a location for service-specific data, which means it is commonly used for web content, FTP files, and other service-related data.

In the context of a web server, this directory is often structured to accommodate different services and configurations, making it suitable for serving static and dynamic web content. By default, web server configurations may point to directories within /srv, helping to organize files based on the service they support.

The other directories have different intended purposes. The /var directory is primarily used for variable data such as logs, databases, and application data. The /opt directory is intended for installing add-on application software packages that are not part of the default distribution, while the /lib directory typically contains essential shared library files that are required for system booting and basic operation of programs.

Thus, /srv is specifically aligned with the needs and structure of a web server, serving as the correct answer for this question.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy