Forum

hiawatha with shopware5

Hans
4 October 2017, 10:32
Hello Community,

i would like to migrate my shopware5 shops to hiawatha. My config is the nginx-config from here: https://github.com/bcremer/shopware-with-nginx/blob/master/global/shopware.conf

So i translate the config to hiawatha.conf:

UrlToolkit {

ToolkitID = shopware5

# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
Match ^/\. DenyAccess

# Deny all attems to access possible configuration files
Match \.(tpl|yml|ini|log)$ DenyAccess

# Deny access to media upload folder
Match ^/media/temp/(.*) DenyAccess

# Shopware caches and logs
Match ^/var/(.*) DenyAccess

# Deny access to root files
Match ^/(autoload\.php|composer\.(json|lock|phar)|CONTRIBUTING\.md|eula.*\.txt|license\.txt|README\.md|UPGRADE\.md)$ DenyAccess

Match ^/files/documents/(.*) DenyAccess

# Block direct access to ESDs, but allow the follwing download options:
# * 'PHP' (slow)
# * 'X-Accel' (optimized)
# Also see http://wiki.shopware.com/ESD_detail_1116.html#Ab_Shopware_4.2.2
#
# XXX

# Shopware install / update
Match ^/recovery/install/(.*) Rewrite /recovery/install/index.php$1;
Match ^/recovery/update/(.*) Rewrite /recovery/update/index.php$1;

# All static files will be served directly.
Match files/documents/(.*) Rewrite /engine/$1
Match backend/media/(.*) Rewrite /media/$1

# XML Sitemap support.
# XML SitemapMobile support.
# robots.txt support.
Match ^/(sitemap.xml|sitemapMobile.xml|robots.txt)$ Rewrite /shopware.php

RequestURI exists Return

Match [^?]*(\?.*)? Rewrite /shopware.php$1
}

Directory {

DirectoryId = shopware5

Path = /themes/Frontend/Responsive/frontend/_public/vendors/fonts, /themes/Frontend/Responsive/frontend/_public/src/fonts, /web/cache/,
ExpirePeriod = 1 weeks

}

VirtualHost {
RequiredBinding = ipv4_80, ipv6_80
Hostname = www.myshop, myshop
EnforceFirstHostname = yes
WebsiteRoot = /var/www/myshop/htdocs
# StartFile = shopware.php
AccessLogfile = /var/log/www/myshop.log
ErrorLogfile = /var/log/www/myshop-error.log
TimeForCGI = 30

UseFastCGI = php

UseToolkit = shopware5

ExecuteCGI = yes

CustomHeader = X-Frame-Options: sameorigin
CustomHeader = X-Xss-Protection: 1; mode=block
CustomHeader = X-Content-Type-Options: nosniff

CustomHeader = Vary: Accept-Encoding
}


My questions:
* is that config ok?
* is there an option in hiawatha like nginx "internal" keyword? (see XXX)

i would like documented in this thread an complete shopware5 config for hiawatha webserver.

best regards

Hans
Hugo Leisink
5 October 2017, 21:16
Hiawatha already denies access to files starting with a dot, so a rule for that one is not necessary. I'm not familiar with the Nginx configuration syntax, so I can't tell if the Hiawatha configuration is ok. My advice: test it carefully. If it all seems to work, it's ok.
This topic has been closed.