I have the following file structure for a php application running with apache server in a debian computer.
/var/www/project/
|-- index/index.php
|-- local
|-- view
| `-- *.php
|-- model
| `-- *.php
|-- controller
| `-- *.php
|-- supportfiles
|-- css
| `-- *.css
|-- javascript
`-- *.js
. . .
I've configured apache so that when I type in my browser http://localhost, apache loads /var/www/project/index/index.php.
To do this, I've changed two files
/etc/apache2/sites-available/000-default.conf
where I set
DocumentRoot /var/www/project/index/
and the file
/etc/apache2/apache2.conf
where I also set
<Directory /var/www/project/index/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
This changes seem to work ok since http://localhost loads the intended index.php file located in the /var/www/project/index directory; however, I'm unable to load java script files such as the following
<!-- <script language="JavaScript" src="../local/supportfiles/javascript/validation.js"></script> -->
What is the problem here? I'm guessing the problem is that apache does not have access to /var/www/project/supportfiles/javasecript/*.js. The original apache configuration (where the apache root directory was /var/www/ and had to load the index.php file by typing http://localhost/project/index) loaded the java script files normally.
/var/www/project/index/. Apache cannot serve a relative path above that