1,918
edits
No edit summary Tag: 2017 source edit |
No edit summary Tag: 2017 source edit |
||
| Line 20: | Line 20: | ||
|Author||Philippe Grand — Atoo-Net | |Author||Philippe Grand — Atoo-Net | ||
|- | |- | ||
|Version||24.0. | |Version||24.0.1 | ||
|- | |- | ||
|License||GNU GPL v3+ | |License||GNU GPL v3+ | ||
| Line 77: | Line 77: | ||
The module declares no permission of its own: the administration pages are reserved for Dolibarr administrators, and the shop pages use their own customer session. | The module declares no permission of its own: the administration pages are reserved for Dolibarr administrators, and the shop pages use their own customer session. | ||
===Domain and virtual host=== | |||
The shop must be served from '''its own domain''' (for example <code>https://shop.example.com</code>), through a virtual host of the web server (Apache, Nginx…). Dolibarr's preview address, <code>…/public/website/index.php?website=…</code>, is for testing only: without a domain, the shop does not fully work. | |||
*The cart and the downloads call <code>/_service_page_ajax.php</code> and <code>/_service_download.php</code> at the root of the domain. Without a virtual host, these calls end in a 404 error and the cart stops updating. | |||
*In preview, Dolibarr prints an HTML comment before the page. If <code>output_buffering</code> is disabled in PHP, the buyer's session does not start ("session expired" at login). | |||
*The <code>sitemap.xml</code> and the <code>robots.txt</code> are built from the virtual host set on the website: if it is empty, they are not generated, and the e-mailing unsubscribe links point to Dolibarr instead of the shop. | |||
Setting it up: | |||
#Create a virtual host whose root (<code>DocumentRoot</code>) is the website directory: <code><documents>/website/<ref></code> (<code><documents>/<entity>/website/<ref></code> for an entity other than the first one). <code><documents></code> is the Dolibarr documents directory, and <code><ref></code> the reference of the website created on activation (<code>ultimatemarketplace</code> by default, see the "Website to use for the marketplace" setting). | |||
#PHP must be enabled there. The web server user must be able to read the Dolibarr files (<code>htdocs</code>) and write to <code><documents>/website</code> and <code><documents>/medias</code>; if <code>open_basedir</code> is used, it must include these directories. Allow symbolic links on the website directory: its <code>medias</code> folder is a link to <code><documents>/medias</code>. | |||
#Enable HTTPS on this domain: payment gateways require it. | |||
#In Dolibarr, '''Websites''' menu, open '''Edit website properties''' and enter the full domain, <code>https://</code> included, in the '''Virtual host or domain name''' field. | |||
Example for Apache, to adapt (paths of a Debian or Ubuntu package): | |||
<pre> | |||
<VirtualHost *:443> | |||
ServerName shop.example.com | |||
DocumentRoot "/var/lib/dolibarr/documents/website/ultimatemarketplace" | |||
<Directory "/var/lib/dolibarr/documents/website/ultimatemarketplace"> | |||
AllowOverride FileInfo Options | |||
Options -Indexes -MultiViews +FollowSymLinks -ExecCGI | |||
Require all granted | |||
</Directory> | |||
<Directory "/var/lib/dolibarr/documents/medias"> | |||
Options -Indexes -MultiViews -FollowSymLinks -ExecCGI | |||
Require all granted | |||
</Directory> | |||
SSLEngine on | |||
SSLCertificateFile /etc/letsencrypt/live/shop.example.com/fullchain.pem | |||
SSLCertificateKeyFile /etc/letsencrypt/live/shop.example.com/privkey.pem | |||
</VirtualHost> | |||
</pre> | |||
==Configuration== | ==Configuration== | ||
| Line 308: | Line 343: | ||
<code>robots.txt</code>, <code>sitemap.xml</code> and <code>llms.txt</code> are regenerated automatically when the module is enabled, when the Settings tab is opened and after a template reset. Once simplified URLs are enabled, the old URLs remain valid during the transition. | <code>robots.txt</code>, <code>sitemap.xml</code> and <code>llms.txt</code> are regenerated automatically when the module is enabled, when the Settings tab is opened and after a template reset. Once simplified URLs are enabled, the old URLs remain valid during the transition. | ||
==What's new in version 24.0.1== | |||
*'''Documentation''': the user guide and this page explain how to serve the shop on its own domain, through a virtual host whose root is the website directory (see [[#Domain and virtual host|Domain and virtual host]]). The module code is unchanged. | |||
==What's new in version 24.0.0== | ==What's new in version 24.0.0== | ||
| Line 330: | Line 369: | ||
==FAQ== | ==FAQ== | ||