LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-21-2001, 09:10 AM   #1
amp2000
Member
 
Registered: Oct 2001
Location: Dublin, Ireland
Distribution: Mandrake 9.0 mostly!
Posts: 303

Rep: Reputation: 30
Where is http://localhost ?????


This is a stupid question but here goes:
Im running mandrake 7.2.
When I type http://localhost or http://ip_address in a browser I get the apache page.
I want to replace this page with my own page but I dont know where this is stored on my machine
Where is it located & in which directory ???????
Can someone please tell me

amp2000
 
Old 11-21-2001, 09:45 AM   #2
BaerRS
Member
 
Registered: Oct 2001
Location: Columbus, Ohio
Distribution: all.. but mainly SuSe--- looks like it changing to Red Hat
Posts: 119

Rep: Reputation: 15
This is usually in the..

/usr/local/apache/htdocs

But could be diffent on your box


as far as the http://localhost & http://IP_ADDRESS giveing you the same page..

localhost is your box.. which is also 127.0.01, or better know as your loopback port.

the http sends it to port 80 on both the localhost & IP_ADDRESS.. With Apache lisining to Port 80 it directs them to

/usr/local/apache/htdocs/default.htm (or index.htm i cant remember)


Last edited by BaerRS; 11-21-2001 at 09:50 AM.
 
Old 11-21-2001, 09:56 AM   #3
amp2000
Member
 
Registered: Oct 2001
Location: Dublin, Ireland
Distribution: Mandrake 9.0 mostly!
Posts: 303

Original Poster
Rep: Reputation: 30
Cheer's
I spent ages trawling through directory's looking for it

Thanks again

amp2000
 
Old 11-21-2001, 11:04 AM   #4
amp2000
Member
 
Registered: Oct 2001
Location: Dublin, Ireland
Distribution: Mandrake 9.0 mostly!
Posts: 303

Original Poster
Rep: Reputation: 30
Sorry, I spoke to soon, I still cant find it.
I cd to /usr/local but apache isnt there.
Any ideas where else it might be ?
All I have in /usr/local is:
bin
doc
games
include
info
lib
libexec
man
mysql
mysql-test
sbin
share
sql-bench
src
var

As far as I know Apache is working cos when I view it in a browser it says "if you can see this page, Apache is set up properly".

Any ideas??????

amp2000
 
Old 11-21-2001, 11:05 AM   #5
vinaypai
LQ Newbie
 
Registered: Jun 2001
Location: Bombay, India
Distribution: Redhat 7.0
Posts: 16

Rep: Reputation: 0
Thats the Apache documentation, not the Document root!!!

Thats the Apache documentation, not the WWW Document root!!! You don't want to overwrite that!

The document root is /var/www/html

Make it a habit to find such things from the man or info pages..
 
Old 11-21-2001, 11:13 AM   #6
infernal
Member
 
Registered: Oct 2001
Location: /dev/null
Distribution: Debian, Slackware
Posts: 44

Rep: Reputation: 15
cd /
find var -name ´htdocs´

that should works... that's true, make it a habit to find it in the mans.. because the way is too long..
 
Old 11-21-2001, 11:15 AM   #7
infernal
Member
 
Registered: Oct 2001
Location: /dev/null
Distribution: Debian, Slackware
Posts: 44

Rep: Reputation: 15
cd /
find usr -name ´htdocs´

forgot the usr
 
Old 11-21-2001, 11:17 AM   #8
vinaypai
LQ Newbie
 
Registered: Jun 2001
Location: Bombay, India
Distribution: Redhat 7.0
Posts: 16

Rep: Reputation: 0
ITs most likely in /usr instead of /usr/local

If you expect to find something in /usr/local/something and don't find it, remember to head to /usr/something
 
Old 11-21-2001, 11:42 AM   #9
amp2000
Member
 
Registered: Oct 2001
Location: Dublin, Ireland
Distribution: Mandrake 9.0 mostly!
Posts: 303

Original Poster
Rep: Reputation: 30
Nice one, I got it.
/var/www/html is what I was looking for.

The reason I didnt read the man pages is because I thought the installation was corrupt as there is no 'htdocs' anywhere on my system.
I tried find the way you said infernal but it couldnt find it, & locate didnt find it either.
Thanks again for helping everyone.

