Apache server help

Discuss the many weaknesses of browser security and ways to mitigate the threat

Apache server help

Post by astromech_kuhns on Tue Mar 22, 2011 12:24 am
([msg=55351]see Apache server help[/msg])

Hey all,

I installed ubuntu 10.04 server edition onto my computer. i made a static ip for it. i then proceeded to install apache2. everything was great. a little edit of the index.html file to make it more my own under construction message (which was located at /var/www/index.html) and then when i got onto my computer i would simply plug in 192.168.0.100 and it would take me to the edited default page. pretty simple.

I then made my own very simple index.html file. i proceeded to make two more .html files. lets call the A.html and B.html. index.html had a link for A.html which had a link to B.html.

i made those on my laptop and scp them over to my server. they were in a folder called website_server_files. i transfered the whole file to the home directory. i then copied the three files to my /var/www/ directory replacing the default index.html.

so now under /var/www i have index.html, A.html, B.html. i go to my computer and put in the ip address again. i get my new index.html file. i click on the link that should take me to A.html. it didnt come up. i noticed that i had the old directory from my computer not from the server. so i edit the html files on the server so they reference the right paths. now all 3 files should be correct.

i open my web browser point it to my server and i get my index file again. i go to open my A.html via the link and it still doesnt open. i check and the path is correct so it has to do with apache. from what i have read i think i need to add it to the available site list and enabled site list. but im not sure if thats when im hosting multiple websites or just one. i am wanting to host just my website which has multiple pages, that i made with html files. well, i looked on apache's website and used google, and like i said, i think i need to edit the files to allow these files, but im not exactly sure and when im reading info it isnt making much sense. if i could be pointed in the right direction with a guide that makes more sense, or explained what im not understanding, that would be much appreciated!

Thank you!
astromech_kuhns
New User
New User
 
Posts: 21
Joined: Sun Oct 03, 2010 1:28 pm
Blog: View Blog (0)


Re: Apache server help

Post by Phantom Wolf on Tue Mar 22, 2011 12:51 am
([msg=55352]see Re: Apache server help[/msg])

It might just be because I haven't slept in a while, but I found your post a little confusing. Can you give me the absolute path of your index.html, A.html, and B.html?

Also, copy and paste the URL for your index page, and the URL after you click the link to A.html
"Well it isn't my fault. I shouldn't have been allowed to do something to crash it." "No, you shouldn't have been allowed to buy a computer in the first place"
Phantom Wolf
Poster
Poster
 
Posts: 271
Joined: Wed Mar 03, 2010 8:45 pm
Blog: View Blog (0)


Re: Apache server help

Post by astromech_kuhns on Tue Mar 22, 2011 1:12 am
([msg=55353]see Re: Apache server help[/msg])

I guess i should have said that this is not a live website. as of right now its just hosted on my server and available on my network.

here is the url of my index.html: http://192.168.0.100/
here is the url of my A.html: http://192.168.0.100/var/www/kdk.html

the path to all 3 files is: /var/www/<files>

the files are all in www directory.
astromech_kuhns
New User
New User
 
Posts: 21
Joined: Sun Oct 03, 2010 1:28 pm
Blog: View Blog (0)


Re: Apache server help

Post by Phantom Wolf on Tue Mar 22, 2011 1:40 am
([msg=55354]see Re: Apache server help[/msg])

You've the wrong URL. I assume this is because you linked to your A file with code like this
Code: Select all
<a href="/var/www/A.html">

The link actually points to a file from the client's point of view, not the server's (because the HTML is phrased on the client side). And, unless the link begins with a protocol (like http: or ftp:), then it's assumed to be on the same server.

Since the server only makes available files under the /var/www directory, it appears to the client as if /var/www is actually /. The web browser has no idea where those files actually are, and doesn't care

The correct link for your A file would be
Code: Select all
<a href="A.html">

It looks like your file isn't actually named A.html, but kdk.html, so the correct link might actually be
Code: Select all
<a href="kdk.html">

And the correct URL would be http://192.168.0.100/kdk.html
"Well it isn't my fault. I shouldn't have been allowed to do something to crash it." "No, you shouldn't have been allowed to buy a computer in the first place"
Phantom Wolf
Poster
Poster
 
