PDA

View Full Version : no images on apache server


kc2dws
26th June 2009, 08:15 PM
hi all

I have started create a apache 2.2 web sight. It seems to be configured, I can reach it from the web using other locations. The problem is none of the images or graphics are showing up on the sight.
I am using kompozer the create the sight, and do not know if it is a server problem or if it is a kompozer problem.


any thoughts.

thanks kevin

neogranas
26th June 2009, 08:34 PM
Sounds like it might be that the images are not being referenced right. Open an SSH connection to the server, type this as root:

tail -f /var/log/httpd/access_log /var/log/httpd/error_log

Then hit enter/return a few times to clear a few lines in the tail, and then try to visit your page with broken images. That should tell you what can be accessed and what errors your server is seeing. Should give you an idea of what is going on.

kc2dws
26th June 2009, 09:02 PM

running tail -f /var/log/httpd/access_log /var/log/httpd/error_log shows that images were not found. I put the image in /var/www/icons reinserted them and it worked.


thanks for your help

neogranas
26th June 2009, 09:05 PM
Not sure if that is what you want as a long term solution to your problem. It may work for now, but I'd really recommend learning to do VirtualHost directives in apache so you can have your website run from a folder in a user's directory. It's not necessarily better, but it's something I'd recommend just so you can keep your site's files clean, together, and in a way that when you use Kompozer to publish, you won't have to go back on your server and move new images or whatever.

SlowJet
26th June 2009, 09:44 PM
Not sure if that is what you want as a long term solution to your problem. It may work for now, but I'd really recommend learning to do VirtualHost directives in apache so you can have your website run from a folder in a user's directory. It's not necessarily better, but it's something I'd recommend just so you can keep your site's files clean, together, and in a way that when you use Kompozer to publish, you won't have to go back on your server and move new images or whatever.

But most tools like kompozer are old-school.
With SELinux and httpd running with a secured user the /var/httpd/www/someappdir/someappsudir
needs to be handled differently.

The user designs and tests, tells the webmin where it is (a policy and procedure),
the webmin does a cp via root (sudo or role) to /var/httpd/www/somedir/
The cp changes the selinux context to httpd's username context (apache, only root and apache can access the files.)
If some need labelling, then restorecon -v -R /var/httpd/www/someappdir/someappsudir
as needed.

Sj

kc2dws
27th June 2009, 02:21 AM
just a thought. after turning selinux off the images appear. I do not want to leave it off so i am going to try to set a rule to allow the folder i use for images.


thank you for your help
kevin

aleph
27th June 2009, 04:15 AM
just a thought. after turning selinux off the images appear. I do not want to leave it off so i am going to try to set a rule to allow the folder i use for images.


thank you for your help
kevin

Or just chcon the image files...

neogranas
29th June 2009, 02:29 AM
getsebool -a | more

That will show you all the SELinux variables, see if one fits what you need.