View previous topic :: View next topic |
Author |
Message |
paul7v7 n00b
Joined: 26 Feb 2006 Posts: 10
|
Posted: Thu Feb 08, 2007 12:30 am Post subject: |
|
|
ok added a directory /usr/htdocs to see what would happen and now i don't get the 404 error but a directory listing of that folder it seems. Just have to find out why and where it is referring to that folder. It seems that the document root is /usr/htdoc even though i have specified in the config files that it is /mnt/website/forum. Is there anywhere besides the default vhost config file in vhost.d and the httpd.conf that i should be looking?
So basically apache and php work now BUT i can't seem to be able to change the document root for apache. |
|
Back to top |
|
|
c4 Guru
Joined: 21 Feb 2004 Posts: 312 Location: Sweden
|
Posted: Thu Feb 08, 2007 8:08 pm Post subject: |
|
|
paul7v7, I would suggest that you do the following:
move or create a new backup of you apache config files in /etc/apache2 and than start with fresh new files.
Second, I would keep your httpd.conf basically as the standard-default file is, just change the Code: | ServerName paul7v7s-forum.org | under the section 2 part. My guess is that you want this to be whatever your default vhost will be. The serverroot settings at the top are not generally suppost to be edited, so let it remain as Code: | ServerRoot "/usr/lib/apache2" | they affect other things than your document root.
Then at the bottom of your httpd.conf, add you vhosts with Code: | ## Gentoo VHosts
#
# For Gentoo we include External Virtual Hosts Files.
#
Include conf/vhosts.d/00_default_vhost.conf |
After that, have a look at 00_default_vhost.conf, and edit it like such: Code: | #
# Use name-based virtual hosting.
#
NameVirtualHost *:80
<VirtualHost *:80>
ServerName paul7v7s-forum.org
ServerAlias *.paul7v7s-forum.org
DocumentRoot "/mnt/website/forum"
DirectoryIndex index.php
<Directory "/mnt/website/forum">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
|
That should do it, and keeping that certain vhost at the top of you vhost file will make it your default vhost.
add more vhosts by adding simular blocks underneith in your 00_default_vhost.conf file. (like this--> Code: | <VirtualHost *:80>
ServerName another-vhost.com
ServerAlias *.another-vhost.com
DocumentRoot "/mnt/website/another-vhost"
DirectoryIndex index.php
<Directory "/mnt/website/another-vhost">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost> |
Finally this is what /etc/conf.d/apache2 looks like for another gentoo-server I checked:
Code: | APACHE2_OPTS="-D DEFAULT_VHOST -D PHP5"
KEEPENV="PATH" |
Adjust this to also include -D USERDIR and see if this all works. Good Luck! _________________ AMD64 Gentoo Hardened server
AMD64 Xubuntu Desktop
X86 Dreamlinux Vaio laptop |
|
Back to top |
|
|
paul7v7 n00b
Joined: 26 Feb 2006 Posts: 10
|
Posted: Thu Feb 08, 2007 10:35 pm Post subject: |
|
|
C4, mate i appreciate all the help you have given me. looks to be working so far, just sorting some issues with the index.php but other than that it looks to be going well. Really appreciate the help. |
|
Back to top |
|
|
|
|
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
|
|