Ready for review
Correct the HTTP Reverse Proxy hub and the Apache proxy configuration pages
Review of HTTP Reverse Proxy for XWiki and of the three pages under Apache Server Key Configurations, against the Documentation Guide, the Apache HTTP Server documentation and the XWiki sources. Five pages, none created, none deleted, none renamed.
Configurations that do not work as documented
- ProxyPassReverse was given a nocanon argument it does not accept, on both OS pages. Its syntax is ProxyPassReverse [path] url [interpolate] and nocanon is a ProxyPass option, so Apache rejects the unknown parameter and the reader's first configtest fails on the block the page told them to paste.
- The xwiki.home example was not a valid xwiki.home. The HTTPS page gave
xwiki.home=https://localhost/xwiki, but the property is a server URL: xwiki.cfg documents it as "schema, domain and (optional) port, and the trailing /", XWikiServletURLFactory.getServerURL returns "the url of the server EG: http://www.xwiki.org/", and the context path is appended separately. It becomesxwiki.home=https://wiki.example.com/. - The Reference table misspelled Require all granted as Required all granted, contradicting the very configuration it is the reference for.
- The Linux page's result step told the reader to open
https://localhost, although the VirtualHost it had just pasted is *:80 with no SSLEngine. The Windows page had the same step written correctly. - Moving the proxy directives to the port 443 block silently dropped four of them. The HTTPS page says to move the Proxy Rules across, then shows a block without AllowEncodedSlashes NoDecode, nocanon, upgrade=websocket, the <Location> grant or RedirectMatch, so page names containing an encoded slash answer 404, realtime editing does not connect, and the root URL stops redirecting. It now shows the complete block.
- Three rows of the Reference table did not render as the directives they document. RewriteCond %{HTTPS}!=on lost the space between its two arguments; the two RewriteRule rows had their eaten by an unmatched italic span, so the live page reads ^/?(.*)https:%{SERVER_NAME}/$1; and the three ProxyPass/ProxyPassReverse rows put a URL inside ##…##, which the autolinker breaks — one of them ends in a stray ####. Every directive is in a code macro now.
- Two ProxyPass rows for the same path were documented as separate configuration lines, which cannot both apply; both child pages in fact use the single combined line. A ws:// RewriteRule row documented the deprecated mod_proxy_wstunnel approach that no example uses, with no RewriteCond %{HTTP:Upgrade}, so applied as written it would route every request into a WebSocket tunnel. Both are replaced by one row for upgrade=websocket, whose Apache 2.4.47 requirement was stated nowhere.
- Smaller ones: httpd.exe -k restart used to start a service that had never been started; the Linux page enabling headers and rewrite, which its configuration does not use, while the HTTPS page that does need them never mentions them; the Windows prose and code block disagreeing on how many modules to uncomment; "listents", "requeststo"; and the Installation hub linked from Related under the title of a different page ("Installation Methods" is a separate page that also exists).
Guideline work
- Two pages were typed against their content. The Apache directive table is stored as type=explanation while its identically-shaped NginX twin is reference — it becomes reference, its noun-phrase title already fitting. "More Configurations for the Apache HTTP Proxy Server" is also explanation, but it is two configuration blocks to paste plus "modify and add in the file" and "test and restart Apache" — it becomes a howto titled "Configure HTTPS for the Apache HTTP Proxy Server", with the three link labels pointing at it updated to match. Its page name is left as configurations: renaming is a move rather than an edit, and it is listed as a follow-up below, where the backlink survey that makes it safe is recorded.
- The hub routed past all three of its own children. It linked two grandchildren and one great-grandchild, so apache-key-configurations, nginx-key-configurations and ssh-tunneling were reachable only through the automatic "More" table. That matters here because two other pages route into this hub as a step — Configure XWiki in Docker Behind a Reverse Proxy and HTTPS for XWiki in Docker. All three children are now named and linked with one orienting clause each.
- Three FAQ answers were duplicated verbatim. "How can I check if Apache is running locally?" and the SSL modules answer were byte-identical on the Linux and Windows pages; the custom-domain answer was byte-identical on those two and on Set up NginX Proxy Server. The two Apache-wide answers move to the Apache Reference page, which both OS pages now link from their intro, and each OS page keeps only what is specific to its OS.
- The Apache related field linked one of its own children, which the not-children rule forbids; the content routes there instead. Both OS pages had no intro paragraph, opening straight on the numbered list. The Windows page nested its list four levels deep. The directive table mixed two VirtualHost blocks with no way to tell which row belonged where — it is now two tables under level-2 headings, matching the two configurations. 18 links pointed at the French Apache documentation, plus one pinned to docs/2.4. Non-breaking spaces, trailing whitespace and an unclosed parenthesis are gone.
- Three WIP banners are removed, one of which showed readers an author's note: "WIP-not sure how much a Windows version of the tutorial is needed". That question is real and is raised below rather than left in the page.
What was added
- A PlantUML diagram on the hub — reader, proxy, Servlet Container and XWiki, with the ports and the forwarded headers on the edges. It is the one visual this subtree can have: every page is a config-file procedure, so there is no UI to screenshot.
- What actually changes once XWiki is behind a proxy, which the hub never said: the container has to trust X-Forwarded-For and X-Forwarded-Proto, and xwiki.home has to hold the public base address for the URLs built outside a request. Each is a clause plus a link, not an explanation.
- The two failure modes readers hit, as FAQ entries on the Apache Reference page: 404 through the proxy while port 8080 works, and realtime editing not connecting. Obtaining the certificate is now the first step of the HTTPS procedure, and the /.well-known exemption says why it exists — it is where an ACME client answers the renewal challenge. A FAQ entry names the Red Hat differences, since the Linux page is written entirely in Debian terms under the title "on a Linux OS".
Deliberately left alone
Both OS pages stay type=tutorial: by the letter of Diataxis they are How-tos, but their sibling set-nginx is also a Tutorial, and retyping two of three would make the subtree inconsistent to fix a classification it has already settled. highlights stays empty on both hubs (three children each, and the content does the routing). Technical ID stays empty on all five — these are installation pages, not extension documentation. nocanon is kept alongside AllowEncodedSlashes NoDecode: they cover Apache's own canonicalisation and its handling of %2F, and XWiki needs both. The tables are not wrapped in figure/figureCaption although the guide asks for it, because no page in the tree does and doing it on one page would look accidental — worth raising for the tree as a whole. No number, path or directive value was changed other than the ones listed above.
Follow-ups, not in this change
- Rename configurations to configure-https, then pin the three Apache children in the order Linux, Windows, HTTPS — the new title otherwise sorts to the front of an alphabetical tree, ahead of the pages it depends on. A walk of all 705 documentation pages found exactly four references to that page, all of them on pages in this Change Request, so the move needs no repointing beyond it.
- Decide whether the Windows tutorial is wanted, per the banner removed above. It has been corrected on the assumption that it stays; it is linked from six pages, so dropping it would go through the page-deletion procedure.
- set-nginx hard-codes proxy_set_header X-Forwarded-Proto http, so an NginX instance terminating TLS tells XWiki the request arrived over plain HTTP — the exact bug the Tomcat proxy-headers page exists to prevent. The idiomatic value is $scheme, which the Docker reverse-proxy page already uses. The same page also carries the third copy of the custom-domain answer, and it is an Apache answer on an NginX page: it says to replace ServerName localhost, a directive NginX does not have.
- ssh-tunneling opens a
group in its first FAQ answer and closes it at the end of the second, so the two answers render inside one box; and it describes a two-hop path in prose where a diagram would carry it.
-
Eleni Cojocariu created this Change Request with changes for HTTP Reverse Proxy for XWiki
2 days ago
-
Eleni Cojocariu added a new change for Apache Server Key Configurations
2 days ago
-
Eleni Cojocariu added a new change for Configure Apache HTTP Server as a Proxy on a Linux OS
2 days ago
-
Eleni Cojocariu added a new change for Configure Apache HTTP Server as a Proxy on a Windows OS
2 days ago
-
Eleni Cojocariu added a new change for Configure HTTPS for the Apache HTTP Proxy Server
2 days ago
-
Eleni Cojocariu added a new change for HTTP Reverse Proxy for XWiki
2 days ago
-
Eleni Cojocariu added a new change for Apache Server Key Configurations
2 days ago
All changes
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. VincentMassol1 +XWiki.elenicojocariu - Content
-
... ... @@ -1,9 +1,36 @@ 1 - After[[installingXWiki>>documentation.xs.admin.installation.WebHome]], it's recommended to accessitthrough an##HTTP## proxy,especially when you wanttouse the standard##HTTP##/##HTTPS##portsinsteadof thedefault ##8080##. Also,fora [[variety of reasons>>https://en.wikipedia.org/wiki/Reverse_proxy]],itisnotidealtoallow users to connectdirectlyto tomcat.So it'sgenerallyrecommendedtoputanHTTPreverseproxysuchasApacheHTTPServeror Nginxwhen [[configuring Tomcat>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.WebHome]]. Ifso,then you wouldneedto[[ConfigureTomcat to FindProxy Headers>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]].1 +XWiki runs inside a [[Servlet Container>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.WebHome]] that answers plain ##HTTP##, by default on port ##8080##. An HTTP reverse proxy placed in front of it serves the wiki on the standard ##80## and ##443## ports, terminates ##HTTPS##, and becomes the single place where access control, logging and rate limiting apply — so the container itself never has to be reachable by readers. 2 2 3 -Using an HTTP proxy in front of XWiki provides several advantages such as standard ports (users can access XWiki via {{code language="none"}}http://{{/code}} or {{code language="none"}}https://{{/code}} without specifying port 8080), security, performance, access control. 3 +{{plantuml}} 4 +@startuml 5 +!theme bluegray 6 +skinparam componentStyle rectangle 7 +left to right direction 4 4 5 - Examplesof proxyserversusedwith XWiki:9 +actor "Reader" as USER 6 6 7 -* [[Configure Apache HTTP Server as a Proxy on a Linux OS>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configure-apache-server-linux.WebHome]], 8 -* [[Configure Apache HTTP Server as a Proxy on a Windows OS>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configure-apache-server-windows.WebHome]], 9 -* [[Set up NginX Proxy Server>>doc:documentation.xs.admin.installation.http-reverse-proxy.nginx-key-configurations.set-nginx.WebHome]]. 11 +component "**Reverse proxy** 12 +Apache HTTP Server or NginX 13 +terminates HTTPS, applies access control" as PROXY 14 +component "**Servlet container** 15 +Tomcat or Jetty 16 +trusts the forwarded headers" as CONTAINER 17 +component "**XWiki** 18 +builds URLs for the public address" as XWIKI 19 + 20 +USER --> PROXY : HTTPS, port 443 21 +PROXY --> CONTAINER : HTTP, port 8080 22 +Host, X-Forwarded-For, X-Forwarded-Proto 23 +CONTAINER --> XWIKI 24 +XWIKI --> PROXY : redirect to localhost:8080 25 +PROXY --> USER : redirect rewritten 26 +to the public URL 27 +@enduml 28 +{{/plantuml}} 29 + 30 +Two things change once XWiki stops receiving requests directly. The Servlet Container has to be told to trust the ##X-Forwarded-For## and ##X-Forwarded-Proto## headers the proxy sends, otherwise XWiki sees every visitor as coming from the proxy over plain ##HTTP## and generates {{code language="none"}}http://{{/code}} links for people who arrived over ##HTTPS## — see [[Configure Tomcat to Find Proxy Headers>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]]. And the ##xwiki.home## property of the [[##xwiki.cfg## configuration file>>doc:documentation.xs.admin.configuration.WebHome]] has to hold the public base address, because URLs built outside a request — in notification mails, for instance — have no forwarded headers to derive it from. 31 + 32 +Both Apache HTTP Server and NginX are used in front of XWiki; the choice usually follows whichever of them is already installed and administered. 33 + 34 +* [[Apache Server Key Configurations>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.WebHome]] — the Apache directives a wiki needs, and the procedures that set them up on Linux, on Windows and for ##HTTPS##. 35 +* [[NginX Server Key Configurations>>doc:documentation.xs.admin.installation.http-reverse-proxy.nginx-key-configurations.WebHome]] — the equivalent NginX directives, and the procedure that sets them up. 36 +* [[Reverse Proxy and SSH Tunneling>>doc:documentation.xs.admin.installation.http-reverse-proxy.ssh-tunneling.WebHome]] — reaching a wiki that runs on a machine with no public address, through a remote server.
- DocApp.Code.DocumentationClass[0]
-
- Related
-
... ... @@ -1,4 +1,4 @@ 1 -* [[Installation Methods>>doc:documentation.xs.admin.installation.WebHome]].2 -* [[ Installa Standalone(Demo) Distribution>>doc:documentation.xs.admin.installation.methods.install-standalone-demo-distribution.WebHome]].3 -* [[ Install XWiki without InternetConnection(XIPPackage)>>doc:documentation.xs.admin.installation.install-offline.WebHome]].4 -* [[ ConfigureTomcat to Find ProxyHeaders>>documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]].1 +* [[Installation>>doc:documentation.xs.admin.installation.WebHome]]. 2 +* [[Configure a Servlet Container>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.WebHome]]. 3 +* [[Configure Tomcat to Find Proxy Headers>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]]. 4 +* [[Reverse proxy>>https://en.wikipedia.org/wiki/Reverse_proxy]].
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,34 +1,28 @@ 1 -{{warning}} 2 -WIP 3 -{{/warning}} 1 +[[Apache HTTP Server>>https://httpd.apache.org/]] forwards requests to XWiki through its [[mod_proxy>>https://httpd.apache.org/docs/current/mod/mod_proxy.html]] module. The directives below are the ones a wiki needs; [[Configure Apache HTTP Server as a Proxy on a Linux OS>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configure-apache-server-linux.WebHome]] and [[Configure Apache HTTP Server as a Proxy on a Windows OS>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configure-apache-server-windows.WebHome]] assemble them into a complete ##VirtualHost##, and [[Configure HTTPS for the Apache HTTP Proxy Server>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configurations.WebHome]] adds the ##HTTPS## ones. 4 4 5 - ApacheHTTPServer is a widely usedopen-source web server used also as a reverse proxy,forwarding clientrequests to backend applications, such as XWiki. Thefollowing configuration keysensure proper communication between Apache and XWiki:3 +== Proxy Directives == 6 6 7 -|=Configuration Line|=Description/Official Apache Documentation 8 -|{{code language="none"}}*:80{{/code}}|The ##VirtualHost## listents on all network interfaces (##*##) on port ##80##. All HTTP requests go through this block. 9 -|##ServerName##|Set to ##localhost## for no custom domains. 10 -|##RewriteEngine On##|Enables the runtime rewriting engine provided by [[Apache mod_rewrite>>https://httpd.apache.org/docs/current/mod/mod_rewrite.html]]. This must be set to ##On## in order for any ##RewriteCond## or ##RewriteRule## to be processed. 11 -|##RewriteCond %{HTTPS}~!=on##|Condition that checks whether the current request is not using ##HTTPS##. If the request is made over ##HTTP##, the rule will be applied. This is commonly used to enforce secure connections. 12 -|##RewriteCond %{REQUEST_URI} !^/.well-known##|Condition that ensures that requests starting with [[##/.well-known##>>https://en.wikipedia.org/wiki/Well-known_URI]] are not redirected. Check also [[Apache rewrite module documentation>>https://httpd.apache.org/docs/current/mod/mod_rewrite.html]]. 13 -|##RewriteRule ^/?(.*)https~://%{SERVER_NAME}/$1 [R,L]//##|##RewriteRule## that forces all HTTP requests (except those matching the specified condition) to be redirected to the HTTPS version of the same URL. Check also [[Apache rewrite module documentation>>https://httpd.apache.org/docs/current/mod/mod_rewrite.html]]. 14 -|##RewriteRule ^/xwiki/(.*)ws~://localhost:8080/xwiki/$1 [P,L]//##|Proxies matching requests to the backend using ##ws://##. The ##[P]## flag enables proxying, ##[L]## stops further processing.## 15 -|DocumentRoot|[[DocumentRoot>>https://httpd.apache.org/docs/2.4/fr/urlmapping.html#documentroot]] 16 -|##ErrorLog ${APACHE_LOG_DIR}/xwiki-error.log## and ##CustomLog ${APACHE_LOG_DIR}/xwiki-access.log combined##|Specify the path for logs to help debug. 17 -|##RedirectMatch ^/$ /xwiki/##|Matches requeststo the root URL ##/## and redirects them to ##/xwiki/##. Typing {{code language="none"}}http://localhost{{/code}} automatically goes to XWiki. 18 -|((( 19 -{{code language="none"}} 20 - <Location /xwiki> 21 - Required all granted 22 - </Location> 23 -{{/code}} 24 -)))|Sets access permissions for ##/xwiki##, allowing anyone to access this path. 25 -|##AllowEncodedSlashes NoDecode##|Allows special characters (/, +) to pass without decoding, since XWiki can encode slashes in URLs. 26 -|ProxyRequests Off|Proxy Rules: [[ProxyRequests>>https://httpd.apache.org/docs/current/fr/mod/mod_proxy.html#proxyrequests]]. Make sure it is set to "Off", as specified in the Apache documentation. 27 -|##SSLEngine on##|Enables SSL/TLS support for this ##VirtualHost, ##allowing the server to handle HTTPS requests. 28 -|##SSLCertificateFile /path/to/certificate##|Specifies the path to the SSL certificate file (public certificate). This file is used to identify the server to clients during the HTTPS handshake. See also [[SSLCertificateFile directive>>https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslcertificatefile]]. 29 -|##SSLCertificateKeyFile /path/to/privatekey##|Specifies the path to the private key associated with the SSL certificate. This key must match the certificate defined in ##SSLCertificateFile## and is required to establish secure connections. See also [[SSLCertificateKeyFile directive>>https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslcertificatekeyfile]]. 30 -|##ProxyPreserveHost##|Proxy Rules: [[##ProxyPreserveHost##>>https://httpd.apache.org/docs/current/fr/mod/mod_proxy.html#proxypreservehost]] 31 -|##ProxyPass /xwiki http://localhost:8080/xwiki nocanon##|Maps incoming requests to the backend server. The ##nocanon## option ensures that special characters (such as ##;##) are not modified or re-encoded by the proxy. 32 -|##ProxyPass /xwiki http://localhost:8080/xwiki upgrade=websocket##|Enables WebSocket support by allowing protocol upgrades when required (used for features like real-time updates). 33 -|##RequestHeader set X-Forwarded-Proto "https"##|Ensures HTTPS is properly detected by XWiki. When Apache terminates SSL and forwards requests to XWiki over HTTP, the backend application may not detect that the original request was made over HTTPS. 34 -|##ProxyPassReverse /xwiki http://localhost:8080/xwiki####|Proxy Rules: If XWiki sends a redirect pointing to {{code language="none"}}localhost:8080{{/code}}, Apache rewrites it to ##/xwiki##. 5 +|=Directive|=What it does 6 +|{{code language="none"}}<VirtualHost *:80>{{/code}}|Opens the block that handles every request arriving on port ##80##, on all network interfaces (##*##). 7 +|##ServerName localhost##|The host name this block answers for. Set it to the wiki's public domain, for example {{code language="none"}}ServerName wiki.example.com{{/code}}. 8 +|{{code language="none"}}ErrorLog ${APACHE_LOG_DIR}/xwiki-error.log{{/code}} and {{code language="none"}}CustomLog ${APACHE_LOG_DIR}/xwiki-access.log combined{{/code}}|Optional per-wiki log files, so that proxy problems can be told apart from the rest of the server's traffic. 9 +|##RedirectMatch ^/$ /xwiki/##|Redirects the root URL to the wiki, so that {{code language="none"}}http://localhost{{/code}} reaches XWiki without ##/xwiki## being typed. See [[RedirectMatch>>https://httpd.apache.org/docs/current/mod/mod_alias.html#redirectmatch]]. 10 +|{{code language="none"}}<Location /xwiki>{{/code}} with ##Require all granted##|Grants access to the proxied path. See [[Require>>https://httpd.apache.org/docs/current/mod/mod_authz_core.html#require]]. 11 +|##AllowEncodedSlashes NoDecode##|Lets Apache forward URLs that contain an encoded slash (##%2F##) without decoding it, which XWiki page names can contain. The default is ##Off##, under which Apache answers ##404## for such URLs. See [[AllowEncodedSlashes>>https://httpd.apache.org/docs/current/mod/core.html#allowencodedslashes]]. 12 +|##ProxyRequests Off##|Disables the forward proxy, which a reverse proxy never uses and which would otherwise turn the server into an open proxy. See [[ProxyRequests>>https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxyrequests]]. 13 +|##ProxyPreserveHost On##|Forwards the client's ##Host## header to XWiki, so that XWiki builds URLs for the public domain rather than for ##localhost##. See [[ProxyPreserveHost>>https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypreservehost]]. 14 +|{{code language="none"}}ProxyPass /xwiki http://localhost:8080/xwiki nocanon upgrade=websocket{{/code}}|Forwards ##/xwiki## to the Servlet Container. ##nocanon## passes the path on raw, leaving characters such as ##;## and encoded slashes untouched; ##upgrade=websocket## tunnels the WebSocket connections that realtime editing uses, and needs Apache HTTP Server 2.4.47 or later. See [[ProxyPass>>https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass]]. 15 +|{{code language="none"}}ProxyPassReverse /xwiki http://localhost:8080/xwiki{{/code}}|Rewrites the ##Location## header of the redirects XWiki returns, so that a redirect to {{code language="none"}}localhost:8080{{/code}} reaches the reader as one to the public URL. It takes no ##nocanon## option. See [[ProxyPassReverse>>https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypassreverse]]. 16 + 17 +== HTTPS and Redirection Directives == 18 + 19 +|=Directive|=What it does 20 +|{{code language="none"}}<VirtualHost *:443>{{/code}}|Opens the block that handles ##HTTPS## requests. It carries the same proxy directives as the port ##80## block, plus the ones below. 21 +|##SSLEngine on##|Enables TLS for this block. Provided by [[mod_ssl>>https://httpd.apache.org/docs/current/mod/mod_ssl.html]]. 22 +|##SSLCertificateFile /path/to/certificate##|The server certificate presented to browsers during the TLS handshake. See [[SSLCertificateFile>>https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslcertificatefile]]. 23 +|##SSLCertificateKeyFile /path/to/privatekey##|The private key matching that certificate. See [[SSLCertificateKeyFile>>https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslcertificatekeyfile]]. 24 +|##RequestHeader set X-Forwarded-Proto "https"##|Tells XWiki that the reader's request used ##HTTPS##, which Apache would otherwise hide by forwarding it over plain ##HTTP##. Provided by [[mod_headers>>https://httpd.apache.org/docs/current/mod/mod_headers.html]], and only effective once the container trusts the header — see [[Configure Tomcat to Find Proxy Headers>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]]. 25 +|##RewriteEngine On##|Enables the rewriting engine, without which no ##RewriteCond## or ##RewriteRule## is processed. Provided by [[mod_rewrite>>https://httpd.apache.org/docs/current/mod/mod_rewrite.html]]. 26 +|{{code language="none"}}RewriteCond %{HTTPS} !=on{{/code}}|Restricts the rule below to requests that did not arrive over ##HTTPS##. 27 +|{{code language="none"}}RewriteCond %{REQUEST_URI} !^/.well-known{{/code}}|Exempts [[##/.well-known##>>https://en.wikipedia.org/wiki/Well-known_URI]], where an ACME client such as certbot answers the challenge that issues and renews the certificate, and which therefore has to stay reachable over plain ##HTTP##. 28 +|{{code language="none"}}RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]{{/code}}|Redirects everything else to the ##HTTPS## address of the same URL. ##[R]## makes it an external redirect and ##[L]## stops further rules being applied. See [[RewriteRule Flags>>https://httpd.apache.org/docs/current/rewrite/flags.html]].
- DocApp.Code.DocumentationClass[0]
-
- FAQ
-
... ... @@ -1,0 +1,15 @@ 1 +== How can I check whether Apache is running? == 2 + 3 +Open {{code language="none"}}http://localhost{{/code}} in a browser: Apache's own default page means the server is running but is not forwarding to XWiki yet. 4 + 5 +== How do I serve the wiki on my own domain instead of localhost? == 6 + 7 +Set ##ServerName## to that domain, for example {{code language="none"}}ServerName wiki.example.com{{/code}}, and make sure the name resolves — a name that is not published in DNS has to be added to the ##hosts## file of every machine that uses it. 8 + 9 +== Why does the wiki answer 404 through the proxy while port 8080 still works? == 10 + 11 +The proxied path does not match the wiki's context path: ##ProxyPass##, ##ProxyPassReverse## and ##<Location>## all have to use the same ##/xwiki## prefix as the Servlet Container. 12 + 13 +== Why does realtime editing not work through the proxy? == 14 + 15 +Its WebSocket connection is not being tunnelled: ##ProxyPass## needs the ##upgrade=websocket## option, on Apache HTTP Server 2.4.47 or later. - Related
-
... ... @@ -1,3 +1,4 @@ 1 +* [[NginX Server Key Configurations>>doc:documentation.xs.admin.installation.http-reverse-proxy.nginx-key-configurations.WebHome]]. 2 +* [[Configure Tomcat to Find Proxy Headers>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]]. 3 +* [[Apache Reverse Proxy Guide>>https://httpd.apache.org/docs/current/howto/reverse_proxy.html]]. 1 1 * [[RewriteRule Flags>>https://httpd.apache.org/docs/current/rewrite/flags.html]]. 2 -* [[More Configurations for the Apache HTTP Proxy Server>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configurations.WebHome]]. 3 -* [[Configure Tomcat to Find Proxy Headers>>documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]]. - Type
-
... ... @@ -1,1 +1,1 @@ 1 -e xplanation1 +reference
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,21 +1,13 @@ 1 -To set the Apache HTTP Server Proxy:1 +Apache HTTP Server forwards requests to the XWiki [[Servlet Container>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.WebHome]] on a Linux system, using the [[directives XWiki needs>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.WebHome]]. This procedure serves the wiki over plain ##HTTP## on port ##80##; [[Configure HTTPS for the Apache HTTP Proxy Server>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configurations.WebHome]] adds ##HTTPS## on top of it. The commands are those of a Debian-based distribution. 2 2 3 -1. Make sure your wiki is running and accessible locally, (e.g., at {{code language="none"}}http://localhost:8080/{{/code}}. 4 -1. [[Install Apache HTTP Server>>https://httpd.apache.org/]] (for Unix systems). 5 -1. Enable required [[Apache modules>>https://httpd.apache.org/docs/current/fr/mod/]] for proxy:((( 6 -* [[##proxy_module##>>https://httpd.apache.org/docs/current/fr/mod/mod_proxy.html#access]] 7 -* [[##proxy_http_module##>>https://httpd.apache.org/docs/current/fr/mod/mod_proxy_http.html]] 8 -* [[##headers_module##>>https://httpd.apache.org/docs/current/fr/mod/mod_headers.html]] 9 -* [[##rewrite##>>https://httpd.apache.org/docs/current/fr/mod/mod_rewrite.html]] 10 -))) 11 -1. Restart Apache. 12 -1. Configure the Virtual Hosts and the Reverse Proxy: edit your Apache configuration file (e.g., ##/etc/apache2/sites-available/xwiki.conf##) and add:((( 3 +1. Make sure your wiki is running and reachable locally, for example at {{code language="none"}}http://localhost:8080/xwiki{{/code}}. 4 +1. [[Install Apache HTTP Server>>https://httpd.apache.org/]], version 2.4.47 or later, which is what the ##upgrade=websocket## option below needs. 5 +1. Enable the proxy modules: {{code language="none"}}sudo a2enmod proxy proxy_http{{/code}}. 6 +1. Create the file ##/etc/apache2/sites-available/xwiki.conf## with the following content:((( 13 13 {{code language="apacheconf"}} 14 14 <VirtualHost *:80> 15 15 ServerName localhost 16 16 17 - DocumentRoot /var/www/ 18 - 19 19 ErrorLog ${APACHE_LOG_DIR}/xwiki-error.log 20 20 CustomLog ${APACHE_LOG_DIR}/xwiki-access.log combined 21 21 ... ... @@ -24,22 +24,18 @@ 24 24 <Location /xwiki> 25 25 Require all granted 26 26 </Location> 27 - 19 + 28 28 AllowEncodedSlashes NoDecode 29 - 21 + 30 30 ProxyRequests Off 31 31 ProxyPreserveHost On 32 32 33 33 ProxyPass /xwiki http://localhost:8080/xwiki nocanon upgrade=websocket 34 - ProxyPassReverse /xwiki http://localhost:8080/xwiki nocanon 35 - 26 + ProxyPassReverse /xwiki http://localhost:8080/xwiki 36 36 </VirtualHost> 37 - 38 38 {{/code}} 39 39 ))) 40 -1. Enable the Apache site, using {{code language="none"}}a2ensite{{/code}}. 41 -1. Reload Apache. 42 -1. Test the setup:((( 43 -1. Open your browser: {{code language="none"}}https://localhost{{/code}}. You should be redirected to {{code language="none"}}https://localhost/xwiki{{/code}}. 44 -1. XWiki should load correctly. 45 -))) 30 +1. Enable the site: {{code language="none"}}sudo a2ensite xwiki{{/code}}. 31 +1. Check the configuration: {{code language="none"}}sudo apachectl configtest{{/code}}. 32 +1. Reload Apache: {{code language="none"}}sudo systemctl reload apache2{{/code}}. 33 +1. Open {{code language="none"}}http://localhost{{/code}} in a browser. Apache redirects to {{code language="none"}}http://localhost/xwiki/{{/code}} and the wiki loads through port ##80##, with no port number in the address.
- DocApp.Code.DocumentationClass[0]
-
- FAQ
-
... ... @@ -1,15 +1,7 @@ 1 -== HowcanIcheckifApacheisrunning locally? ==1 +== Why does the configuration file have to be enabled separately? == 2 2 3 - Beforeconfiguring theproxyserverforXWiki,you cancheck whether Apacheisrunning by opening yourbrowserandtype {{code language="none"}}http://localhost{{/code}}.Ifyouseea pagefromApache,it meansit'srunning.3 +Apache only reads the files in ##/etc/apache2/sites-enabled/##, and ##a2ensite## is what creates the symbolic link there to the file in ##sites-available##. 4 4 5 -== How canI configurethe proxyserverifIhavea customdomain? ==5 +== What differs on a distribution that is not Debian-based? == 6 6 7 -Replace the {{code language="none"}}ServerName localhost{{/code}} with your custom domain, for example {{code language="none"}}ServerName wiki.example.com{{/code}}. If needed (e.g., when using custom local domain, which are not real public domains), you must configure DNS resolution so that your system knows where to route the request. To do so, edit the ##hosts## file to add for example {{code language="none"}}127.0.0.1 wiki.example.local{{/code}}. 8 - 9 -== What if I need also modules for ##SSL##, or other modules? == 10 - 11 -There are of course a lot of ways to configure the proxy server, and plenty of [[Apache modules>>https://httpd.apache.org/docs/current/fr/mod/]], such as [[##SSL##>>https://httpd.apache.org/docs/current/fr/mod/mod_ssl.html]]. Check also [[more configurations for the Apache HTTP Proxy server>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configurations.WebHome]]. 12 - 13 -== What if I get ##404## error == 14 - 15 -A common mistake is the following issue: ##404## or broken links. Check: ##/xwiki## mapping. 7 +On Red Hat based systems the service is named ##httpd##, the same ##VirtualHost## block goes into a file under ##/etc/httpd/conf.d/##, and the modules are loaded by ##LoadModule## lines in ##/etc/httpd/conf/httpd.conf## instead of by ##a2enmod##. - Related
-
... ... @@ -1,4 +1,4 @@ 1 +* [[Configure Apache HTTP Server as a Proxy on a Windows OS>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configure-apache-server-windows.WebHome]]. 1 1 * [[Set up NginX Proxy Server>>doc:documentation.xs.admin.installation.http-reverse-proxy.nginx-key-configurations.set-nginx.WebHome]]. 3 +* [[Configure Tomcat to Find Proxy Headers>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]]. 2 2 * [[Apache Reverse Proxy Guide>>https://httpd.apache.org/docs/current/howto/reverse_proxy.html]]. 3 -* [[Configure Apache HTTP Server as a Proxy on a Windows OS>>documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configure-apache-server-windows.WebHome]]. 4 -* [[Configure Tomcat to Find Proxy Headers>>documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]].
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,72 +1,37 @@ 1 -{{warning}} 2 -WIP-not sure how much a Windows version of the tutorial is needed 3 -{{/warning}} 1 +Apache HTTP Server forwards requests to the XWiki [[Servlet Container>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.WebHome]] on a Windows system, using the [[directives XWiki needs>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.WebHome]]. Windows has no Apache package, so the server is unpacked from an archive and registered as a Windows service; everything else is configured in the single ##httpd.conf## file. 4 4 5 -To set the Apache HTTP Server Proxy: 6 - 7 -1. Make sure your wiki is running and accessible locally (e.g., at {{code language="none"}}http://localhost:8080/{{/code}}. 8 -1. Install [[Apache Lounge>>https://www.apachelounge.com/download/]] (Apache HTTP Server for Windows):((( 9 -1. Download Apache (e.g., ##httpd-2.4.x-win64-VS17.zip##). 10 -1. Extract the archive to a directory, for example: ##C:\Apache24##. 11 -1. Install Apache as a Windows service:((( 12 -* Open Command Prompt as Administrator and run: 13 - 14 -{{code language="none"}} 15 -cd C:\Apache24\bin 16 -httpd.exe -k install 17 -{{/code}} 18 -))) 19 -))) 20 -1. Fix the Apache configuration path (if needed):((( 21 -* Edit the file ##C:\Apache24\conf\httpd.conf## and ensure the following line matches your installation directory:((( 22 -{{code language="none"}} 23 -Define SRVROOT "C:/Apache24" 24 -{{/code}} 25 -)))If you installed Apache in a different folder (e.g., ##C:\Apache\Apache24##), update the path accordingly. 26 -))) 27 -1. Set the server name (to avoid warnings):((( 28 -* In ##httpd.conf##, uncomment and update:((( 29 -{{code language="none"}} 30 -ServerName localhost:80 31 -{{/code}} 32 -))) 33 -))) 34 -1. Enable required [[Apache modules>>https://httpd.apache.org/docs/current/fr/mod/]] for proxy:((( 35 -In ##httpd.conf##, uncomment the following lines (remove the #) to enable the [[##proxy_module##>>https://httpd.apache.org/docs/current/fr/mod/mod_proxy.html#access]], [[##proxy_http_module##>>https://httpd.apache.org/docs/current/fr/mod/mod_proxy_http.html]], [[##headers_module##>>https://httpd.apache.org/docs/current/fr/mod/mod_headers.html]], [[##rewrite_module##>>https://httpd.apache.org/docs/current/fr/mod/mod_rewrite.html]]: 36 - 3 +1. Make sure your wiki is running and reachable locally, for example at {{code language="none"}}http://localhost:8080/xwiki{{/code}}. 4 +1. Download an [[Apache Lounge>>https://www.apachelounge.com/download/]] build of Apache HTTP Server, version 2.4.47 or later, which is what the ##upgrade=websocket## option below needs. 5 +1. Extract the archive to ##C:\Apache24##. 6 +1. Set {{code language="none"}}Define SRVROOT "C:/Apache24"{{/code}} in ##C:\Apache24\conf\httpd.conf## to the directory you extracted to. 7 +1. Uncomment {{code language="none"}}ServerName localhost:80{{/code}} in the same file. 8 +1. Uncomment the two proxy modules in the same file:((( 37 37 {{code language="apacheconf"}} 38 38 LoadModule proxy_module modules/mod_proxy.so 39 39 LoadModule proxy_http_module modules/mod_proxy_http.so 40 -LoadModule headers_module modules/mod_headers.so 41 -LoadModule rewrite_module modules/mod_rewrite.so 42 -LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so 43 43 {{/code}} 44 44 ))) 45 -1. Restart Apache: {{code language="none"}}httpd.exe -k restart{{/code}}. 46 -1. Configure the Reverse Proxy: edit ##C:\Apache24\conf\httpd.conf## and add:((( 14 +1. Add the following block at the end of the same file:((( 47 47 {{code language="apacheconf"}} 48 48 <VirtualHost *:80> 49 49 ServerName localhost 50 50 51 - ProxyRequests Off 52 - ProxyPreserveHost On 19 + RedirectMatch ^/$ /xwiki/ 53 53 21 + <Location /xwiki> 22 + Require all granted 23 + </Location> 24 + 54 54 AllowEncodedSlashes NoDecode 55 55 56 - <Proxy *> 57 - Require all granted 58 - </Proxy> 27 + ProxyRequests Off 28 + ProxyPreserveHost On 59 59 60 - RedirectMatch ^/$ /xwiki/ 61 - 62 62 ProxyPass /xwiki http://localhost:8080/xwiki nocanon upgrade=websocket 63 - ProxyPassReverse /xwiki http://localhost:8080/xwiki nocanon 64 - 65 -</VirtualHost> 31 + ProxyPassReverse /xwiki http://localhost:8080/xwiki 32 +</VirtualHost> 66 66 {{/code}} 67 67 ))) 68 -1. Restart Apache. 69 -1. Test the setup:((( 70 -* Open your browser: {{code language="none"}}http://localhost{{/code}}. You should be redirected to {{code language="none"}}http://localhost/xwiki{{/code}}. 71 -* XWiki should load correctly. 72 -))) 35 +1. Register Apache as a Windows service: open a Command Prompt as Administrator and run {{code language="none"}}cd C:\Apache24\bin{{/code}} then {{code language="none"}}httpd.exe -k install{{/code}}. 36 +1. Start the service: {{code language="none"}}httpd.exe -k start{{/code}}. After any later change to ##httpd.conf##, use {{code language="none"}}httpd.exe -k restart{{/code}} instead. 37 +1. Open {{code language="none"}}http://localhost{{/code}} in a browser. Apache redirects to {{code language="none"}}http://localhost/xwiki/{{/code}} and the wiki loads through port ##80##, with no port number in the address.
- DocApp.Code.DocumentationClass[0]
-
- FAQ
-
... ... @@ -1,15 +1,7 @@ 1 -== Howcan I checkifApache isrunninglocally? ==1 +== Why does the service refuse to start after I edit the configuration? == 2 2 3 - Before configuringthe proxy server for XWiki, you can check whether Apache is running by opening your browser and type{{code language="none"}}http://localhost{{/code}}.Ifyousee apage fromApache, itmeans it'srunning.3 +Run {{code language="none"}}httpd.exe -t{{/code}} from ##C:\Apache24\bin##: it names the file and line of the directive Apache cannot parse, which the Windows service reports nowhere. 4 4 5 -== Wh at if I needalso modulesfor##SSL##,orothermodules? ==5 +== Where does Apache write its logs on Windows? == 6 6 7 -There are of course a lot of ways to configure the proxy server, and plenty of [[Apache modules>>https://httpd.apache.org/docs/current/fr/mod/]], such as [[##SSL##>>https://httpd.apache.org/docs/current/fr/mod/mod_ssl.html]]. Check also [[more configurations for the Apache HTTP Proxy server>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configurations.WebHome]]. 8 - 9 -== How can I configure the proxy server if I have a custom domain? == 10 - 11 -Replace the {{code language="none"}}ServerName localhost{{/code}} with your custom domain, for example {{code language="none"}}ServerName wiki.example.com{{/code}}. If needed (e.g., when using custom local domain, which are not real public domains), you must configure DNS resolution so that your system knows where to route the request. To do so, edit the ##hosts## file to add for example {{code language="none"}}127.0.0.1 wiki.example.local{{/code}}. 12 - 13 -== What if I get ##404## error == 14 - 15 -A common mistake is the following issue: ##404## or broken links. Check: ##/xwiki## mapping. 7 +In ##C:\Apache24\logs##, as ##error.log## and ##access.log##, unless ##ErrorLog## and ##CustomLog## point somewhere else. - Related
-
... ... @@ -1,2 +1,3 @@ 1 1 * [[Configure Apache HTTP Server as a Proxy on a Linux OS>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configure-apache-server-linux.WebHome]]. 2 -* [[Configure Tomcat to Find Proxy Headers>>documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]]. 2 +* [[Configure Tomcat to Find Proxy Headers>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]]. 3 +* [[Apache Reverse Proxy Guide>>https://httpd.apache.org/docs/current/howto/reverse_proxy.html]].
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - MoreConfigurationsfor the Apache HTTP Proxy Server1 +Configure HTTPS for the Apache HTTP Proxy Server - Content
-
... ... @@ -1,35 +1,42 @@ 1 -{{warning}} 2 -WIP 3 -{{/warning}} 1 +Once Apache forwards requests to XWiki on port ##80##, a second ##VirtualHost## on port ##443## serves the same wiki over ##HTTPS## and the port ##80## one redirects to it. This procedure continues [[Configure Apache HTTP Server as a Proxy on a Linux OS>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configure-apache-server-linux.WebHome]], and the directives it adds are described in [[Apache Server Key Configurations>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.WebHome]]. 4 4 5 - After[[Configuringthe Apache HTTP Server as a Proxy on a Linux OS>>documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configure-apache-server-linux.WebHome]] or [[on Windows>>documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configure-apache-server-windows.WebHome]],you canaddseveralimprovementsto the configuration. For example, you can enable ##HTTPS## secure connections. To do this, you need to enablethe[[Apache##SSL## module>>https://httpd.apache.org/docs/current/fr/mod/mod_ssl.html]] and use an additional ##<VirtualHost>##on port##443## whereyou also move the [[Proxy Rules>>documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.WebHome]]from##<VirtualHost *:80>##. Thus, modify and add in the ##/etc/apache2/sites-available/xwiki.conf## file:6 - 7 -((( 3 +1. Obtain a TLS certificate and its private key for the wiki's domain. 4 +1. Enable the modules the configuration below needs: {{code language="none"}}sudo a2enmod ssl headers rewrite{{/code}}. 5 +1. Add the ##HTTPS## block to ##/etc/apache2/sites-available/xwiki.conf##, carrying every proxy directive of the port ##80## block:((( 8 8 {{code language="apacheconf"}} 9 9 <VirtualHost *:443> 10 - ServerName localhost11 - 8 + ServerName wiki.example.com 9 + 12 12 SSLEngine on 13 13 SSLCertificateFile /path/to/certificate 14 14 SSLCertificateKeyFile /path/to/privatekey 15 15 14 + RequestHeader set X-Forwarded-Proto "https" 15 + 16 + ErrorLog ${APACHE_LOG_DIR}/xwiki-error.log 17 + CustomLog ${APACHE_LOG_DIR}/xwiki-access.log combined 18 + 19 + RedirectMatch ^/$ /xwiki/ 20 + 21 + <Location /xwiki> 22 + Require all granted 23 + </Location> 24 + 25 + AllowEncodedSlashes NoDecode 26 + 16 16 ProxyRequests Off 17 17 ProxyPreserveHost On 18 18 19 - RequestHeader set X-Forwarded-Proto "https" 20 - 21 - ProxyPass /xwiki http://localhost:8080/xwiki 30 + ProxyPass /xwiki http://localhost:8080/xwiki nocanon upgrade=websocket 22 22 ProxyPassReverse /xwiki http://localhost:8080/xwiki 23 23 </VirtualHost> 24 24 {{/code}} 25 25 ))) 26 - 27 -To redirect HTTP to HTTPS, use a port ##80 VirtualHost## with ##Rewrite Rules##: 28 - 29 -((( 35 +1. Replace the body of the port ##80## block in the same file with a redirect to ##HTTPS##:((( 30 30 {{code language="apacheconf"}} 31 31 <VirtualHost *:80> 32 - ServerName localhost 38 + ServerName wiki.example.com 39 + 33 33 RewriteEngine On 34 34 RewriteCond %{HTTPS} !=on 35 35 RewriteCond %{REQUEST_URI} !^/.well-known ... ... @@ -36,8 +36,8 @@ 36 36 RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] 37 37 </VirtualHost> 38 38 {{/code}} 39 - 40 -Make sure you update the [[XWiki configuration file (##xwiki.cfg##)>>documentation.xs.admin.configuration.WebHome]] with the new URL, (e.g., {{code language="none"}}xwiki.home=https://localhost/xwiki{{/code}}). 41 41 ))) 42 - 43 -After making changes in the configuration file, test and restart Apache. 47 +1. Set ##xwiki.home## in the [[##xwiki.cfg## configuration file>>doc:documentation.xs.admin.configuration.WebHome]] to the public base address, scheme and trailing slash included and without the ##/xwiki## path: {{code language="none"}}xwiki.home=https://wiki.example.com/{{/code}}. 48 +1. Make the Servlet Container trust the forwarded protocol, following [[Configure Tomcat to Find Proxy Headers>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]]. 49 +1. Check the configuration and reload Apache: {{code language="none"}}sudo apachectl configtest{{/code}} then {{code language="none"}}sudo systemctl reload apache2{{/code}}. 50 +1. Open {{code language="none"}}https://wiki.example.com{{/code}} in a browser. The browser reports the connection as secure, the plain ##HTTP## address redirects to it, and the wiki's own links all use {{code language="none"}}https://{{/code}}.
- DocApp.Code.DocumentationClass[0]
-
- FAQ
-
... ... @@ -1,6 +1,7 @@ 1 -== Wh ataresomecommonmistakes? ==1 +== Why is ##/.well-known## left on plain HTTP? == 2 2 3 - Pay attention to thefollowings,as theyaremostcommonmistakes:3 +That is where an ACME client such as certbot answers the challenge that issues and renews the certificate, so redirecting it would break every automatic renewal. 4 4 5 -* Issue: ##WebSocket## not working. Check: ##proxy_wstunnel## is enabled. 6 -* Issue: HTTPS issues. Check: configuration of SSL is correct. 5 +== Why does the wiki still generate plain HTTP links after HTTPS works? == 6 + 7 +The Servlet Container is not trusting the ##X-Forwarded-Proto## header Apache sends — see [[Configure Tomcat to Find Proxy Headers>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]]. - Related
-
... ... @@ -1,0 +1,4 @@ 1 +* [[Configure Apache HTTP Server as a Proxy on a Windows OS>>doc:documentation.xs.admin.installation.http-reverse-proxy.apache-key-configurations.configure-apache-server-windows.WebHome]]. 2 +* [[Configure Tomcat to Find Proxy Headers>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.find-proxy-headers.WebHome]]. 3 +* [[Apache SSL/TLS Encryption>>https://httpd.apache.org/docs/current/ssl/]]. 4 +* [[Configuration>>doc:documentation.xs.admin.configuration.WebHome]]. - Type
-
... ... @@ -1,1 +1,1 @@ 1 - explanation1 +howto