LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-21-2009, 04:38 PM   #1
andrei_b
LQ Newbie
 
Registered: Jul 2009
Posts: 11

Rep: Reputation: 0
image does not appear in localhost/index.html


Hello!

I've just installed Apache, PHP5 and MySql on my computer. I'm using Ubuntu 9.04.
I've set the root directory (I suppose that is 'localhost') to /home/andrei/Public, by slightly changing /etc/apache2/sites-available/default.

There is a html file in my directory, 'index.html'...
<html>
<body>
<img src="abcd.png">
</body>
</html>

(abcd.png is in that directory, .../.../Public, the 'localhost' directory)

... if I open the html file by double-clik on it, FireFox opens and the image is displayed. But, when I type http://localhost/index.html in FireFox or Opera... the image does not appear, instead the alternate text appears.

I've tried in so many ways to write the path to the image, but still it doesn't give up... it doesn't want to be seen...

Thank you in advance!
Have a good day!
 
Old 07-22-2009, 04:12 PM   #2
andrei_b
LQ Newbie
 
Registered: Jul 2009
Posts: 11

Original Poster
Rep: Reputation: 0
anyone..? please
i've tested a html file, on my desktop, not in the localhost directory, and this was unsuccessuful too. what is wrong?
<html><body>
<img width=250 height=250 src="http://en.wikipedia.org/wiki/File:BergenHordalandNorwayVagen.jpg">
</body></html>
I am using both Firefox and Opera.
 
Old 07-22-2009, 04:28 PM   #3
ecorg911
LQ Newbie
 
Registered: Dec 2008
Posts: 7

Rep: Reputation: 1
This is more of a web dev question..

But try putting an absolute path the image file e.g.

<img src="/home/andrei/Public/abcd.png">

and

"http://en.wikipedia.org/wiki/File:BergenHordalandNorwayVagen.jpg"
will not work, becuase it's not an image file, try:


Last edited by ecorg911; 05-14-2011 at 05:32 AM.
 
Old 07-22-2009, 05:01 PM   #4
andrei_b
LQ Newbie
 
Registered: Jul 2009
Posts: 11

Original Poster
Rep: Reputation: 0
thank you! now, the test html file with the image from wikipedia works fine. but still, the html files from the server directory does not display the images... i've tried both relative and absolute paths, then with 'localhost' in front (http://localhost/image.jpg), then with semicolon '.../image' and with ".../image".

links work fine, frames work fine, .css files too. php and mysql tests are ok. i can't figure out what is happening with the images.

have a good day!
 
Old 07-22-2009, 07:15 PM   #5
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
Apache writes two log files: an access log and an error log. The error log should provide some good clues for you. I'm not sure where the logs are stored on an Ubuntu setup -- have a look in the apache installation directory for a "logs" subdirectory. Also have a look in /var/log.
 
  


Reply



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
apache index.html doesn't show up but index.php do zoffmann Linux - Server 5 01-28-2008 03:53 PM
adding index.html to /var/www/html not working dannyboy990 Linux - Newbie 1 09-30-2007 08:43 AM
apache : localhost/ works localhost/index.html does not PhilA Linux - Server 4 05-27-2007 07:32 PM
Where to put index.php (or index.html) on Slackware 11.0 moonguide Slackware 3 05-08-2007 06:35 PM
Konqueror + file:/usr/share/doc/HTML/index.html jon_k Linux - Software 2 11-25-2003 05:06 AM

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

All times are GMT -5. The time now is 11:41 AM.

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