LinuxQuestions.org
Register a domain and help support LQ
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 10-13-2010, 04:01 PM   #1
Really Hot Soap
LQ Newbie
 
Registered: Oct 2010
Posts: 6

Rep: Reputation: 0
experience with Apache? and HTML? I need your help : )


My issue

I have just set up apache yesterday on a old home desktop, im hosting my website from home, got my site up and running and doing some editing to it, to make it look pretty.

What i am trying to do it, is put a link up on my website so that visitors can listen to an mp3 i want to put on there

I have my mp3 on my server but i cannot seem to get the correct path for src code.

so What i am asking is where do i put media files such as mp3 on my server so that when i edit the src code in the index.html, it links to the mp3 and plays it!

thank you for the help
 
Old 10-13-2010, 05:21 PM   #2
CincinnatiKid
Member
 
Registered: Jul 2010
Posts: 431

Rep: Reputation: 33
Put the media files in the same directory as your index.html file, or lower in the directory structure, it is normally /var/www, but I look at your apache configuration file at the ServerRoot directive and it will tell you which directory to use.
 
Old 10-13-2010, 05:21 PM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,519

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Hi,

If you want the mp3 to be accessible through the web server, you must put it under the DocumentRoot. You can create a folder (e.g. media) under htdocs and put it there if you want to share more mp3 files.
Doing so, you can use: <a href=media/my.mp3>My mp3</a>

Regards
 
Old 10-13-2010, 05:42 PM   #4
Really Hot Soap
LQ Newbie
 
Registered: Oct 2010
Posts: 6

Original Poster
Rep: Reputation: 0
alright so this is what happens and what continues to happen, so i have a link named "about us"
and i am directing it to the aboutus.html in the directory /var/www/aboutus.html

so in the code this is what it looks like in the index.html file
<p><a href="/var/www/aboutus.html">About Us</a></p>

now as a result of clicking on the about us link on my website, it returns this:

The requested URL /var/www/aboutus.html was not found on this server.

Now i looked in the apache.conf file and it says my server root is:
/etc/apache2

I changed the "href" to that directory as well with the same result

as far as my documentroot ive been looking at examples all over the internet, trying to figure out where to put this, but its all been a little to advanced for me and i dont really understand, all i have come up with is editing the httpd.conf and so far all it says is

DocumentRoot /var/www
ServerRoot /etc/apache2

any help will do...it seems so simple but i am making it so complicated i just want to fix this hahaha

so thank you to whoever responds
 
Old 10-13-2010, 05:50 PM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,519

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
You don't use the whole path to the file you want to link, but the path relative to DocumentRoot.
So just <p><a href="aboutus.html">About Us</a></p> should work.
 
Old 10-13-2010, 06:05 PM   #6
Really Hot Soap
LQ Newbie
 
Registered: Oct 2010
Posts: 6

Original Poster
Rep: Reputation: 0
alright that makes alot of sense hahaha im sorry im kind of new at this

it gives me a differet response tho, now it is saying i dont have permission to access that file, so im assuming i now need to edit something with user permissions
 
Old 10-13-2010, 06:13 PM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,519

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
You're right. Run (as root)
Code:
chmod 644 /var/www/aboutus.html
 
Old 10-13-2010, 06:19 PM   #8
Really Hot Soap
LQ Newbie
 
Registered: Oct 2010
Posts: 6

Original Poster
Rep: Reputation: 0
i might actually love you.....
thanks alot, its so damn simple!!!!!!

one more quick question...what does the 644 mean? i dont get it, the higher the number the more access you get or what?
 
Old 10-13-2010, 06:27 PM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,519

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Glad to see it worked!
644 means that the file can be readable by anyone and writable only from the owner. In general apache wants a 755 permissions for the directories under DocumentRoot and 644 for the files it will serve.
If you want to read more on file permissions take a look here

Btw you can use "Thread tools" on top of the page to mark the thread Solved

Regards
 
Old 10-13-2010, 06:31 PM   #10
Really Hot Soap
LQ Newbie
 
Registered: Oct 2010
Posts: 6

Original Poster
Rep: Reputation: 0
I did just that, thank you very much...i might have to come back to you for some questions if thats alright.
 
  


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
Apache noindex.html pablo1999 Linux - General 2 10-04-2007 09:57 AM
apache only list from /v/w/html siweb Linux - Server 0 03-14-2007 04:11 PM
Apache HTML directory dwpondscum Linux - Networking 5 08-19-2005 09:49 PM
[apache 2.0] can't get index.html to load fraggie Linux - Software 5 04-09-2005 06:55 AM
How does Apache do HTML textareas? csjosh Linux - Software 4 07-31-2002 01:34 AM


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