Why my Apache is not serving images or relative content?

7,242

Solution 1

I was having this problem as well... After shifting around some content (in terms of where it was in the folder structure) and restarting apache I was able to get to serve images & dynamic (php driven) content. I think the problem was the the linking formats which I had used coming from windows.

Solution 2

Are you getting "Not Found" or "Permission Denied"? Check your error_log for Apache and the HTML source for the served pages. What is the browser being told to ask for? You may need to add one or more alias entries to the config if your static content lives outside of the /var/www/cake path. While I enjoy eating cake, I have yet to use CakePHP. Frameworks often have their own little rules to watch for, so make sure you have configured any "base folder" options or the like.

Share:
7,242
santiago.basulto
Author by

santiago.basulto

Updated on September 18, 2022

Comments

  • santiago.basulto
    santiago.basulto almost 2 years

    I have a server at: www.patagoniatrabaja.com.ar

    I've a cake installation at www.patagoniatrabaja.com.ar/cake/ to test the CSS.

    I'm setting up a server and installed Apache. The problem is that it's not serving any image or relative content. I've changed things in the Apache configuration. I'll paste it here:

    <VirtualHost *:80>
        ServerAdmin webmaster@localhost
    
        DocumentRoot /var/www
        <Directory />
            Options FollowSymLinks
            AllowOverride All
        </Directory>
        <Directory /var/www/>
            Options FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>
        <Directory "/var/www/cake">
            AllowOverride All
            Options FollowSymLinks
        </Directory>
    
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
        </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
    
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
    
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    
        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
            Options Indexes MultiViews FollowSymLinks
            AllowOverride None
            Order deny,allow
            Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>
    
    </VirtualHost>
    
    • Deb
      Deb about 13 years
      It was moved to Webmasters since they also do apache over there, especially .htaccess stuff, which it sounded like it was all about. This includes much more information, thank you.
    • santiago.basulto
      santiago.basulto about 13 years
      I understand. Thanks. No one answered there though.
    • mahnsc
      mahnsc about 13 years
      I'm not sure if it matters to the issue you're experiencing but I'm not seeing a closing </html> tag