Posts: 271
Joined: Wed Mar 03, 2010 8:45 pm
Blog: View Blog (0)


Re: Apache server help

Post by astromech_kuhns on Tue Mar 22, 2011 1:47 am
([msg=55355]see Re: Apache server help[/msg])

You my friend, are pure genius. Thank you very much for that correction, but it makes sense. since the files are only under one directory, which is the one apache looks under, it doesnt want to look through your servers directories, it looks under the correct one. and if its already in that directory you only need the file name.

Yeah, i used A and B for examples.

I really appreciate it! now i can get back to working on my html files and make them not look quite so bare and put some info in them. :geek:

Thanks again!
astromech_kuhns
New User
New User
 
Posts: 21
Joined: Sun Oct 03, 2010 1:28 pm
Blog: View Blog (0)


Re: Apache server help

Post by Phantom Wolf on Tue Mar 22, 2011 2:31 am
([msg=55356]see Re: Apache server help[/msg])

astromech_kuhns wrote:You my friend, are pure genius.

Thanks, but I'm hardly a genius.

astromech_kuhns wrote:it doesnt want to look through your servers directories, it looks under the correct one. and if its already in that directory you only need the file name.

True, but there are ways to 'trick' the server into reading from other files. Like symbolic links and server-side scripting. You'll probably figure them all out yourself as you learn. By the way, that directory is typically referred to as the "document root"

Good luck with your website.
"Well it isn't my fault. I shouldn't have been allowed to do something to crash it." "No, you shouldn't have been allowed to buy a computer in the first place"
Phantom Wolf
Poster
Poster
 
Posts: 271
Joined: Wed Mar 03, 2010 8:45 pm
Blog: View Blog (0)


Re: Apache server help

Post by Goatboy on Tue Mar 22, 2011 12:11 pm
([msg=55371]see Re: Apache server help[/msg])

Phantom Wolf wrote:
astromech_kuhns wrote:You my friend, are pure genius.

Thanks, but I'm hardly a genius.

Seconded.
Assume that everything I say is or could be a lie.
1UHQ15HqBRZFykqx7mKHpYroxanLjJcUk
User avatar
Goatboy
Expert
Expert
 
Posts: 2822
Joined: Mon Jul 07, 2008 9:35 pm
Blog: View Blog (0)


Re: Apache server help

Post by Phantom Wolf on Tue Mar 22, 2011 12:37 pm
([msg=55373]see Re: Apache server help[/msg])

Goatboy wrote:
Phantom Wolf wrote:
astromech_kuhns wrote:You my friend, are pure genius.

Thanks, but I'm hardly a genius.

Seconded.

Gee . . . thanks, Goatboy. ^Cries^

I've always thought that one of the first steps of being any kind of hacker is admitting that you don't know everything, and that you're probably not the best at anything. In other words, being modest.
"Well it isn't my fault. I shouldn't have been allowed to do something to crash it." "No, you shouldn't have been allowed to buy a computer in the first place"
Phantom Wolf
Poster
Poster
 
Posts: 271
Joined: Wed Mar 03, 2010 8:45 pm
Blog: View Blog (0)


Re: Apache server help

Post by Goatboy on Tue Mar 22, 2011 1:12 pm
([msg=55375]see Re: Apache server help[/msg])

Phantom Wolf wrote:I've always thought that one of the first steps of being any kind of hacker is admitting that you don't know everything, and that you're probably not the best at anything. In other words, being modest.

That's good advice for anyone, not just hackers.
Assume that everything I say is or could be a lie.
1UHQ15HqBRZFykqx7mKHpYroxanLjJcUk
User avatar
Goatboy
Expert
Expert
 
Posts: 2822
Joined: Mon Jul 07, 2008 9:35 pm
Blog: View Blog (0)


Re: Apache server help

Post by astromech_kuhns on Tue Mar 22, 2011 5:04 pm
([msg=55389]see Re: Apache server help[/msg])

unless your god....... :D
astromech_kuhns
New User
New User
 
Posts: 21
Joined: Sun Oct 03, 2010 1:28 pm
Blog: View Blog (0)



Return to Web

Who is online

Users browsing this forum: No registered users and 0 guests