Media Wiki Installation Configure httpd VirtualHost: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * https://kb.novaordis.com/index.php/Media_Wiki_Installation#Configure_httpd_to_Serve_the_Media_Wiki_Instance|https://kb.novaordis.com/index.php/Media_Wiki_Instal...")
 
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=Internal=
* [[https://kb.novaordis.com/index.php/Media_Wiki_Installation#Configure_httpd_to_Serve_the_Media_Wiki_Instance|https://kb.novaordis.com/index.php/Media_Wiki_Installation#Configure_httpd_to_Serve_the_Media_Wiki_Instance]]
* [[Media_Wiki_Installation#Configure_httpd_to_Serve_the_Media_Wiki_Instance|Media Wiki Installation]]
 
=Linux=
=Linux=
We assume <code>httpd</code> is correctly installed and configured to support SSL.
We will serve Media Wiki as a secure virtual host and a redirecting non-secure host. Edit <code>/etc/httpd/conf.d/ssl.conf</code>:
<syntaxhighlight lang='xml'>
...
<VirtualHost 1.2.3.4:443>
    ServerName wiki.novaordis.com:443
    DocumentRoot /var/www/wiki.novaordis.com
    <Directory "/var/www/wiki.novaordis.com"> 
        DirectoryIndex index.html index.html.var index.php
    </Directory>
    # SSL configuration follows ...
</VirtualHost>
...
</syntaxhighlight>
<font color=darkkhaki>Understand why I needed to: "Require all granted" under  <Directory "/var/www/wiki.novaordis.com"> </font>.
Restart <code>httpd</code>:
<syntaxhighlight lang='bash'>
systemctl restart httpd
</syntaxhighlight>
=Mac=
=Mac=
Edit <code>/opt/brew/etc/httpd/httpd.conf</code> and add at the bottom:
<syntaxhighlight lang='xml'>
<VirtualHost localhost:8080>
    ServerName localhost:8080
    DocumentRoot /opt/brew/var/www/nokb.local
    <Directory "/opt/brew/var/www/nokb.local">
        DirectoryIndex index.html index.html.var index.php
    </Directory>
</VirtualHost>
</syntaxhighlight>
Restart <code>httpd</code>:
<syntaxhighlight lang='bash'>
brew services restart httpd
</syntaxhighlight>

Latest revision as of 01:10, 30 December 2023

Internal

Linux

We assume httpd is correctly installed and configured to support SSL.

We will serve Media Wiki as a secure virtual host and a redirecting non-secure host. Edit /etc/httpd/conf.d/ssl.conf:

...
<VirtualHost 1.2.3.4:443>
    ServerName wiki.novaordis.com:443
    DocumentRoot /var/www/wiki.novaordis.com
    <Directory "/var/www/wiki.novaordis.com">  
        DirectoryIndex index.html index.html.var index.php
    </Directory>
    # SSL configuration follows ...
</VirtualHost>
...

Understand why I needed to: "Require all granted" under <Directory "/var/www/wiki.novaordis.com"> .

Restart httpd:

systemctl restart httpd

Mac

Edit /opt/brew/etc/httpd/httpd.conf and add at the bottom:

<VirtualHost localhost:8080>
    ServerName localhost:8080
    DocumentRoot /opt/brew/var/www/nokb.local
    <Directory "/opt/brew/var/www/nokb.local">
        DirectoryIndex index.html index.html.var index.php
    </Directory>
</VirtualHost>

Restart httpd:

brew services restart httpd