LinuxQuestions.org
Visit Jeremy's Blog.
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 07-30-2004, 07:48 AM   #1
hylke
Member
 
Registered: Apr 2004
Location: the Netherlands
Distribution: Ubuntu 7.04
Posts: 329

Rep: Reputation: 30
[apache http server] directory


Hello
I want to have that apache gets al the files from a specific directory(in my case /Websites).
So that if i would type 127.0.0.1 in the urlbar it uses index.html from /Websites, and if i type 127.0.0.1/mywebsite it starts index.html from /Websites/mywebsite.
So how do i do that?
I've already tried changing the DocumentRoot from httpd.conf but that didn't worked.
I use slackware 10.0
So can anyone please help me?
Thanx Hylke
 
Old 07-30-2004, 09:29 AM   #2
skunkburner
Member
 
Registered: Mar 2004
Distribution: Fedora Core 17 & 18, Debian Wheezy
Posts: 137

Rep: Reputation: 16
If I understand you correctly you need to set the directory index in httpd.conf

The line "DirectoryIndex index.html" in your httpd.conf (Loose the " ) would look for and open the file index.html if no other page was specified.
 
Old 07-30-2004, 09:45 AM   #3
hylke
Member
 
Registered: Apr 2004
Location: the Netherlands
Distribution: Ubuntu 7.04
Posts: 329

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by skunkburner
If I understand you correctly you need to set the directory index in httpd.conf

The line "DirectoryIndex index.html" in your httpd.conf (Loose the " ) would look for and open the file index.html if no other page was specified.
that's not really what i meant.
What i mean is:
It now starts gettins files from /var/www/htdocs.
So if i have a file called hello in that directory, and i type 127.0.0.1/hello it would show the file hello.But i don't want apache to start at /var/www/htdocs, but at /Websites.So if i would put the file hello in /Websites and type 127.0.0.1/hello it would show the file.
I hope i made my self more clear then the post before.
Thanx Hylke
 
Old 07-30-2004, 09:52 AM   #4
skunkburner
Member
 
Registered: Mar 2004
Distribution: Fedora Core 17 & 18, Debian Wheezy
Posts: 137

Rep: Reputation: 16
Much clearer thanks.

You say you've already changed document root to /website, Have you also changed the

<Directory "/var/www/htdocs"> section that sets access permissions and stuff to
<Directory "/Websites"> as well as doc root.
 
Old 07-30-2004, 10:19 AM   #5
hylke
Member
 
Registered: Apr 2004
Location: the Netherlands
Distribution: Ubuntu 7.04
Posts: 329

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by skunkburner
Much clearer thanks.

You say you've already changed document root to /website, Have you also changed the

<Directory "/var/www/htdocs"> section that sets access permissions and stuff to
<Directory "/Websites"> as well as doc root.
I already had both set to /Websites(DocumentRoot and the directory thing).
 
Old 07-31-2004, 04:13 AM   #6
Cerbere
Member
 
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
Did you restart apache after editing httpd.conf? As root, run 'apachectl restart'.

If that doesn't help, you could make a symlink from /var/www/htdocs to /Websites.

Enjoy!
--- Cerbere
 
Old 07-31-2004, 06:01 AM   #7
hylke
Member
 
Registered: Apr 2004
Location: the Netherlands
Distribution: Ubuntu 7.04
Posts: 329

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by Cerbere
Did you restart apache after editing httpd.conf? As root, run 'apachectl restart'.

If that doesn't help, you could make a symlink from /var/www/htdocs to /Websites.

Enjoy!
--- Cerbere
How can i make such 'symlink', because i couldn't find such thing in httpd.conf and google didn't helped me too(or i just suck at googling).
 
Old 08-02-2004, 12:50 AM   #8
Cerbere
Member
 
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
A symlink is a soft link or in the jargon of another, lesser OS, a shortcut. You can create one with the 'ln' command (that's a lower-case 'L' n). By default, ln will create a hard link, that is it will provide another name for the same file. This wouldn't be good for what you have in mind, so you'll want to use the command 'ln -s'.

Change to the /var/www directory and rename the htdocs folder. Then issue the following command:
Code:
ln -s /Websites htdocs
Next, run 'ls -l' to see that the symlink was created properly. You should see something like the following
Code:
lrwxrwxrwx    1 root  root          15 Aug  1 22:38 htdocs -> /Websites
If all went well, then you can move everything from your renamed htdocs folder, or delete it altogether.

You can find more info by running 'man ln'.

Enjoy!
--- Cerbere
 
Old 08-02-2004, 02:02 AM   #9
hylke
Member
 
Registered: Apr 2004
Location: the Netherlands
Distribution: Ubuntu 7.04
Posts: 329

Original Poster
Rep: Reputation: 30
Thank you very much.
 
  


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
Setting up Apache HTTP server Micro420 Linux - Networking 32 03-26-2005 04:53 AM
Two Apache http server problems... eyebrowsoffire Linux - Networking 2 02-17-2005 10:38 PM
http server - Apache alternative Xa! Linux - Networking 2 02-07-2005 08:18 AM
Spiffing up Apache HTTP directory listing? orange400 Linux - Software 11 06-11-2004 02:51 AM
Kickstart files put on http server directory ? Gates1026 Linux - General 0 01-27-2004 10:05 AM

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

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