LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-25-2004, 11:10 PM   #1
vadertech
Member
 
Registered: Nov 2002
Posts: 67

Rep: Reputation: 15
simple question


If my website is http://www.mysite.com/web/public_html/index.php

How can I change this so instead of showing http://www.mysite.com/web/public_html/ in the address bar, it just shows http://www.mysite.com/


I would guess this is done in the httpd.conf file?

Thanks.
 
Old 01-25-2004, 11:19 PM   #2
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Rep: Reputation: 37
Yes you are right httpd.conf

Search for Document Root:

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/any path/to your/web files"

put the index file in there
 
Old 01-25-2004, 11:25 PM   #3
vadertech
Member
 
Registered: Nov 2002
Posts: 67

Original Poster
Rep: Reputation: 15
well, im using a portal system so it would be more difficult than just moving my index.php. I will look into symbolic links and aliases.
 
Old 01-26-2004, 12:32 AM   #4
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Rep: Reputation: 37
Sorry, I didn't mean to say move your index.php
Change the path to point to where you already have it.

Won't this work for you?
 
Old 01-26-2004, 07:39 AM   #5
vadertech
Member
 
Registered: Nov 2002
Posts: 67

Original Poster
Rep: Reputation: 15
the path is already set to where the index.php file is.

The index file is in www.mysite.com/web/public_html/index.php

My document root is pointed to /home/mysite/public_html/web/public_html

I see sites using the same portal with just www.mysite.com and not displaying the /web/public_html/index.php at the end.

So i was looking for a way for the url address bar to display:

www.mysite.com instead of www.mysite.com/web/public_html/

Right now if someone types in www.mysite.com, I have to use an index.html file to redirect them to my index.php file.
 
Old 01-26-2004, 03:15 PM   #6
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Rep: Reputation: 37
Did you add index.php to the Directory Index?

Add index.php in
IfModule mod_dir.c under DirectoryIndex.

Apache will then look for index.php in the DocumentRoot
and will display it as its main page.
 
Old 01-26-2004, 05:39 PM   #7
vadertech
Member
 
Registered: Nov 2002
Posts: 67

Original Poster
Rep: Reputation: 15
<IfModule mod_dir.c>
DirectoryIndex index.html index.wml index.cgi index.shtml index.jsp index.js index.jp index.php4 index.php3 index.php index.phtml index.htm default.htm default.html home.htm
</IfModule>


Thanks for helping but I guess you are missing the question. I understand that I can type www.mysite.com/web/public_html/ and it will find the index.php file but you would think there would be a way that even though index.php is under <document_root>/web/public_html, that the browser address would just display www.mysite.com/ but really it is pointing to www.mysite.com/web/public_html/index.php.

What Im looking for is a way to invisibly tell the browser if I type in www.mysite.com to automatically pull www.mysite.com/web/public_html/index.php but only display www.mysite.com in the address bar.
 
Old 01-26-2004, 05:58 PM   #8
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Rep: Reputation: 37
OK Duh. I get it. (I think)
You could create a sym link to the web/public_html directory

cd /whatever
ln -s /whatever/web/public_html/ .

The contents of web/public_html/ will be available from /whatever

How's that


Last edited by alar; 01-26-2004 at 06:17 PM.
 
Old 01-26-2004, 06:47 PM   #9
vadertech
Member
 
Registered: Nov 2002
Posts: 67

Original Poster
Rep: Reputation: 15
I've been reading some on symlinks and it looks like the answer to my problem. My full path is /home/username/public_html/web/public_html/index.php

This is what I did in SSH.

cd /home/username/public_html
ln -s /home/username/public_html/web/public_html/

And I get this error:

ln: './public_html: cannot overwrite directory

Can you make more clear what to type with the above path?

Thanks again.
 
Old 01-26-2004, 06:58 PM   #10
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Rep: Reputation: 37
The elusive '. 'at the end.
Represents current directory

you could type it out in whole
ln -s /home/username/public_html/web/public_html/ /home/username/public_html/

But you prolly have to change your document root as well won't you?
I'm confused again ;z

Last edited by alar; 01-26-2004 at 07:02 PM.
 
Old 01-26-2004, 07:02 PM   #11
vadertech
Member
 
Registered: Nov 2002
Posts: 67

Original Poster
Rep: Reputation: 15
hmm similiar error.

ln: '/home/username/public_html/ /public_html' : cannot overwrite directory

You think your confused
 
Old 01-26-2004, 07:19 PM   #12
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Rep: Reputation: 37
Ahh it doesn't like the same name. public_html

ln -s /home/username/public_html/web/public_html/ /what's inDocumentRoot/

ln -s TARGET [LINK_NAME]

What is your DocumentRoot set to?
if it's /home/username/public_html/web/public_html/ there shouldn't be a problem (!?)

You can essentially point any files to be accessible from what is in document root.
Or, you can point DocumentRoot to look anywhere for the files.

One of my httpd.conf's reads from
DocumentRoot "/aar/Gonna_be_Web_Stuff/Linux"

my index file is in Linux

If I change my mind I can set up another apache in
/usr/local/NewApache - and put that in my document root

and still access the old stuff with

ln -s /aar/Gonna_be_Web_Stuff/Linux /usr/local/NewApache

all my old web files now appear in /usr/local/NewApache

Hope this helps
alar

or:

Quote:
even though index.php is under <document_root>/web/public_html
Change document root to <document_root>/web/public_html


Last edited by alar; 01-26-2004 at 07:34 PM.
 
Old 01-26-2004, 07:27 PM   #13
vadertech
Member
 
Registered: Nov 2002
Posts: 67

Original Poster
Rep: Reputation: 15
I will play around with it. Thanks for your help.
 
Old 01-26-2004, 07:31 PM   #14
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Rep: Reputation: 37
So much for simple questions eh?
Bwahahaha!
 
Old 01-26-2004, 07:41 PM   #15
vadertech
Member
 
Registered: Nov 2002
Posts: 67

Original Poster
Rep: Reputation: 15
lol, we learn by breaking things.
 
  


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
Ubuntu Fluxbox simple question, simple answer? generallimptoes Linux - Software 3 09-26-2005 02:03 PM
Installing Programs - A simple question from my simple mind jmp875 Linux - Newbie 6 02-18-2004 09:03 PM
Hopefully a Simple Question Arcane Kidd Linux - Newbie 5 01-17-2003 04:27 PM
Really Simple Question -- Please help! Cia420 Linux - General 3 05-07-2002 06:42 AM
simple question seeking simple answer enzo250gto Linux - Newbie 1 10-27-2001 04:08 AM

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

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