wrong /error/ path in vhosts

Discussion in 'General' started by Roberto Altravia, Dec 12, 2018.

  1. Roberto Altravia

    Roberto Altravia New Member

    Hello,

    I have a working ispconfig3-stable-3.1-e2465bd7a2d324259c3c1dae00dfca8c2535edcc installation, but today I found something wrong in the configuration.

    First of all, in Server Config -> Web I have this settings:
    Website basedir: /data/www
    Website path: /data/www/clients/client[client_id]/web[website_id]
    Website symlinks: /data/www/sites/[website_domain]/:/data/www/clients/client[client_id]/[website_domain]/
    Make relative symlinks: yes

    So in /data/www/ I don't have the directory or links to the websites, I have the symlinks in /data/www/sites/

    The configuration is working, but looking at a sample vhost, there are obvious errors:

    How can I solve ? I don't like all the websites links under /data/www, putting them under /data/www/sites makes everything more clean

    Thank you,
    Roberto

    File /etc/apache2/sites-available/sample.com.vhost
    <Directory /data/www/sample.com> # THIS DOESN'T EXIST
    AllowOverride None
    Require all denied
    </Directory>

    <VirtualHost *:80>

    DocumentRoot /data/www/clients/client9/web14/web

    ServerName sample.com
    ServerAlias www.sample.com
    ServerAdmin webma[email protected]


    ErrorLog /var/log/ispconfig/httpd/sample.com/error.log

    Alias /error/ "/data/www/sample.com/web/error/" # THIS DOESN'T EXIST
    ErrorDocument 400 /error/400.html
    ErrorDocument 401 /error/401.html
    ErrorDocument 403 /error/403.html
    ErrorDocument 404 /error/404.html
    ErrorDocument 405 /error/405.html
    ErrorDocument 500 /error/500.html
    ErrorDocument 502 /error/502.html
    ErrorDocument 503 /error/503.html

    <IfModule mod_ssl.c>
    </IfModule>

    <Directory /data/www/sample.com/web> # THIS DOESN'T EXIST
    # Clear PHP settings of this website
    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
    SetHandler None
    </FilesMatch>
    Options +FollowSymLinks
    AllowOverride All
    Require all granted
    </Directory>
    <Directory /data/www/clients/client9/web14/web>
    # Clear PHP settings of this website
    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
    SetHandler None
    </FilesMatch>
    Options +FollowSymLinks
    AllowOverride All
    Require all granted
    </Directory>
    # suexec enabled
    <IfModule mod_suexec.c>
    SuexecUserGroup web14 client9
    </IfModule>
    <IfModule mod_fastcgi.c>
    <Directory /data/www/clients/client9/web14/cgi-bin>
    Require all granted
    </Directory>
    <Directory /data/www/sample.com/web> # THIS DOESN'T EXIST
    <FilesMatch "\.php[345]?$">
    SetHandler php-fcgi
    </FilesMatch>
    </Directory>
    <Directory /data/www/clients/client9/web14/web>
    <FilesMatch "\.php[345]?$">
    SetHandler php-fcgi
    </FilesMatch>
    </Directory>
    Action php-fcgi /php-fcgi virtual
    Alias /php-fcgi /data/www/clients/client9/web14/cgi-bin/php-fcgi-*-80-sample.com
    FastCgiExternalServer /data/www/clients/client9/web14/cgi-bin/php-fcgi-*-80-sample.com -idle-timeout 300 -socket /var/lib/php5-fpm/web14.sock -pass-header Authorization -pass-header Content-Type
    </IfModule>
    <IfModule mod_proxy_fcgi.c>
    #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/lib/php5-fpm/web14.sock|fcgi://localhost//data/www/clients/client9/web14/web/$1
    <Directory /data/www/clients/client9/web14/web>
    <FilesMatch "\.php[345]?$">
    SetHandler "proxy:unix:/var/lib/php5-fpm/web14.sock|fcgi://localhost"
    </FilesMatch>
    </Directory>
    </IfModule>

    # add support for apache mpm_itk
    <IfModule mpm_itk_module>
    AssignUserId web14 client9
    </IfModule>

    <IfModule mod_dav_fs.c>
    # Do not execute PHP files in webdav directory
    <Directory /data/www/clients/client9/web14/webdav>
    <ifModule mod_security2.c>
    SecRuleRemoveById 960015
    SecRuleRemoveById 960032
    </ifModule>
    <FilesMatch "\.ph(p3?|tml)$">
    SetHandler None
    </FilesMatch>
    </Directory>
    DavLockDB /data/www/clients/client9/web14/tmp/DavLock
    # DO NOT REMOVE THE COMMENTS!
    # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
    # WEBDAV BEGIN
    # WEBDAV END
    </IfModule>

    </VirtualHost>
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    That's exactly the mistake you made which broke your config. The reason for the wrong vhost is that you altered the symlink settings and removed a symlink that is required by ISPConfig (there must be a symlink for the domain name in the directory that you configured as website basedir). To fix our setup, restore the original symlink setup that shipped with ISPConfig.
     
  3. Roberto Altravia

    Roberto Altravia New Member

    Done. Now my Website symlinks field is /data/www/[website_domain]/:/data/www/clients/client[client_id]/[website_domain]/
    I applied the settings, on top page operations in red were applied, but under /data/www nothing changed, the symlinks were not created.

    Should I do that manually or is there a way to force ispconfig make the missing symlinks for the existing websites ?

    Thank you,
    Roberto
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The global config settings are just the presets for new sites, that's why the change did not create the missing symlinks. You can try to run Tools > Resync on the websites to see if they get added then.
     
  5. Roberto Altravia

    Roberto Altravia New Member

    Yes that fixed eveything

    IMHO having the websites links under a specific directory would make the ispconfig directory layout more clear

    Thanks again,
    Roberto
     

Share This Page