* [gentoo-user] Apache 2.2.6 - Problems with vhosts
@ 2008-11-12 8:59 99% Gololo
0 siblings, 0 replies; 1+ results
From: Gololo @ 2008-11-12 8:59 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 2341 bytes --]
Hello list,
I have a problem here with apache and vhosts that I hope you can help me to
solve.
I have apache 2.2.6 running in a box called myserver.university.edu
I start apache with the following options:
APACHE2_OPTS="-D DEFAULT_VHOST -D USERDIR -D PHP5"
With USERDIR active, users can use:
http://myserver.university.edu/usernameto access their files. It
works.
Now I have a user who adquired a domain (let's say: www.example.com) and
wants to redirect it to his user folder. For this, I edited the file:
00_default_vhost.conf
It looks like this:
--------------------------------------------------------------------------------------------
<IfDefine DEFAULT_VHOST>
Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
ServerName myserver.university.edu
Include /etc/apache2/vhosts.d/default_vhost.include
<IfModule mpm_peruser_module>
ServerEnvironment apache apache
</IfModule>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /home/group1/user1/public_html/
ServerName example.com
ServerAlias www.example.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /home/group1/user1/public_html/subdomain1
ServerName subdomain1.example.com
</VirtualHost>
</IfDefine>
--------------------------------------------------------------------------------------------
The file: default_vhost.include ; looks like this:
--------------------------------------------------------------------------------------------
ServerAdmin root@localhost
DocumentRoot "/var/www/localhost/htdocs"
<Directory "/var/www/localhost/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
<Directory "/var/www/localhost/cgi-bin">
AllowOverride None
Options None
</Directory>
--------------------------------------------------------------------------------------------
The problem I am having is the following:
When I type: http://myserver.university.edu/username it works for any user.
When I type: http://subdomain1.example.com/ it shows the files hosted in
/home/group1/user1/public_html/subdomain1
BUT, if I type: http://www.example.com or http://example.com, then, it
doesn't show the files hosted in /home/group1/user1/public_html/ BUT it
shows the files hosted in the root directory of apache:
/var/www/localhost/htdocs
Can anyone help me? :-)
[-- Attachment #2: Type: text/html, Size: 3578 bytes --]
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2008-11-12 8:59 99% [gentoo-user] Apache 2.2.6 - Problems with vhosts Gololo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox