Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 3rd, 2009, 12:12 PM
urbantricker urbantricker is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 34 urbantricker User rank is Private First Class (20 - 50 Reputation Level)urbantricker User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 37 m 52 sec
Reputation Power: 2
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

Reply With Quote
  #2  
Old July 3rd, 2009, 09:17 PM
requinix's Avatar
requinix requinix is offline
nuts - top 5 poster again :(
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 5,301 requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)  Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 9 h 54 m 20 sec
Reputation Power: 2967
Send a message via MSN to requinix
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.
__________________
How to ask a PHP question | My stuff

Reply With Quote
  #3  
Old July 4th, 2009, 03:03 AM
fayax's Avatar
fayax fayax is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 180 fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Days 23 h 43 m 28 sec
Reputation Power: 175
If you are running apache2.2 edit the file sites-enabled/000-default
Change DocumentRoot and Directory path.
Comments on this post
requinix agrees: intriguing: you look like a spammer but you act like an intelligent human being
__________________

Reply With Quote
  #4  
Old July 6th, 2009, 10:20 AM
urbantricker urbantricker is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 34 urbantricker User rank is Private First Class (20 - 50 Reputation Level)urbantricker User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 37 m 52 sec
Reputation Power: 2
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

Reply With Quote
  #5  
Old July 7th, 2009, 09:46 AM
fayax's Avatar
fayax fayax is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 180 fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level)fayax User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Days 23 h 43 m 28 sec
Reputation Power: 175
Quote:
Originally Posted by urbantricker
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


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.

Reply With Quote
  #6  
Old July 16th, 2009, 07:48 AM
urbantricker urbantricker is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 34 urbantricker User rank is Private First Class (20 - 50 Reputation Level)urbantricker User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 37 m 52 sec
Reputation Power: 2
Quote:
Originally Posted by fayax
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.


Where abouts can I find these files?

I am looking in /etc/apache2/ and I can see a list of files:
  • apache2.conf
  • conf.d
  • envvars
  • httpd.conf
  • httpd.pem
  • mods-available
  • mods-enabled
  • ports.conf
  • sites-available
  • sites-enabled

Thank you.

Reply With Quote
  #7  
Old July 24th, 2009, 10:07 AM
urbantricker urbantricker is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 34 urbantricker User rank is Private First Class (20 - 50 Reputation Level)urbantricker User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 37 m 52 sec
Reputation Power: 2
Anyone have any more ideas on this?

Reply With Quote
  #8  
Old July 24th, 2009, 04:13 PM
iamroot iamroot is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 78 iamroot User rank is Second Lieutenant (5000 - 10000 Reputation Level)iamroot User rank is Second Lieutenant (5000 - 10000 Reputation Level)iamroot User rank is Second Lieutenant (5000 - 10000 Reputation Level)iamroot User rank is Second Lieutenant (5000 - 10000 Reputation Level)iamroot User rank is Second Lieutenant (5000 - 10000 Reputation Level)iamroot User rank is Second Lieutenant (5000 - 10000 Reputation Level)iamroot User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 17 h 1 m 32 sec
Reputation Power: 70
Don't forget to set ServerName!!!

<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /some/file/system
</VirtualHost>

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Changing the Document Root on a VPS per domain


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
Stay green...Green IT