Skip to main content

VirtualHost Differenct DocumentRoot and Directory

Comments

7 comments

  • cPRex Jurassic Moderator
    Hey there! Using the userdata files is the correct approach, as an include wouldn't perform that work. Can you let me know what issues you ran into with the userdata changes?
    0
  • xFreddie
    Setting the documentroot in the userdata will also change the directory. I need the document root to be public_html/public and the directory to point at public_html
    0
  • cPRex Jurassic Moderator
    I guess I'm not sure what you mean. If the docroot is setup to point to one directory, that would also be the location you'd want to put the files that get displayed on the web. It's important to note that changing the docroot doesn't remove the directory - /home/username/public_html will still exist, but just wouldn't be the primary docroot. You can still place data there and use it.
    0
  • xFreddie
    I guess I'm not sure what you mean. If the docroot is setup to point to one directory, that would also be the location you'd want to put the files that get displayed on the web. It's important to note that changing the docroot doesn't remove the directory - /home/username/public_html will still exist, but just wouldn't be the primary docroot. You can still place data there and use it.

    In order to install shopware 6 the VHost for the domain must look like this ServerName "_HOST_NAME_" DocumentRoot _SHOPWARE_DIR_/public Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all
    So in my case the VHost should look like this ServerName test.com DocumentRoot /home/test/public_html/public Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all
    How can I reach this?
    0
  • cPRex Jurassic Moderator
    Thanks for the additional details - that's exactly what I needed to see. I checked the Shopware directions on my end as well, and that also seems to indicate these should be different. The only way you could change this would be to modify the Apache default template, but then the change would be applied to all vhosts on the system. You may want to confirm with Shopware is this is something that is required or just something they recommend to split up the two areas, as I haven't run across an instance before where they are required to be different.
    0
  • xFreddie
    Thanks for the additional details - that's exactly what I needed to see. I checked the Shopware directions on my end as well, and that also seems to indicate these should be different. The only way you could change this would be to modify the Apache default template, but then the change would be applied to all vhosts on the system. You may want to confirm with Shopware is this is something that is required or just something they recommend to split up the two areas, as I haven't run across an instance before where they are required to be different.

    Sadly it's required, that's confirmed already. Changing the template for all vhosts is no solution as well. We tried shopware with one of your competitor and with wamp only, where you can change vhosts for every domain & it's working fine. Pointing to the public folder is not enough. It would be great if we could find a solution here, because I really like WHM / cPanel.
    0
  • cPRex Jurassic Moderator
    It looks like there isn't a way to separate this on a cPanel machine as the docroot will always match the Directory value. If you have other non-cPanel systems using this software, it might be best to continue to use those for this specific tool. It might be a good test to just set one up without changing the Directory value just to see if it works, but this seems like something that should be adjusted by Shopware to make that installation easier across multiple systems.
    0

Please sign in to leave a comment.