|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Changing the Document Root on a VPS per domain
Hi,
I have a VPS with Web Fusion, so I have multiple domains on one server. I have just recently installed Zend Framework and following their guidelines I should be storing all application logic outside of the document root. At the moment the document root for a site is: Code:
/var/www/vhosts/domainname.com/httpdocs/ I have created folders inside the current document root called "public" and "application". How can I change it so that public is the new document root for this domain? I have tried editing the apache2.conf file adding: Code:
<VirtualHost domainname.com:80>
DocumentRoot /var/www/vhosts/domainname.com/httpdocs/public/
</VirtualHost>
But that didn't seem to work. I am not sure what I should change any ideas will be greatly appreciated. Thanks, Ian |
|
#2
|
||||
|
||||
|
Don't add stuff to the configuration.
Look through the Apache file(s) for whatever mentions that document root. It could be the main DocumentRoot directive or it could be a DocumentRoot in a <VirtualHost>. Find it and change it. Then find the corresponding <Directory> and change that path. |
|
#3
|
||||
|
||||
|
If you are running apache2.2 edit the file sites-enabled/000-default
Change DocumentRoot and Directory path. |
|
#4
|
|||
|
|||
|
Hi,
I have found 000-default file which looks something like this: Code:
<VirtualHost *>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory />
Directives in here.
</Directory>
</VirtualHost>
I was expecting the document root to have httpdocs in it. I am not sure what I should be adding here now, could anyone help? Thanks, Ian |
|
#5
|
||||
|
||||
|
Quote:
If you are changing the document root other than the default server then you should edit the corresponding config file. "sites-enabled" directory contains only currently enabled server config files. Open the files and look for your domain name in "<VirtualHost>" tag. |
|
#6
|
|||
|
|||
|
Quote:
Where abouts can I find these files? I am looking in /etc/apache2/ and I can see a list of files:
Thank you. |
|
#7
|
|||
|
|||
|
Anyone have any more ideas on this?
|
|
#8
|
|||
|
|||
|
Don't forget to set ServerName!!!
<VirtualHost *:80> ServerName example.com ServerAlias www.example.com DocumentRoot /some/file/system </VirtualHost> |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Changing the Document Root on a VPS per domain |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|