Lets first upload our salt repo to github

git init
git add .
git commit -m "first commit"
git remote add origin https://github.com/username/repo
got push -u origin master

Next i added git to the config


 git:
   pkg.installed
'git config --global user.name "Mona Lisa"':
  cmd.run

Heres the ouput of git log


commit c7898d83ffacc488f39e6b502673cc82b3af69a4 (HEAD -> master, origin/master)
Author: Your Name 
Date:   Thu Nov 15 08:51:45 2018 +0200

    hellO

commit 3af2c3db62fa207099cc2cd8676e8d3051f6c159
Author: Your Name 
Date:   Thu Nov 15 08:36:13 2018 +0200

    hellO

heres the output of git blame top.sls


^3af2c3d (Your Name 2018-11-15 08:36:13 +0200  1) base:
^3af2c3d (Your Name 2018-11-15 08:36:13 +0200  2)   'pc':
^3af2c3d (Your Name 2018-11-15 08:36:13 +0200  3)     - firewall
^3af2c3d (Your Name 2018-11-15 08:36:13 +0200  4)     - apache
^3af2c3d (Your Name 2018-11-15 08:36:13 +0200  5)     - ssh
^3af2c3d (Your Name 2018-11-15 08:36:13 +0200  6)     - git
^3af2c3d (Your Name 2018-11-15 08:36:13 +0200  7)   'manjaro':
^3af2c3d (Your Name 2018-11-15 08:36:13 +0200  8)     - firewall
^3af2c3d (Your Name 2018-11-15 08:36:13 +0200  9)     - nginx
^3af2c3d (Your Name 2018-11-15 08:36:13 +0200 10)     - git

I made a .gitignore
file with the following contents


*.sls

i ran git reset --hard
to remove this gitignore file

This is Thursday’s Assigment

Refer this for inital setup

https://omarbenchbana.com/en/salt-with-nginx-php-fpm-and-ufw/

First configure your salt to include the sshd_config

sudoedit /srv/salt/ssh/init.sls

https://raw.githubusercontent.com/obb12/apache-server/master/ssh.sls
then change your port in the config

sudoedit /srv/salts/ssh/sshd_config

https://raw.githubusercontent.com/obb12/apache-server/master/sshd_config

Next configure apache

sudoedit /srv/salt/apache/init.sls

apache2:
 pkg.installed

/var/www/html/index.html:
 file.managed:
   - source: salt://apache/default-index.html

/etc/apache2/mods-enabled/userdir.conf:
 file.symlink:
   - target: ../mods-available/userdir.conf

/etc/apache2/mods-enabled/userdir.load:
 file.symlink:
   - target: ../mods-available/userdir.load

apache2service:
 service.running:
   - name: apache2
   - watch:
     - file: /etc/apache2/mods-enabled/userdir.conf
     - file: /etc/apache2/mods-enabled/userdir.load
     


Next enable cgi-bin scripts



install_apache:
   pkg.installed:
     - pkgs:
       - apache2
       - php-fpm
       - composer
/etc/apache2/mods-enabled/userdir.conf:
 file.symlink:
   - target: ../mods-available/userdir.conf
/usr/lib/cgi-bin/test.pl:
 file.managed:
   - source: salt://apache/test.pl
/etc/apache2/mods-enabled/userdir.load:
 file.symlink:
   - target: ../mods-available/userdir.load
/etc/apache2/mods-enabled/userdir.conf:
 file.symlink:
   - target: ../mods-available/userdir.conf

/etc/apache2/mods-enabled/cgid.load:
 file.symlink:
   - target: ../mods-available/cgid.load
/etc/apache2/mods-enabled/cgid.conf:
 file.symlink:
   - target: ../mods-available/cgid.conf

apache2service:
 service.running:
   - name: apache2
   - watch:
     - file: /etc/apache2/mods-enabled/userdir.conf
     - file: /etc/apache2/mods-enabled/userdir.load
     - file: /etc/apache2/mods-enabled/cgid.load
     - file: /etc/apache2/mods-enabled/cgid.conf

Write your Cgi script


 /srv/salt/apache/test.pl

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, World.";


first update your system

sudo pacman -Syu 

Reboot your system

next install the required tools

sudo pacman -Syu manjaro-tools-iso manjaro-iso-profiles-official

Edit the Packages-Desktop file

sudo nano /usr/share/manjaro-tools/iso-profiles/official/xfce/Packages-Desktop
## Php server
php 
apache

Compile the iso

 buildiso -p xfce

Select yes and wait

Clean your system

sudo rm -r /var/lib/manjaro-tools/buildiso/
paccache -ruk0

sources


  1. https://wiki.manjaro.org/Build_Manjaro_ISOs_with_buildiso