Skip to content

Commit 073ce23

Browse files
committed
Bump inital_setup script
Signed-off-by: Daniel Metzner <daniiel.metzner@gmail.com>
1 parent a50fef6 commit 073ce23

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

bin/initial_setup.sh

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ sudo service mariadb start
3434
sudo mysql_secure_installation
3535

3636
## Web server (Apache)
37-
sudo apt install apache2
37+
sudo apt install apache2 libapache2-mod-php
38+
sudo a2enmod php8.3
3839
sudo service apache2 start
3940

4041
## Install google chrome browser (needed for testing with selenium/behat)
@@ -66,23 +67,30 @@ CREATE DATABASE catroweb_dev;
6667

6768
## Setup the Apache configuration
6869
### Create a symbolic link in /var/www
69-
sudo ln -s ./public /var/www/catroweb
70+
sudo ln -s $(pwd) /var/www/catroweb
7071
### Copy the Apache configuration file
7172
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/catroweb.conf
7273
### Define the path to the configuration file
7374
CONF_FILE="/etc/apache2/sites-available/catroweb.conf"
74-
### Use sed to edit the file in place
75-
sudo sed -i "s|ServerName .*|ServerName catroweb|g" $CONF_FILE
76-
sudo sed -i "s|ServerAdmin .*|ServerAdmin webmaster@localhost|g" $CONF_FILE
77-
sudo sed -i "s|DocumentRoot .*|DocumentRoot /var/www/catroweb|g" $CONF_FILE
78-
sudo sed -i "/<Directory \/var\/www\/catroweb>/,/<\/Directory>/c<Directory /var/www/catroweb>\n\tDirectoryIndex /index.php\n\tFallbackResource /index.php\n</Directory>" $CONF_FILE
79-
sudo sed -i "s|SetEnvIf Authorization .*|SetEnvIf Authorization \"(.*)\" HTTP_AUTHORIZATION=\$1|g" $CONF_FILE
75+
echo "
76+
<VirtualHost *:80>
77+
Servername catroweb
78+
ServerAdmin webmaster@localhost
79+
DocumentRoot /var/www/catroweb
80+
<Directory /var/www/catroweb>
81+
DirectoryIndex /index.php
82+
FallbackResource /index.php
83+
</Directory>
84+
SetEnvIf Authorization \"(.*)\" HTTP_AUTHORIZATION=\$1
85+
ErrorLog \${APACHE_LOG_DIR}/error.log
86+
CustomLog \${APACHE_LOG_DIR}/access.log combined
87+
</VirtualHost>
88+
" | sudo tee $CONF_FILE
8089
### Add entry to hosts file
8190
echo "127.0.0.1 catroweb" | sudo tee -a /etc/hosts
8291
### Set the correct Apache configuration
8392
sudo a2dissite 000-default.conf
8493
sudo a2ensite catroweb.conf
85-
### Restart Apache service
8694
sudo service apache2 restart
8795

8896
## Setup some final permissions

0 commit comments

Comments
 (0)