Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Needing help setting up Apache
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
geforce
l33t
l33t


Joined: 29 Dec 2003
Posts: 653
Location: Canada

PostPosted: Fri Jul 22, 2005 2:26 am    Post subject: Needing help setting up Apache Reply with quote

Hi.

I'm currently setuping an apache web server..

Here is my web's shema:

/pub/hebergement: Here goes the users webpages
/pub/domaines : Here goes the domaines like /pub/domaines/www.mydomain.com


Here is my /etc/apache2/conf/vhost/vhosts.conf:
Quote:

NameVirtualHost 142.169.156.36:80

<VirtualHost 142.169.156.36:80>
ServerName netrock.ca

UseCanonicalName Off

LogFormat "%V %h %l %u %t \"%r\" %s %b" comonvhost
#CustomLog logs/access_log comonvhost

<Directory "/pub/domaines">
Options -Indexes MultiViews FollowSymlinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>

RewriteEngine on
RewriteMap lowercase int:tolower

#ex: domain.com
RewriteCond %{REQUEST_URI} !^/icons/
RewriteCond /pub/domaines/${lowercase:%{SERVER_NAME}} -d
RewriteRule ^/(.*)$ /pub/domaines/${lowercase:%{SERVER_NAME}}/default/$1 [L]

# ex: sub.domain.com on the fly
#RewriteCond ${lowercase:%{SERVER_NAME}}
RewriteCond %{REQUEST_URI} !^/icons/
RewriteRule ^(.*)$ ${lowercase:%{SERVER_NAME}}$1 [C]
RewriteRule ^([1-z-]+)\.([1-z-]+\.(ca|com|net|org|cx)|[1-z-]+\.qc\.ca)/(.*) /pub/domaines/$2/$1/$4 [L]

#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^/pub/domaines/(.*)/.*/(.*) /pub/domaines/$1/default/$2

<Directory /pub/domaines/*/*/cgi-bin/>
Options +ExecCGI +Includes
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
AllowOverride None
</Directory>
</VirtualHost>

<VirtualHost 142.169.156.36:80>
ServerName membres.netrock.ca
VirtualDocumentRoot /pub/hebergement/*/public_html

<Directory /pub/hebergement/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS PROPFIND>
# Order deny,allow
# Deny from all
# </LimitExcept>
</Directory>
</VirtualHost>




As you see membres.netrock.ca/username is supposed to show up /pub/hebergement/username/public_html.. but it doesn't..

domain.com is supposed to show up /pub/domaines/www.domain.com/default and it does, yay!

sub.domain.com is supposed to shop up /pub/domaines/www.domain.com/sub but it doesn't...


I've been like 2 weeks trying to configure this thing and it's starting to drive me crazy...

PLEASE, Someone help me !



Thanks alot !


Phil
_________________
User #29433
Back to top
View user's profile Send private message
LoDown
Apprentice
Apprentice


Joined: 26 Oct 2004
Posts: 189
Location: Louisville, Ky

PostPosted: Fri Jul 22, 2005 1:38 pm    Post subject: Reply with quote

what does it show when you try to access membres.netrock.ca/username? A 404 (not found) or a 403 (access denied)?
Back to top
View user's profile Send private message
geforce
l33t
l33t


Joined: 29 Dec 2003
Posts: 653
Location: Canada

PostPosted: Fri Jul 22, 2005 2:56 pm    Post subject: Reply with quote

Quote:
Forbidden

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

_________________
User #29433
Back to top
View user's profile Send private message
LoDown
Apprentice
Apprentice


Joined: 26 Oct 2004
Posts: 189
Location: Louisville, Ky

PostPosted: Fri Jul 22, 2005 3:04 pm    Post subject: Reply with quote

Quote:
<Directory /pub/hebergement/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS PROPFIND>
# Order deny,allow
# Deny from all
# </LimitExcept>
</Directory>

I would change this to:
Code:
<Directory /pub/hebergement/*/public_html/*>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS PROPFIND>
# Order deny,allow
# Deny from all
# </LimitExcept>
</Directory>

That is, change the <Directory> line and the Order and Allow. See if that helps at all....
Back to top
View user's profile Send private message
geforce
l33t
l33t


Joined: 29 Dec 2003
Posts: 653
Location: Canada

PostPosted: Fri Jul 22, 2005 3:44 pm    Post subject: Reply with quote

I still get the same error
_________________
User #29433
Back to top
View user's profile Send private message
geforce
l33t
l33t


Joined: 29 Dec 2003
Posts: 653
Location: Canada

PostPosted: Fri Jul 22, 2005 6:53 pm    Post subject: Reply with quote

*bump* No idea?
_________________
User #29433
Back to top
View user's profile Send private message
LoDown
Apprentice
Apprentice


Joined: 26 Oct 2004
Posts: 189
Location: Louisville, Ky

PostPosted: Fri Jul 22, 2005 7:06 pm    Post subject: Reply with quote

You must also check your filesystems permissions to make sure that the user apache runs as can drop through all the folders and read the file you are serving up.

Also, I would suggest putting an astrick (*) in place of the IP and port numbers in the VirtualHost line. Additionally, I believe both blocks need DocumentRoot lines ( I don't see it in the 1st block). Also, I do not know if there is a difference between DocumentRoot and VirtualDocumentRoot.

I would suggest commenting EVERYTHING out except the ServerName and DocumentRoot lines, and slowly building up, seeing where it breaks. A good into article: http://www.onlamp.com/pub/a/apache/2003/07/24/vhosts.html
Back to top
View user's profile Send private message
geforce
l33t
l33t


Joined: 29 Dec 2003
Posts: 653
Location: Canada

PostPosted: Fri Jul 22, 2005 11:40 pm    Post subject: Reply with quote

Well, only the domains are working but I'll continue my researches .


Thanks for help !


Phil
_________________
User #29433
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum