# Css/js files not accessable

**URL:** <https://discourse.cakephp.org/t/css-js-files-not-accessable/1499>\
**Category:** Need Help\
**Created:** [November 9, 2016, 7:06pm UTC](https://discourse.cakephp.org/t/css-js-files-not-accessable/1499 "2016-11-09T19:06:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheMiller](https://avatars.discourse-cdn.com/v4/letter/t/3ec8ea/32.png) [@TheMiller](https://discourse.cakephp.org/u/TheMiller)\
**Post date:** [November 9, 2016, 7:06pm UTC](https://discourse.cakephp.org/t/css-js-files-not-accessable/1499/1 "2016-11-09T19:06:37Z")

</div>

Hello, I might have a configuration error in production setup. But I don’t know which one.

Problem: CSS/JS etc files are not loaded. When I click them in source-viewer (browser), cake says, that the controller is missing (e.g. CssController). But I clicked a css-file.

I think, I have the correct .htaccess-files and vhost.conf.

Filesystem: /var/www/html (user/group = www-data)  
a2enmod rewrite (mod rewrite is active)

Document-Root: /var/www/html  
Webroot: /var/www/html/webroot.

**vhost.conf:**  
\<VirtualHost \*:81\>  
DocumentRoot /var/www/html/webroot  
Servername site.localhost  
SetEnv CAKE\_ENV ${WEB\_ENV}

ErrorLog ${APACHE\_LOG\_DIR}/error.log  
CustomLog ${APACHE\_LOG\_DIR}/access.log combined

\<Directory /var/www/html/webroot\>  
Options Indexes FollowSymLinks MultiViews  
AllowOverride All  
Order Allow,Deny  
Allow from all

**.htaccess of DocumentRoot**  
  
RewriteEngine on  
RewriteRule ^$ webroot/ [L]  
RewriteRule (.\*) webroot/$1 [L]

**.htaccess of Webroot**  
  
RewriteEngine On  
RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteRule ^ index.php [L]

Please help me. I don’t know why this is happening. Developing on windows using theses htaccess, everything is working fine.

Deploying this packet on CentOS is working fine.

Just copied this to another machine (docker machine), this error comes up. Maybe sth. with apache or nginx wrong. (nginx is only a reverse proxy getting data from apache).

Thanks

---

<div class="post-metadata">

**Author:** ![TheMiller](https://avatars.discourse-cdn.com/v4/letter/t/3ec8ea/32.png) [@TheMiller](https://discourse.cakephp.org/u/TheMiller)\
**Post date:** [November 11, 2016, 11:40am UTC](https://discourse.cakephp.org/t/css-js-files-not-accessable/1499/2 "2016-11-11T11:40:38Z")

</div>

Hello.

Sorry for pushing/bumping. This problem still exists. I just don’t get what’s wrong there.

Hope anybody can help me.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![francky06l](https://avatars.discourse-cdn.com/v4/letter/f/43a26b/32.png) [@francky06l](https://discourse.cakephp.org/u/francky06l)\
**Post date:** [November 18, 2016, 2:41pm UTC](https://discourse.cakephp.org/t/css-js-files-not-accessable/1499/3 "2016-11-18T14:41:39Z")

</div>

What do you get in the apache access log ? Might be a permission story.

---

<div class="post-metadata">

**Author:** ![TheMiller](https://avatars.discourse-cdn.com/v4/letter/t/3ec8ea/32.png) [@TheMiller](https://discourse.cakephp.org/u/TheMiller)\
**Post date:** [November 24, 2016, 4:19pm UTC](https://discourse.cakephp.org/t/css-js-files-not-accessable/1499/4 "2016-11-24T16:19:46Z")

</div>

Hello and sorry - I didn’t recognize the notification eMail so I missed your answer.

I could solve the problem. I had the wrong DocumentRoot caused by another nginx-Directive. It was pretty hard to debug because I was dockerizing my stack.

But thanks anyway!
