Change document root for a single website to accomodate Zend Framework

Discussion in 'Installation/Configuration' started by chillifire, Aug 26, 2010.

  1. chillifire

    chillifire New Member

    Hi,

    I am using ISPConfig to host my website www.chillifre.net and related sites news.chillifire.net and support.chillifire.net. The website www.chillifire.net is making use of the Zend Framework and thus needs a document root of /var/www/www.chillifire.net/web/public in stead of the usual /var/www/www.chillifire.net/web I cannot make an overall and generic change as the two other sites are based on opensource packages that do not use Zend Framework and thus have to point to the normal /var/www/xxx/web document root. Currently I have to manually alter the configured file which only works until the next change of configuration 9as it is then of course overwritten.

    PS: Others may be interested in how the set up for Zend Framework on ISPConfig3 works - a lot of other add-on directives are required to make this work. Happy to post it on this forum once this document root issue has been resolved.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The zend framework should work fine with the directory /var/www/www.chillifire.net/web as well. So there is no need to change a directory path in the vhost and you can not change the path.
     
  3. 4F2E4A2E

    4F2E4A2E New Member

    change document root of any hosted web

    i did currently install redmine with ispconfig 3 and just one left problem over:
    i know i should not edit the vhost manually if i am using ispconfig but only this way it is working:
    Code:
    <Directory /home/www/xxx.com>
        AllowOverride None
        Order Deny,Allow
        Deny from all
    </Directory>
    
    <VirtualHost *:80>
    [B]      DocumentRoot /home/www/xxx.com/web/redmine/public[/B]
    
        ServerName xxx.com
        ServerAlias *.xxx.com
        ServerAdmin [email protected]
    
        ErrorLog /var/log/ispconfig/httpd/xxx.com/error.log
    
    
    [B]    <Directory /home/www/xxx.com/web/redmine/public>[/B]
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    [B]    <Directory /home/www/clients/client4/web38/web/redmine/public>[/B]
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    
        <IfModule mod_ruby.c>
    [B]      <Directory /home/www/clients/client4/web38/web/redmine/public>[/B]
            Options +ExecCGI
          </Directory>
          RubyRequire apache/ruby-run
          #RubySafeLevel 0
          <Files *.rb>
            SetHandler ruby-object
            RubyHandler Apache::RubyRun.instance
          </Files>
          <Files *.rbx>
            SetHandler ruby-object
            RubyHandler Apache::RubyRun.instance
          </Files>
        </IfModule>
    [B]<Directory /home/www/xxx.com/web/redmine/public>[/B]
            AddHandler fcgid-script .php .php3 .php4 .php5
            FCGIWrapper /home/www/php-fcgi-scripts/web38/.php-fcgi-starter .php
            Options +ExecCGI
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    [B]        <Directory /home/www/clients/client4/web38/web/redmine/public>[/B]
            AddHandler fcgid-script .php .php3 .php4 .php5
            FCGIWrapper /home/www/php-fcgi-scripts/web38/.php-fcgi-starter .php
            Options +ExecCGI
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    
    </VirtualHost>
    
    after a time ispconfig alters it again back to:
    Code:
    <Directory /home/www/xxx.com>
        AllowOverride None
        Order Deny,Allow
        Deny from all
    </Directory>
    
    <VirtualHost *:80>
    [B]      DocumentRoot /home/www/xxx.com/web[/B]
    
        ServerName xxx.com
        ServerAlias *.xxx.com
        ServerAdmin [email protected]
    
        ErrorLog /var/log/ispconfig/httpd/xxx.com/error.log
    
    
    [B]    <Directory /home/www/xxx.com/web>[/B]
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    [B]    <Directory /home/www/clients/client4/web38/web>[/B]
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    
        <IfModule mod_ruby.c>
    [B]      <Directory /home/www/clients/client4/web38/web>[/B]
            Options +ExecCGI
          </Directory>
          RubyRequire apache/ruby-run
          #RubySafeLevel 0
          <Files *.rb>
            SetHandler ruby-object
            RubyHandler Apache::RubyRun.instance
          </Files>
          <Files *.rbx>
            SetHandler ruby-object
            RubyHandler Apache::RubyRun.instance
          </Files>
        </IfModule>
    [B]<Directory /home/www/xxx.com/web>[/B]
            AddHandler fcgid-script .php .php3 .php4 .php5
            FCGIWrapper /home/www/php-fcgi-scripts/web38/.php-fcgi-starter .php
            Options +ExecCGI
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    [B]        <Directory /home/www/clients/client4/web38/web>[/B]
            AddHandler fcgid-script .php .php3 .php4 .php5
            FCGIWrapper /home/www/php-fcgi-scripts/web38/.php-fcgi-starter .php
            Options +ExecCGI
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    
    </VirtualHost>
    
    how can i set this in ispconfig?

    ispconfig settings:
    PHP open_basedir:
    /home/www/clients/client4/web38/web/redmine/public:/home/www/clients/client4/web38/tmp:/home/www/xxx.com/web/redmine/public:/srv/www/xxx.com/web/redmine/public:/usr/share/php5:/tmp:/usr/share/phpmyadmin

    please help
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Reinstall redmine so that it is installed in the web folder and not in web/redmine/public_html/
     
  5. 4F2E4A2E

    4F2E4A2E New Member

    /

    i need it on xxx.com/

    and not on anythings else after it.
    a new install would mean xxx.com/[X]

    i can't tell ispconfig either to use something _instead_ of web like:
    /home/www/xxx.com/web /home/www/xxx.com/X

    because then i would take redmine up and public would be the _public_ folder like:
    /home/www/xxx.com/public
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    According to your vhost file changes, you simply installed redmine in a wrong folder. So the fix is not to change the vhost file, the fix is to install redmine into the correct folder.

    Thats clear of course and the changes that I proposed does not mean that you have to use a different URL.
     
  7. 4F2E4A2E

    4F2E4A2E New Member

    shure

    shure i know that, but it's redmine and not wordpress.
    i can't just "install" it
    and it is not thought to change the "public" folder of redmine.

    i mean is it not possible with ispconfig?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Then you can only create a vhost file manually and place it in the sites-enabled folder and disable the site in ispconfig.

    I know a lot of commercial and open source cms ystems from small systems to enterprise wide installs and never seen one that has no configuration option for the path. You might want to contact the developers of the cms and ask them where to change the path, as I cant believe that such a path is hardcoded.
     
    Last edited: Mar 4, 2011
  9. eponymous

    eponymous New Member

    solution

    I'm using the Zend framework, and I just added the apache 'DocumentRoot' directive to make the website load the 'public' directory of my site, instead of the default 'web' directory.

    just select the site, then choose options, then in the Apache Directives box type
    Code:
    DocumentRoot "/the/absolute/path/of/the/directory/"
    Using ISPConfig Version: 3.0.3.2

    see the screenshot attached.
     

    Attached Files:

    Last edited: Mar 14, 2011
  10. lovendo

    lovendo New Member

    Hi,

    I know this post is quite old ...

    Anyway, is the only valuable solution I found.

    So the question goes to eponymous: did that actually work?

    Because that Apache Directive didn't work for me.

    ** mess YEAH, IT WORKED **

    Here is what I was doing wrong:

    I was using << DocumentRoot "/var/www/www.example.com/web/public_html/" >> instead of << DocumentRoot "/var/www/clients/clientX/webX/web/public_html/" >>

    Even if /var/www/www.example.com is a symbolic link to /var/www/clients/clientX/webX, it has to be used the second way.

    Problem solved, let's go for the next one.
     
    Last edited: Jan 17, 2014
  11. exeatweb

    exeatweb New Member

    Hi,

    thanks for the instant working solution (was about to upload a zend 2 project and found this post here)

    The "Options" Tab, to add / edit the php / Apache directives seems only be available by the administrator, or?
    I tried nearly everything and did not get the options tab to work as normal user.
    Is there an hidden option to allow the tab for other users too?

    Kindly regards
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, thats an admin only option.

    No, as this would allow a normal user to take over the whole server and the sites of other clients.
     
  13. Joe Winett

    Joe Winett New Member

    In ISPConfig 3.0.5.4, I was able to make Zend 2 work by adding the following into Apache Directives for the site. By using the {DOCROOT} macro, you don't need to know what that absolute path is.

    DocumentRoot "{DOCROOT}/public"
     
    suther likes this.
  14. NdK

    NdK Member

    Could be useful to have it inserted as a snippet, this way when you need to create another Z2 vhost you just click it.
     
  15. Very helpful. It might be useful for web developers to be able to change the document root especially for wordpress installations that contain child themes.
     
  16. Philgene

    Philgene New Member

    Joe Winetts' post worked perfectly for me - quick simple and easy pasted
    the following into Options: Apache Directives for the site.

    DocumentRoot "{DOCROOT}/public"

    By using the {DOCROOT} macro, you don't need to know what that absolute path is. Thanks Joe
     

Share This Page