How do I get local htdocs images to show on a web page.
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I get local htdocs images to show on a web page.
I couldn't put too much in the subject line.
I'm running OpenSuSe 11.4 with apache, mysql and php already serving up php based sites from the apache document root htdocs, inside the doc root are 2 folders (excluding the folders for the php sites) cgi-bin and images, now the problem is, for some reason basic html pages are not showing images from the images folder, using <image src="images/pic.gif> I even prefixed images with a / but nope, all that gets shown on the pages are the image place holders, unless I use the full url, ie <image src="http://address/images/pic.gif"> and yet I have seen the page sources of other websites that actually use an images folder,,, but how?
Also, if I used Kompozer to create web pages, how would I set that up to publish to my doc root, being that apache doc root uses root:root access, and vsftp does not allow local or external root access, which means I would have to publish to a user space, which would defeat the object of having an htdocs folder, and publishing using Kompozer is not like using MS Front page, Kompozer does not publish the entire site, just the html pages created, which means to put pages and images in the htdocs and images folder, I have to use webmin upload/download manager.
If you can put here some of your configuration files, then someone can see what is the problem and may help.
The files would be primarily "Apache" configs (in OpenSuse /etc/apache2/httpd.conf and default-server.conf )
Typos are easily created lol, but in mmy case I checked the html code, and the location is enclosed in 2 double quotes
I'll post my Apache conf files here,,,, they maybe a bit big, soooo, maybe I should use pastebin instead.
So it was a typo. Well, I don't think it's an apache configuration problem as you see the broken images placeholder.
Better have a look at apache error_log to see where it looks for the images.
Also since you use ftp to upload stuff in your webserver, make sure you're using binary mode to transfer images
Here's my httpd.conf and default-server.conf renamed with the txt extension because this forum don't allow .conf files.
Also the Apache error.log shows:-
File does not exist: /srv/www/htdocs/images/logo.gif referer: sites_blocked.html
File does not exist: /srv/www/htdocs/images/logo2.gif referer: sites_blocked.html
Both files exist in /srv/www/htdocs/images and are 755 permissions.
I can't insert the html tags used because for some unknown reason, this forum replaces them with the http address for linuxquestions.org like this:-
File does not exist: /srv/www/htdocs/images/logo.gif referer: sites_blocked.html
File does not exist: /srv/www/htdocs/images/logo2.gif referer: sites_blocked.html
How are you visiting your site? The referer should look something like:
It does show the referer as http://FQDN:port/sites_blocked.html :port is shown because Apache has to be running on a non-standard port, being that my ISP blocks incoming on port 80, and I have to use a dynamic host name service, but Apache should still be able to use the local images directory, when using <image src=> tag.
That page only gets refered to by squidguard redirector when a site is blocked.
I'm not actually using clickable links, but image sources, when the properties of an image is looked at, it should show "http://www.linuxquestions.org/questions/images/logo.gif" and not an FQDN, the <img src=> tag source should be relative to the document root, but for some reason relative image sources are not being used, but instead Apache always wants to use an FQDN in the <img src=> tag.
This is one of the lines in the html file called sitesblocked.html, but if the page is called from a redirector such as squidguard using a relative source, only the image place holder is shown, but if I use an FQDN in the <img src=> tag it works, the same goes for if I directly enter http://FQDN/images/image.gif in a browser, and the source tag is relative, only the place holder is shown, but use the same url and use an FQDN in the image source tag, it works.
What I want to happen (as I've seen on a lot of web page sources), when an image's property is examined, it shows images/image.gif as the source, not http://FQDN/images/image.gif
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.