LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-01-2006, 03:46 PM   #1
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Rep: Reputation: 31
Question Configuring APACHE, where do I place my website?


Hello guys, here at work I installed a LAMP server and everything seems to be working fine for now.
We want to use Apache to host a page in our intranet. The thing is, I'm a newbie in these things, but I was able to install the LAMP server and ssh and configure MYsql so I think I can go through the rest. I'm able to see a little web page that I place at the /var/www directory. Before this I was able to see the page that says: "If you can see this, it means that the installation of the Apache web server software on this system was successful. You may now add content to this directory and replace this page". Can I create folders like for example:

/public_html
/private
/cgi-bin

I'm able to make the folders but I have to type the entire path: myserver.com/public_html/page.html

I have experience using those hosting companies in which they have everything organized the way is
above. How can I make this happen where do I place my website so users don't have to type the entire
path? Let me know if I'm explaining myself well...

Thanks for the help....
 
Old 08-01-2006, 04:00 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
the default location that apache uses is /var/www/html. this location is defined in your httpd.conf file as DocumentRoot for the default virtual host. you can go in and change that to your hearts content, but generally there is little benefit in doing so.
 
Old 08-01-2006, 04:06 PM   #3
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
So I need to create the html folder? Correct or not? I'm using the Ubuntu LAMP server. I will give it a try.

Thanks acid!!!
 
Old 08-02-2006, 03:22 PM   #4
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
When I type the server's address I get:

Index of /
Name Last modified Size Description--------------------------------------------------------------------------------
Joomla1-0/ 01-Aug-2006 18:05 -
apache2-default/ 01-Aug-2006 12:42 -
html/ 01-Aug-2006 12:42 -
public_html/ 01-Aug-2006 16:38 -

I though I will be able to see the index.html instead of this. How can I make this happen??
 
Old 08-02-2006, 04:16 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well where is that directory? looks like you've changed the DocumentRoot directive or something. there is no index.html visible there so it couldn't display it.
 
Old 08-03-2006, 10:20 AM   #6
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
The index.html is inside the /html folder. Should I place it on the var/www? I thoght it should be inside the /html or /public_html directory just like in those hosting companies. So please let me know how do you organize this thing? Can it be done the way I though or everything should be place at /var/www?

Thanks acid...
 
Old 08-03-2006, 10:44 AM   #7
jantman
Member
 
Registered: Nov 2005
Location: New Jersey, USA
Distribution: SuSE
Posts: 492

Rep: Reputation: 31
Well, there's a bit of a difference here. Those hosting companies are running virtual servers from within Apache.

Your current document root is /var/www

If you want a "simple" server, you can just place everything in there, and ignore the public_html directory. The concept of public_html is to allow files to be served from a user-accessible directory.

i.e. if your web host (bigcompany.com) has clients Mr. Smith (smith.com) and Mr. Jones (jones.com) they could set it up as follows:

/var/www (bigcompany.com's site)

/home
/smith
/public_html
/jones
/public_html
Now, smith.com will be served out of /home/smith/public_html but that directory will appear to be the top level.

I usually set this up on systems so that users can have their own personal web space, but it is midifiable from within their home directory (to keep permissions and ownership simple) and also, being in their home directory, the space is calculated as part of their quota for /home.

These can also be accessed without virtual servers, by using the ~ preceding the user's home directory - i.e. in the above setup, with only one virtual server (the default) and with public_html enabled:

typing in www.bigcompany.com will serve from /var/www

www.bigcompany.com/~smith/ will server from /home/smith/public_html

Last edited by jantman; 08-03-2006 at 10:46 AM.
 
Old 08-03-2006, 02:48 PM   #8
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
Thanks jantman, you sure can be a teacher, (clear explaination)!!

Thanks!!
 
  


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 + where to place web pages?? blizunt7 Fedora 6 06-01-2005 03:27 PM
Apache: Where to place 'Loadmodule' on SuSE? Maarten_Holland SUSE / openSUSE 1 04-29-2005 03:28 AM
Configuring Webalizer to report to a protected website folder soren625 Linux - Software 2 01-18-2005 08:23 AM
apache server setup and how to place files in the var/www/html directory dramous Linux - Newbie 7 09-28-2004 04:18 AM
apache server setup and how to place files in the var/www/html directory dramous Linux - General 2 09-25-2004 01:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:00 PM.

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