P.S. Am I supposed to stick my public_html directory in /var/www/html, or is that a bad idea security wise ??

amp2000

Last edited by amp2000; 11-21-2001 at 11:45 AM.
 
Old 11-21-2001, 11:47 AM   #10
vinaypai
LQ Newbie
 
Registered: Jun 2001
Location: Bombay, India
Distribution: Redhat 7.0
Posts: 16

Rep: Reputation: 0
You can dump your files in /var/www/html (and cgi files in /var/www/cgi-bin). but by default only root has write access to these dirs

So if possible, you should put your pages in your home directory's public_html folder (you have made a non-root user, haven't you?)

There is some option in /etc/httpd/conf/httpd.conf to make users' accounts accessible as ~username... eg.

http://localhost/~vinay

this will look in /home/vinay/public_html

I'm not sure which option. Read httpd.conf... its very well documented.
 
Old 11-21-2001, 12:01 PM   #11
amp2000
Member
 
Registered: Oct 2001
Location: Dublin, Ireland
Distribution: Mandrake 9.0 mostly!
Posts: 303

Original Poster
Rep: Reputation: 30
Wink Thanks

Cheer's vinaypai

Ye I did make a non root user & I also set up a public_html directory in it.
I just didnt know where the option was so I could access it using http://localhost/~amp2000
I will soon though
Guess I should read the documentation a bit more...

amp2000

Last edited by amp2000; 11-21-2001 at 12:03 PM.
 
Old 11-21-2001, 12:31 PM   #12
Citizen Bleys
Member
 
Registered: Mar 2001
Location: Moncton, NB
Distribution: Gentoo 2006.0
Posts: 181

Rep: Reputation: 30
htdocs is for newer versions of apache. EXTREMELY newer. You've got to be right up to date. If you're running the default apache set up by pretty much any distro, including Mandrake 8.1, your webroot is, as was mentioned, /var/www/html, not apache/htdocs.

I tried creating a directory called /home/citizenbleys/public_html, but http://toshiharu/~citizenbleys/ doesn't work

(toshiharu = hostname = alias for 127.0.0.1)
 
Old 11-21-2001, 12:44 PM   #13
amp2000
Member
 
Registered: Oct 2001
Location: Dublin, Ireland
Distribution: Mandrake 9.0 mostly!
Posts: 303

Original Poster
Rep: Reputation: 30
Citizen Bleys: you wrote
.................................................................................................... .....
I tried creating a directory called /home/citizenbleys/public_html, but http://toshiharu/~citizenbleys/ doesn't work
.................................................................................................... .....
Check out the 5th line in vinaypai's last post ,
You have to edit something in httpd.conf

amp2000
 
Old 11-21-2001, 02:43 PM   #14
dewcansam
Member
 
Registered: Nov 2001
Location: Hi Hat KY USA
Distribution: RedHat, Mandrake
Posts: 63

Rep: Reputation: 15
The easiest way to find your web root directory is
1. $locate httpd.conf ( or find / -name 'httpd.conf' if locate doesn't find anything for you ).
Your output of locate (or find) will have the full path to the httpd.conf file use this in place of /path/to/httpd.conf
2. $grep DocumentRoot /path/to/httpd.conf
this will turn up DocumentRoot "/path/to/your/web/root/directory"

To enable user home directories. Accessable by http://127.0.0.1/~username :
1. $vi /path/to/httpd.conf
2. do a search (use the '/' key) for UserDir this will turn up a spot with (use the 'n' key to advance to next search result occurence) about 12 lines commented out. Just remove the comment character.
3. #/etc/rc.d/init.d/httpd restart
And your done !

note: some of these commands might need to be done as root instead of username

Last edited by dewcansam; 11-21-2001 at 02:47 PM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache: http://localhost (work) http://ipaddress (not working) sarmad Linux - Newbie 7 02-05-2013 07:47 AM
apache http://localhost/mysite ---> http://localhost/mysite/index.php how? ilnli Linux - General 8 06-04-2005 03:23 PM
http://localhost:631 zaicheke Linux - Software 5 08-01-2004 01:13 PM
http://localhost apache matt3333 Linux - Software 16 05-25-2003 01:55 PM
http://localhost does not work! Rajasekhar Atte Linux - Networking 1 12-17-2001 03:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:14 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