-
Notifications
You must be signed in to change notification settings - Fork 1
Deploying with Ubuntu Apache2
Elvis de Souza edited this page Nov 2, 2021
·
24 revisions
In order to deploy Interrogatório using Ubuntu/Apache2, run the following commands in the web server console:
- Install Apache2:
$ sudo apt-get update
$ sudo apt-get install apache2
- Clone Interrogatório repository in
/var/www
:
$ cd /var/www
$ sudo git clone https://github.com/alvelvis/Interrogat-rio --recursive
- Install the needed packages:
$ cd Interrogat-rio
$ pip3 install -r requirements.txt
$ sudo sh install_interrogatorio.sh
$ sudo ln -rs www/cgi-bin www/interrogar-ud www/cgi-bin
$ sudo ln -rs .interrogatorio www
After the server is started for the first time, press Ctrl+C
to terminate it.
- Configure Interrogatório virtual host inside Apache2, creating a new file and pasting the text that follows the command inside it (Shortcuts: Ctrl+W inside
nano
editor to search, Ctrl+X to save the file). Remember to edit the lineServerName
.
$ sudo nano /etc/apache2/sites-available/interrogatorio.conf
<VirtualHost *:80>
ServerName interrogatorio.comcorhd.ga
DocumentRoot /var/www/Interrogat-rio/www
ScriptAlias /cgi-bin /var/www/Interrogat-rio/www/cgi-bin
<Directory /var/www/Interrogat-rio/www/cgi-bin>
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AddHandler cgi-script .py .cgi
Order deny,allow
Allow from all
PassEnv LANG
</Directory>
</VirtualHost>
- Activate the newly created virtual host:
$ sudo a2ensite interrogatorio
- Activate
cgi
mod:
$ sudo a2enmod cgi
- Set the default language: edit the file
/etc/apache2/envvars
, look forexport LANG=
and change the value toC.UTF-8
(Shortcuts: Ctrl+W insidenano
editor to search, Ctrl+X to save the file):
$ sudo nano /etc/apache2/envvars
- Start Apache2:
$ sudo service apache2 start
In case you want to activate an authentication step so that only known users will have access to Interrogatório, run the following commands:
- Download Apache2 authentication package:
$ sudo apt-get update
$ sudo apt-get install apache2 apache2-utils
- Create the first user credentials, changing the "USERNAME" in the command below:
$ sudo htpasswd -c /etc/apache2/.htpasswd USERNAME
- To add new users, run the following command for each user, changing the "USERNAME":
$ sudo htpasswd /etc/apache2/.htpasswd USERNAME
- Edit Interrogatório virtual host file, adding the text that follows the command inside the
<Directory /var/www/Interrogat-rio>
block (Shortcuts: Ctrl+W insidenano
editor to search, Ctrl+X to save the file):
$ sudo nano /etc/apache2/sites-available/interrogatorio.conf
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
- Restart Apache2:
$ sudo service apache2 restart