Using Symlinks to serve web projects outside htdocs in Apache (LAMP stack) on Linux

Опубликовано: 16 Май 2026
на канале: Bishal Shrestha | SWE
52
1

In this tutorial, we’ll demonstrate how to use symbolic links (symlinks) to serve web projects located outside the default htdocs directory in an Apache server running within a LAMP stack on Linux. This approach helps you organize your projects outside of the standard web root while ensuring they are still accessible to Apache, improving your workflow and project management.

Key topics covered:
Creating symlinks for projects outside htdocs
Configuring Apache to serve these projects seamlessly
Adjusting permissions to ensure proper access and security
Verifying the symlink setup for smooth operation

Whether you're working on multiple projects or need to manage your web files more efficiently, this method will streamline your development process and improve file organization.

Prerequisites:
A LAMP stack (Linux, Apache, MySQL, PHP) installed on your system
Basic knowledge of terminal commands and Linux file systems