View previous topic :: View next topic |
Author |
Message |
geforce l33t
Joined: 29 Dec 2003 Posts: 654 Location: Canada
|
Posted: Fri Jul 22, 2005 2:26 am Post subject: Needing help setting up Apache |
|
|
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 _________________ http://tilde.club/~geforce/ |
|
Back to top |
|
|
LoDown Apprentice
Joined: 26 Oct 2004 Posts: 189 Location: Louisville, Ky
|
Posted: Fri Jul 22, 2005 1:38 pm Post subject: |
|
|
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 |
|
|
geforce l33t
Joined: 29 Dec 2003 Posts: 654 Location: Canada
|
Posted: Fri Jul 22, 2005 2:56 pm Post subject: |
|
|
Quote: | Forbidden
You don't have permission to access /d3stroy3r on this server. |
_________________ http://tilde.club/~geforce/ |
|
Back to top |
|
|
LoDown Apprentice
Joined: 26 Oct 2004 Posts: 189 Location: Louisville, Ky
|
Posted: Fri Jul 22, 2005 3:04 pm Post subject: |
|
|
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 |
|
|
geforce l33t
Joined: 29 Dec 2003 Posts: 654 Location: Canada
|
|
Back to top |
|
|
geforce l33t
Joined: 29 Dec 2003 Posts: 654 Location: Canada
|
|
Back to top |
|
|
LoDown Apprentice
Joined: 26 Oct 2004 Posts: 189 Location: Louisville, Ky
|
Posted: Fri Jul 22, 2005 7:06 pm Post subject: |
|
|
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 |
|
|
geforce l33t
Joined: 29 Dec 2003 Posts: 654 Location: Canada
|
Posted: Fri Jul 22, 2005 11:40 pm Post subject: |
|
|
Well, only the domains are working but I'll continue my researches .
Thanks for help !
Phil _________________ http://tilde.club/~geforce/ |
|
Back to top |
|
|
|