LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 10-05-2002, 11:51 AM   #1
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
Unhappy Apache: Virtual hosts


I just installed apache on my machine and tryed to set up a virtual host but i cant get it to work. When i go with my browser to the virtual host i get:

----------
Forbidden
You don't have permission to access / on this server.

Apache/1.3.23 Server at dummy-host.example.com Port 80
---


I dont know what i am doing wrong. Here is the virtual host part of my httpd.conf:
----------
NameVirtualHost 192.168.0.5
<VirtualHost 192.168.0.5:80>
User peter
Group peter
ServerAdmin peter@test.nl
DocumentRoot /home/peter/www/html
ServerName dummy-host.example.com
ErrorLog /home/peter/error_log
CustomLog /home/peter/access_log common
<Directory /home/peter/www/html>
AllowOverride All
</Directory>
DirectoryIndex index.phtml index.fhtml index.php index.php4 index.html
</VirtualHost>
---

I made a file called index.html in /home/peter/www/html
(-rwxrwxrwx 1 peter peter 6 Oct 6 18:19 index.html)

There are no messages in my error_log.


What am i doing wrong???
 
Old 10-05-2002, 12:06 PM   #2
rh7419
LQ Newbie
 
Registered: Oct 2002
Location: Maryland, USA
Distribution: Mandrake 8.2/9.0
Posts: 12

Rep: Reputation: 0
One thing I noticed is your directory names..... Are they links to a sub dir off of the /var/www/html directory? Most Apache configs are based on either /etc/httpd/html or /var/www/html as their main root directory. I am also curious because I am attermpting to do the same and getting the same error here as well and mine ARE pointing to sub-directories off of my /var/www/html dir

Rich
 
Old 10-05-2002, 12:15 PM   #3
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
Thanks for replying!

i made a link in /var/www/html to /home/peter/www/html and adjusted my httpd.conf but it still doesn't work.
 
Old 10-05-2002, 12:39 PM   #4
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
Thumbs up It works!!!

i made a dir /var/www/html/peter and made a softlink /home/peter/html and now it works!

Thanks for the help!
 
Old 10-05-2002, 12:57 PM   #5
rh7419
LQ Newbie
 
Registered: Oct 2002
Location: Maryland, USA
Distribution: Mandrake 8.2/9.0
Posts: 12

Rep: Reputation: 0
Glad I could help. One question I had for you though. Was the 192 IP addy you used an actual internal IP or was that just plugged in? Also, remember with virtual host configurations that what YOU see isn't always what the web server sees, especially when it comes to using CGI scripts.
Good luck!
Rich

P.S. If you still need more help go to Apache's web site at http://www.apache.org They have a pretty extensive tutorial on seting up virtual hosts both by name and IP.
 
Old 10-05-2002, 01:53 PM   #6
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
The 192 address is the real address i am using. I am just experimenting with apache for my work. Thanks again for the help!
 
Old 10-06-2002, 10:19 AM   #7
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
With the link /home/peter/www/html to /var/www/html/peter i cant set a chroot environment for ftp. If i do the user cant get in his /home/peter/www/html dir!

Anyone has a solution for this?
(I am using vsftp)
 
Old 10-06-2002, 10:33 AM   #8
rh7419
LQ Newbie
 
Registered: Oct 2002
Location: Maryland, USA
Distribution: Mandrake 8.2/9.0
Posts: 12

Rep: Reputation: 0
Easy fixis to have the user ftp to his home dir and then cp the files over no?????
 
Old 10-06-2002, 11:00 AM   #9
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
nop, thats not an option. There has to be a better way.
 
Old 10-06-2002, 08:53 PM   #10
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
To answer the original question, the error message is generated when their is no default index page in the directory. You can rememdy this by:
A) creating an index.html (or whatever you happen to set as default)
B) add "Indexes" to the Options line in the Directory paragraph that matches your DocumentRoot.

Doing B will use the output of "ls" for the index if there is none. You can create a separate DocumentRoot for each virtual host without any problems or having to symlink all over the place.

Last edited by stickman; 10-06-2002 at 08:55 PM.
 
Old 10-07-2002, 02:29 PM   #11
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
I already have an index.html
I still have the error and i have the index.html and all the dirs set to chmod 777
 
Old 10-07-2002, 02:31 PM   #12
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
Never mind. It works right now.
 
Old 10-07-2002, 09:32 PM   #13
flashjim
LQ Newbie
 
Registered: Sep 2002
Location: Houston, TX
Distribution: RedHat 7.3
Posts: 3

Rep: Reputation: 0
what did you do differently?
 
Old 10-08-2002, 01:12 PM   #14
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
I just cut my vhost config and pasted it at the end of the virtual host section and it suddently worked. Don't know what was wrong, but im glad it works!
 
Old 10-08-2002, 04:56 PM   #15
cli_man
Member
 
Registered: Apr 2002
Location: New York, USA
Distribution: Redhat 7.2, 9.0 Slackware 9.1
Posts: 428

Rep: Reputation: 30
The question was asked above about chrooting a user in ftp, I just did that with a server I just set up, I used pure-ftp for the server, real easy to set up and an option for it is to chroot the users in ftp, they have it documented in there site, you can type in pure-ftp in google to find it.
 
  


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
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 07:29 AM
Apache Virtual Hosts quozt Linux - General 3 10-15-2003 10:51 AM
Apache/Virtual Hosts Help C-Squared Linux - General 9 08-04-2003 01:45 PM
Apache Virtual Hosts (again) scatcat Linux - General 1 10-17-2002 10:51 AM
apache virtual hosts jonfa Linux - General 1 06-04-2002 02:50 AM


All times are GMT -5. The time now is 02:48 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration