apache automated vhost config

Discussion in 'General' started by Caracal, Sep 1, 2015.

  1. Caracal

    Caracal New Member

    Hello,
    I have a problem when adding a new website. ISPConfig creates an apache 2.4 vhost with directives like Require all denied or Require all enabled, but when I access the website, I get a 403 error (permission denied). If I manually change the config and replace Require all with
    Order Deny,Allow
    Deny from all
    everything works great.
    For the moment I deleted the lines
    Require all denied
    <tmpl_else>
    from /usr/local/ispconfig/server/conf/vhost.conf.master and the website vhost is created only with apache 2.2 directives (Order Deny,Allow / Deny from all)
    The strange thing is that I use Debian 8.1 and apache version is 2.4.10...so that's why the script is generating apache 2.4 config version. But it doesn't work.
    Does anyone have any idea why? Thanks.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    maybe you have some old apache 2.2config files in your apache setup, apache 2.4 directives require it that there is no apache 2.2 config present on the server anymore, otherwise the config settings will collide as apache 2.4 require statements can not override a deny set in apache 2.2 syntax.
     
    Caracal likes this.
  3. Caracal

    Caracal New Member

    I have ISPConfig since had Debian 6.something (can't remember exactly what Debian 6 version was). Debian was updated regulary, so was ISPConfing with ispconfig_update.sh command. But I never reconfigered services, if that matters.
    So, if I understood correctly, I need to manually edit all apache config files according to apache 2.4 for ISPConfig to make the vhosts right?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Reconfiguring of services is required for each ispconfig major version change and each os version change, otherwise you will use config file for the old os which can lead to all kind of problems. And you have to run a resync on all websites in ispconfig with the resync tool when switching from apache 2.2 to 2.4 to ensure that all sites use apache 2.4 syntax.

    No, thats all done by ispconfig. the problem is just that you did not permit a config file update by denying the reconfigure services question.

    1) redo the ispconfig update and choose reconfigure services.
    2) Login to ispconfig and go to tools > resync and resync all websites.
     
    Caracal likes this.
  5. Caracal

    Caracal New Member

    Thank you again! :)
    I have manualy changed main.cf (postfix) and one vhost for a website (some SSL settings) and that's why I did not wanted to reconfigure services...
    I'm going to make a backup and give it a try.
     
  6. Caracal

    Caracal New Member

    OK, how can I redo te update? :D ispconfig_update.sh tells me that I already have the latest version.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

  8. Caracal

    Caracal New Member

    I modified in /usr/local/ispconfig/server/lib/config.inc.php from
    define('ISPC_APP_VERSION', '3.0.5.4p8');
    to
    define('ISPC_APP_VERSION', '3.0.5.4p7');
    and ran ispconfig_update.sh again, which worked :)
    Thank you very much!!

    L.E.: I let ISPConfig to reconfigure services, resynced my websites and now everything is working! Vhosts are correct now for apache 2.4 version.
     
  9. Caracal

    Caracal New Member

    And first problem (I hope the only one):
    On one vhost I get permission denied. It's the vhost with the domain which is also the hostname for the server. This is with the old apache2.conf. If I change apache2.conf with apache2.conf.dpkg-dist, I get no vhosts, because that config file is looking in sites-enabled for files with .conf extension and all the files in that folder are .vhost.

    L.E.: Meh, changed .conf to .vhost.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Really bad idea, please undo the name changes. The files must be named .vhost on a ispconfig server.
     
  11. Caracal

    Caracal New Member

    No, I renamed the line in apache2.conf from
    IncludeOptional sites-enabled/*.conf
    to
    IncludeOptional sites-enabled/*.vhost
    not the vhost files.
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats better but still wrong, the line has to be:

    IncludeOptional sites-enabled/

    as ispconfig uses files with .vhost ending for vhosts and files with .conf ending for other configuartion settings.
     
    Caracal likes this.
  13. Caracal

    Caracal New Member

    But if I let IncludeOptional sites-enabled/ (as original), I don't get any vhosts settings....
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    This line includes everything in sites-enabled, so it must work. Maybe you have some wrong or duplicate files / links in there?
     
  15. Caracal

    Caracal New Member

    Oh, sorry, vhosts are working, except one, the one that is also the hostname of my server...uhm, I don't know what the problem is.
     

Share This Page