LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-05-2012, 01:40 PM   #1
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Rep: Reputation: 15
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.
 
Old 07-05-2012, 02:11 PM   #2
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Well,

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 )

Last edited by lithos; 07-05-2012 at 02:33 PM.
 
Old 07-05-2012, 04:11 PM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,072

Rep: Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969
Hi,

You miss the closing double quotes in the image URL. It should be
Code:
<image src="images/pic.gif">
Regards
 
Old 07-05-2012, 04:39 PM   #4
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
Originally Posted by bathory View Post
Hi,

You miss the closing double quotes in the image URL. It should be
Code:
<image src="images/pic.gif">
Regards


Now who's the Hawkeye !
 
Old 07-06-2012, 04:05 AM   #5
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by lithos View Post


Now who's the Hawkeye !
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.
 
Old 07-06-2012, 04:25 AM   #6
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
Originally Posted by Usalabs View Post
...
maybe I should use pastebin instead.
..Good idea !,
or attach to the post (as config_file.txt or something).
 
Old 07-06-2012, 04:46 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,072

Rep: Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969
Quote:
Originally Posted by Usalabs View Post
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

Regards
 
Old 07-06-2012, 08:36 AM   #8
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Original Poster
Rep: Reputation: 15
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:-

Code:
<image src="http://www.linuxquestions.org/questions/images/logo.gif">
<image src="http://www.linuxquestions.org/questions/images/logo2.gif">
Ignore the linuxquestions.org line,,, it's what this forum has inserted.

I even tried relative to the doc root by prefixing images with /
Attached Files
File Type: txt httpd.txt (8.6 KB, 29 views)
File Type: txt default-server.txt (3.5 KB, 30 views)

Last edited by Usalabs; 07-06-2012 at 08:55 AM.
 
Old 07-07-2012, 10:55 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,072

Rep: Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969
Quote:
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:
Quote:
referer: http;//servername/sites_blocked.html
 
Old 07-07-2012, 12:29 PM   #10
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Original Poster
Rep: Reputation: 15
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.

Last edited by Usalabs; 07-07-2012 at 12:32 PM.
 
Old 07-09-2012, 11:59 AM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,072

Rep: Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969Reputation: 1969
Quote:
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.
Of course it should. What happens if you use: http://FQDNort/images/logo.gif
 
Old 07-09-2012, 07:52 PM   #12
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
Of course it should. What happens if you use: http://FQDN:port/images/logo.gif
Using an FQDN:port in the url, does show the image perfectly.
 
Old 07-09-2012, 09:27 PM   #13
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 18,768
Blog Entries: 28

Rep: Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966
You syntax for relative links is incorrect.

See here for how to do relative links: http://www.bio.davidson.edu/courses/...tivelinks.html
 
Old 07-10-2012, 07:53 PM   #14
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by frankbell View Post
You syntax for relative links is incorrect.

See here for how to do relative links: http://www.bio.davidson.edu/courses/...tivelinks.html
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.
Code:
<p><img src="logo.gif" /><br /></p> 
<p>more stuff</p>
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

Last edited by Usalabs; 07-10-2012 at 07:56 PM.
 
Old 07-10-2012, 08:17 PM   #15
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 18,768
Blog Entries: 28

Rep: Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966Reputation: 5966
Quote:
I'm not actually using clickable links, but image sources,
Regardless, a link is a link is a link and your relative links are not formatted correctly.

Here's an example of a correct one displaying a little map from this page on my boating site:

"../graphics/cbaythum.jpg"

(I had to leave out the img src= stuff because, when I left it in, LQ replaced the two periods with the path to LQ's parent directory.)

Note the two periods at the beginning of the relative path meaning "relative to the parent directory."

Last edited by frankbell; 07-10-2012 at 08:20 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Embed web cam images in web page secondhandman Linux - Newbie 1 06-30-2012 08:46 PM
[SOLVED] How do I use wget to download only images from a single web page? errigour Linux - Newbie 1 11-29-2011 06:57 PM
Quiery database and show results on a web page jlinkels Linux - Software 5 01-04-2007 07:26 AM
Cant make web server run my local web page... Nik0s Linux - Newbie 22 10-08-2006 10:30 PM
cannot view web page from local lan Tigger Linux - Networking 4 05-31-2003 01:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration