LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-27-2012, 01:59 PM   #1
paulwilson5x
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Rep: Reputation: Disabled
Website pictures


Hi, Im totally new to Ubuntu/Linux. I have Ubuntu server 11.10 and Ubuntu desktop 11.10 installed in virtualbox. I am creating a website for fun, I have used filezilla to transfer a folder containing pictures I want to put on the website. Im not really sure what the next step is, where should I put the images folder/the commands to put the folder wherever it should go etc etc. Any help would be appreciated. Thanks
 
Old 02-27-2012, 02:08 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
there's nothing interesting about where the images go. As long as your html documents can reference them with a valid URI, then it's fine. You may have an "images" directory to use, but that's up to you, not us.
 
Old 02-27-2012, 02:21 PM   #3
paulwilson5x
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Im not using a URL or anything as a URI, I have just downloaded the images from the net and saved them in one file. A sample of my html for referencing an image is src="images/head.gif". I have the images in a file called images on the server, but Im sure Im missing other steps here? Like I said Im totally new to all of this, I have no clue what im doing.

Last edited by paulwilson5x; 02-27-2012 at 02:24 PM.
 
Old 02-27-2012, 03:52 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
of course you're using a uri, it's impossible not to. in that example "images/head.gif" is the uri. so as long as you can put that link directly into a browser and get the image by itself, when it's part of html code it should also work. In a file? You mean in a directory / folder, right? There should be no other "steps" by default. Do you have a web page loading at all? well as long as you do, just to the same thing for the images as the html files and it should work. We'll need more information to help you much more though.
 
Old 02-27-2012, 04:39 PM   #5
paulwilson5x
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
ye i have web pages loading, what info do u need?
 
Old 02-27-2012, 05:05 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
I don't know tbh... I am unclear on what you need help with. So you have an index.html file. in , say, /var/www/html/. So if you have your images in /var/www/html/images then any image would be accessible from the html code with "<img src=images/whatever.png />". There shouldn't be any more to it than that, and that seems pretty clear to me.
 
Old 02-27-2012, 05:15 PM   #7
paulwilson5x
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
ye files saved like /var/www/home.php. so i guess i just have to rename the images file to /var/www/php/images
 
Old 02-28-2012, 03:14 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
well it depends what it is from the start, but if /var/www is your document root them "php/images/whatever.gif" would be the relative URI. Something seems a little wonky there as there is no php directory in "/var/www/home.php"
 
Old 02-28-2012, 04:10 AM   #9
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
If you want your images to be seen by people, you need to put them on a hosting server, just like your HTML documents. But if you're using a web hosting service, you will probably need to use an upload form provided by them. These forms are typically in the administration section of your hosting account.

But getting your image to the hosting service is only the first step. Then you need to add it to an IMG tag in the SRC attribute. For example:
<img src="http://www.hostingprovider/path/to/image.gif">

Start with Images in the Same Directory as the HTML

1. upload your image, image.gif, to the root of your website
2. add an IMG tag to your HTML pointing to that image: <img src="image.gif">
3. upload your HTML file to the root of your website
4. test the file by opening the page in your web browser

But it is more common to store images in a sub-directory, typically called images. In order to point to images in that directory you need to know where it is in relation to the root of your website.

The root of your website is where the URL, without any directories on the end, displays. For example, the root of this site is at http://www.example.com/. Notice the slash at the end. This is how the root of a directory is usually indicated. Sub-directories include that slash to say where they sit in the directory structure. For example, a site might have the structure:

/ — the root directory
/about/ — the “about” directory
/products/ — the “products” directory
/products/documentation/ — the “documentation” directory under the products directory
/images/ — the “images” directory

Then, when you point to your image in the images directory, you would write: <img src="/images/image.gif">. This is called the absolute path to your image.

Last edited by Satyaveer Arya; 02-28-2012 at 04:12 AM.
 
1 members found this post helpful.
  


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
need someone to point out the way for making this kind of website website rastiazul Linux - General 1 01-15-2011 01:59 AM
Wget: Downloading Pictures from a website mattseanbachman Linux - Software 1 12-29-2010 06:11 PM
viewing an externally hosted website from within a given website andrews-mark Linux - Server 6 10-07-2008 01:11 AM
Automaticlly resizing pictures for website? fredgt Linux - Software 3 09-03-2004 03:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration