LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-11-2011, 02:54 AM   #1
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 239

Rep: Reputation: 30
forbidden error apache vhost


Hi,

I was accessing my different directories on ip based access like

http://ip/abc
http://ip/xyz

Now I implemented a vhost configuration like

host.abc.com ( this site is running ok)
DocumentRoot /var/www/html/host/


but after that my other ip based sites giving forbidden error.
 
Old 04-11-2011, 03:08 AM   #2
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware
Posts: 575

Rep: Reputation: 154Reputation: 154
On Slackware, this was necessary:

Quote:
<Directory />
Options FollowSymLinks
AllowOverride None
# Order deny,allow
# Deny from all
</Directory>
Note the commented out lines

I hope it helps.
 
Old 04-11-2011, 03:33 AM   #3
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 239

Original Poster
Rep: Reputation: 30
sry it didn't help using centos

my default DocumentRoot is /var/www/html

and vhost DocumentRoot is /var/www/html/abc
 
Old 04-11-2011, 03:53 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,204
Blog Entries: 1

Rep: Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059
Hi,

If you have just one vhost with a docroot /var/www/html/abc, then you cannot visit pages in directories above the docroot (like /var/www/html/xyz)
You can create a default vhost, that uses /var/www/html as docroot and then you can access http://ip/xyz. You can use the following before the abc vhost definition:
Code:
<VirtualHost _default_:80>
DocumentRoot /var/www/html
...
</VirtualHost>
 
Old 04-11-2011, 04:15 AM   #5
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 239

Original Poster
Rep: Reputation: 30
Hi I put your code before vhost:
<VirtualHost _default_:80>
DocumentRoot /var/www/html
...
</VirtualHost>

but getting same forbidden error

code:

NameVirtualHost *:80
<VirtualHost _default_:80>
DocumentRoot /var/www/html
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /var/www/html/abc
ServerName abc.myhosting.com
Options FollowSymLinks
</VirtualHost>
 
Old 04-11-2011, 04:29 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,204
Blog Entries: 1

Rep: Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059
I guess you've restarted apache and cleared your browser cache before testing. And that you want to view the pages in /var/www/html/xyz.
If you still get this error, please post what you get in apache error_log when you try to visit http://ip/xyz
 
1 members found this post helpful.
Old 04-11-2011, 06:57 AM   #7
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 239

Original Poster
Rep: Reputation: 30
thanx dear bathory.. it worked
 
  


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 Forbidden error Ab3n Linux - Newbie 1 01-28-2006 10:45 PM
Apache: Alias is working on ssl vhost but not on mass vhost jonavogt Linux - Software 0 06-07-2005 02:05 PM
Apache: Forbidden Error Ninja Cow Linux - Software 2 12-07-2003 12:24 PM
Apache forbidden error!!!!!!!!!!! RKris Linux - Software 5 11-24-2003 07:17 AM
Apache 2.0.4 .. FORBIDDEN error CRego3D Linux - Software 6 05-15-2003 10:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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