Here is how the directories are laid out on my server (I inherited this and cannot change at the moment) -
/var/www/<stuff for the web>
/home/project/src/static/<some CSS, some JavaScript, etc.>
In the grand scheme of not wanting to have duplicate files in different directories I tried to include some files like this -
<link rel="stylesheet" href="/home/project/src/static/css/<file>.css" type="text/css" />
<script src="/home/project/src/static/lib/<file>.js" type="text/javascript"></script>
I get a 404 error for each file I have tried to include this way. I have modified the path to the 'home' directory, attempting to traverse up from /var/www/
to /home/
by adding ..
to the beginning of the path string, but no joy.
Then, after confirming that mod_alias was installed, I set about adding a path alias directive to my config file:
Alias /home/project/src/static/ /home/project/src/static/
<Directory /home/project/src/static/>
Order allow,deny
Allow from all
</Directory>
Restarted Apache, but still no luck. I tried this with and without the trailing slash.
One other thing that I have confirmed is that open_basedir
is not set in the php.ini as I understand having it set can produce problems when trying to access files outside of the web root.
What can I do to make these files findable from the web root outside of copying the directory and placing it in the web root folder?