Back to commands

Hosting Operations

Read-only, can be slow

Show Enabled Apache Sites

You need to see which Apache virtual host files are enabled.

Command

find fixtures/apache/sites-enabled -maxdepth 1 -type l -printf '%f -> %l\n' | sort

Before you run this

System impact: Read-only. Can create load on large logs, directories, filesystems, or process tables.

When not to use it: Do not remove or create symlinks from this output unless you intend to enable or disable a site.

Expected output

Enabled Apache site filenames and their symlink targets.

System impact

Read-only, can be slow. Nothing changes. The command lists enabled Apache site symlinks.

Scope this to the smallest useful path or service on busy systems.

Recovery / rollback: no state is changed.

When to use it

Use when Apache ignores a virtual host file you edited.

When not to use it

Do not remove or create symlinks from this output unless you intend to enable or disable a site.

Explanation-only example

Illustrated output, not a live lab run

This example is intentionally illustrative. It shows the command shape without killing real processes or changing your machine.

demo@lab:~$

$ find sample-files/apache/sites-enabled -maxdepth 1 -type l -printf '%f -> %l\n' | sort

app.conf -> ../sites-available/app.conf
example.conf -> ../sites-available/example.conf

$ find sample-files/apache/sites-available -maxdepth 1 -type f | sort

sample-files/apache/sites-available/app.conf
sample-files/apache/sites-available/example.conf

$ grep -RInE '<VirtualHost|ServerName' sample-files/apache/sites-enabled

sample-files/apache/sites-enabled/app.conf:1:<VirtualHost *:443>
sample-files/apache/sites-enabled/app.conf:2:    ServerName example.com
sample-files/apache/sites-enabled/example.conf:1:<VirtualHost *:80>
sample-files/apache/sites-enabled/example.conf:2:    ServerName example.com
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. find fixtures/apache/sites-enabled -maxdepth 1 -type l -printf '%f -> %l\n' | sort
  2. find fixtures/apache/sites-available -maxdepth 1 -type f | sort
  3. grep -RInE '<VirtualHost|ServerName' fixtures/apache/sites-enabled

next steps

Related commands

Hosting Operations Can be slow

Group Writable Files by Owning Group

Group-writable files are not automatically wrong, but the owning group decides the risk.

find fixtures/perm-audit -type f -perm -0020 -printf '%g %M %p\n' | sort
Hosting Operations Can be slow

Show Release Directory Ages

See your newest release directories without opening a dashboard.

find releases/ -mindepth 1 -maxdepth 1 -type d -printf '%T@ %TY-%Tm-%Td %TH:%TM %p\n' | sort -nr | head -10 | cut -d' ' -f2-
Hosting Operations Can be slow

Find Release Files Writable Outside the Owner

A release file that someone besides the owner can modify deserves a second look.

find fixtures/perm-audit/releases/2026-06-25 -type f -perm /0022 -printf '%M %u:%g %p\n' | sort
Hosting Operations Can be slow

List Restore Points Before a Drill

A restore drill starts by proving which backups actually exist.

cd restore-dr && find backups -maxdepth 2 -type f -name MANIFEST.txt -printf '%TY-%Tm-%Td %TH:%TM %h\n' | sort -r
Hosting Operations Can be slow

Exclude the Current Release from Cleanup

Release cleanup should prove what current points to before listing old directories.

current=$(readlink -f /lab/disk-inode-cleanup/home/deploy/current); find /lab/disk-inode-cleanup/home/deploy/releases -mindepth 1 -maxdepth 1 -type d ! -samefile "$current" -printf '%TY-%Tm-%Td %p\n' | sort
Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • lpic1:103-gnu-unix-commands
  • lpic1:104-filesystems-permissions-fhs
  • lfcs:essential-commands
  • lfcs:operations-deployment
  • lfcs:services-logs
  • lfcs:storage
  • linuxplus:automation-scripting
  • linuxplus:provisional
  • linuxplus:system-management
  • risk:read-only

Useful for

  • LPIC-1 style command-line practice
  • LFCS style performance tasks
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.