Browse Source

Added post. Fixed script.

dev
Franco Masotti 2 years ago
parent
commit
31e0fed102
Signed by: frnmst
GPG Key ID: 24116ED85666780A
  1. 35
      _posts/2021-02-17-new-hosting.md
  2. 43
      _posts/2021-02-19-apache-from-arch-to-debian.md

35
_posts/2021-02-17-new-hosting.md

@ -1,7 +1,7 @@
---
title: A new hosting for this blog
tags: [hosting, jekyll, blog, gitlab]
updated: 2021-02-17 20:23
updated: 2021-02-19 21:54
description: This blog is now self-hosted
---
@ -30,7 +30,7 @@ I followed [this guide](https://jekyllrb.com/docs/deployment/automated/#git-post
created a new file called `hooks/post-receive` which is a little different to the one in the tutorial:
```shell
#!/bin/bash -l
#!/usr/bin/bash -l
#
# The MIT License (MIT)
#
@ -55,20 +55,27 @@ created a new file called `hooks/post-receive` which is a little different to th
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
TMP_GIT_CLONE=""${HOME}"/tmp/myrepo"
PUBLIC_WWW='/var/www/blog.frnmst.duckdns.org'
# Install Ruby Gems to ~/gems
export GEM_HOME=$HOME/gems
export PATH=$GEM_HOME/bin:$PATH
TMP_GIT_CLONE=$HOME/tmp/myrepo
GEMFILE=$TMP_GIT_CLONE/Gemfile
PUBLIC_WWW=/var/www/blog.frnmst.duckdns.org
git clone $GIT_DIR $TMP_GIT_CLONE
BUNDLE_GEMFILE=$GEMFILE bundle install
BUNDLE_GEMFILE=$GEMFILE bundle exec jekyll build --trace --strict_front_matter --verbose --safe -t -s $TMP_GIT_CLONE -d $PUBLIC_WWW
rm -Rf $TMP_GIT_CLONE
exit
export GEM_HOME=""${HOME}"/gems"
export PATH="${GEM_HOME}"/bin:"${PATH}"
GEMFILE=""${TMP_GIT_CLONE}"/Gemfile"
git clone "${GIT_DIR}" "${TMP_GIT_CLONE}"
BUNDLE_GEMFILE="${GEMFILE}" bundle install
BUNDLE_GEMFILE="${GEMFILE}" bundle exec \
jekyll build \
--trace \
--strict_front_matter \
--verbose \
--safe \
--trace \
--source "${TMP_GIT_CLONE}" \
--destination "${PUBLIC_WWW}"
rm --recursive --force "${TMP_GIT_CLONE}"
```
Moreover, before running that git hook:

43
_posts/2021-02-19-apache-from-arch-to-debian.md

@ -0,0 +1,43 @@
---
title: Apache from Arch to Debian
tags: [apache, arch, debian]
updated: 2021-02-19 21:53
description: Migration Apache's configuration from Arch GNU/Linux-based to Debian GNU/Linux-based distos
---
<!--excerpt_start-->
Here are some simple steps to migrate Apache's configuration
from an Arch GNU/Linux-based distro to a Debian GNU/Linux-based disto.
<!--excerpt_end-->
1. `systemctl stop apache2`
2. `cd /etc/apache2`
3. backup the `apache2.conf` file
4. copy the original file `httpd.conf` from Arch and rename it to `apache2.conf`
5. go through all the modules and enable them with this command:
a2enmod ${module_name}
6. remove all the `LoadModule` directives
7. add this at the end of `apache2.conf`:
```
# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf
# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
```
8. copy the extra configurations you think are useful from Arch, located in `/etc/httpd/conf/extra`, into `/etc/apache2/conf-available` and enable them
with `a2enconf ${conf_name%%.conf}`
10. chage some variables in `apache2.conf`:
ServerRoot "/etc/apache2"
User www-data
Group www-data
10. run `systemctl restart apache2`
Loading…
Cancel
Save