[SOLVED] experience with Apache? and HTML? I need your help : )
Linux - NewbieThis 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
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.
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!
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.
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>
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
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.
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
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.