Skip to content

Commit

Permalink
Add www, redirects to librivox.org
Browse files Browse the repository at this point in the history
  • Loading branch information
redrun45 committed Aug 12, 2024
1 parent cc65b81 commit 33b01b2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
17 changes: 17 additions & 0 deletions roles/blog+catalog/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,20 @@
src: /etc/apache2/sites-available/librivox.org.conf
become: true
notify: Restart Apache

# Redirect 'www' to librivox.org

- name: librivox.org config file
template:
src: www.librivox.org.conf
dest: /etc/apache2/sites-available/www.librivox.org.conf
become: true
notify: Restart Apache

- name: Enable site
file:
path: /etc/apache2/sites-enabled/www.librivox.org.conf
state: link
src: /etc/apache2/sites-available/www.librivox.org.conf
become: true
notify: Restart Apache
17 changes: 17 additions & 0 deletions roles/blog+catalog/templates/www.librivox.org.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<VirtualHost *:443>

ServerName www.librivox.org
Redirect permanent / https://librivox.org/

SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/librivox.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/librivox.org/privkey.pem

</VirtualHost>

<VirtualHost *:80>

ServerName www.librivox.org
Redirect permanent / https://librivox.org/

</VirtualHost>
2 changes: 1 addition & 1 deletion roles/hosts_entry/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: hosts entry
lineinfile:
dest: /etc/hosts
line: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} librivox.org forum.librivox.org wiki.librivox.org"
line: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} librivox.org forum.librivox.org wiki.librivox.org www.librivox.org"
become: true

0 comments on commit 33b01b2

Please sign in to comment.