Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
TetraWiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Wiki.tetrain.com Runbook
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== 8.2 Add <code><nowiki>ServerAlias</nowiki></code> to both vhosts (only needed if 8.1 hit the ambiguity error) === Back up first: <pre> <nowiki> cp /etc/httpd/conf.d/wiki.conf /etc/httpd/conf.d/wiki.conf.bak.$(date +%s) cp /etc/httpd/conf.d/wiki-le-ssl.conf /etc/httpd/conf.d/wiki-le-ssl.conf.bak.$(date +%s) </nowiki> </pre> Add <code><nowiki>ServerAlias wiki.tetrain.com</nowiki></code> right after each <code><nowiki>ServerName wiki-new.tetrain.com</nowiki></code> line, in both <code><nowiki>/etc/httpd/conf.d/wiki.conf</nowiki></code> (port 80) and <code><nowiki>/etc/httpd/conf.d/wiki-le-ssl.conf</nowiki></code> (port 443): <pre> <nowiki> sed -i '/ServerName wiki-new.tetrain.com/a\ ServerAlias wiki.tetrain.com' /etc/httpd/conf.d/wiki.conf sed -i '/ServerName wiki-new.tetrain.com/a\ ServerAlias wiki.tetrain.com' /etc/httpd/conf.d/wiki-le-ssl.conf </nowiki> </pre> Broaden the HTTP→HTTPS redirect in <code><nowiki>wiki.conf</nowiki></code> to match either hostname: <pre> <nowiki> sed -i 's/RewriteCond %{SERVER_NAME} =wiki-new.tetrain.com$/RewriteCond %{SERVER_NAME} =wiki-new.tetrain.com [OR]\nRewriteCond %{SERVER_NAME} =wiki.tetrain.com/' /etc/httpd/conf.d/wiki.conf </nowiki> </pre> Resulting <code><nowiki>wiki.conf</nowiki></code> (port 80), confirmed live: <pre> <nowiki> <VirtualHost *:80> ServerName wiki-new.tetrain.com ServerAlias wiki.tetrain.com DocumentRoot /var/www/wiki <Directory /var/www/wiki> AllowOverride All Require all granted DirectoryIndex index.php </Directory> <FilesMatch \.php$> SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost" </FilesMatch> ErrorLog /var/log/httpd/wiki-error.log CustomLog /var/log/httpd/wiki-access.log combined RewriteEngine on RewriteCond %{SERVER_NAME} =wiki-new.tetrain.com [OR] RewriteCond %{SERVER_NAME} =wiki.tetrain.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost> </nowiki> </pre> Resulting <code><nowiki>wiki-le-ssl.conf</nowiki></code> (port 443), confirmed live: <pre> <nowiki> <IfModule mod_ssl.c> <VirtualHost *:443> ServerName wiki-new.tetrain.com ServerAlias wiki.tetrain.com DocumentRoot /var/www/wiki <Directory /var/www/wiki> AllowOverride All Require all granted DirectoryIndex index.php </Directory> <FilesMatch \.php$> SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost" </FilesMatch> ErrorLog /var/log/httpd/wiki-error.log CustomLog /var/log/httpd/wiki-access.log combined SSLCertificateFile /etc/letsencrypt/live/wiki-new.tetrain.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/wiki-new.tetrain.com/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost> </IfModule> </nowiki> </pre> <pre> <nowiki> apachectl configtest systemctl reload httpd </nowiki> </pre>
Summary:
Please note that all contributions to TetraWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TetraWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)