Compare commits
3 Commits
ec9329668c
...
0cb0b4deb2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0cb0b4deb2 | ||
![]() |
2ca69d3e71 | ||
![]() |
067441e753 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -2,8 +2,6 @@ venv/*
|
|||||||
test/*
|
test/*
|
||||||
*~
|
*~
|
||||||
test_*.txt
|
test_*.txt
|
||||||
*/p0.pl
|
*/p[0-9].pl
|
||||||
*/p1.pl
|
|
||||||
*/p2.pl
|
|
||||||
notes.txt
|
notes.txt
|
||||||
user_list.txt
|
user_list.txt
|
||||||
|
@ -47,6 +47,10 @@ chdir $admin_home_dir;
|
|||||||
system("su $admin_un -c 'git clone $GIT_REPO'");
|
system("su $admin_un -c 'git clone $GIT_REPO'");
|
||||||
chdir $REPO_DIR;
|
chdir $REPO_DIR;
|
||||||
|
|
||||||
|
# Copy the skel directory
|
||||||
|
system("mkdir ./skel/public_html/cgi");
|
||||||
|
system("cp -r ./skel/* /etc/skel/");
|
||||||
|
|
||||||
# Setup the virtual environment
|
# Setup the virtual environment
|
||||||
system("pkg_add python3");
|
system("pkg_add python3");
|
||||||
printf("generating virutal enviornment...\n");
|
printf("generating virutal enviornment...\n");
|
||||||
@ -54,3 +58,25 @@ system("su $admin_un -c 'python3 -m venv venv'");
|
|||||||
system("su $admin_un -c '. ./venv/bin/activate && pip3 install -r requirements.txt'");
|
system("su $admin_un -c '. ./venv/bin/activate && pip3 install -r requirements.txt'");
|
||||||
|
|
||||||
system("pkg_add p5-JSON");
|
system("pkg_add p5-JSON");
|
||||||
|
|
||||||
|
# Install apache
|
||||||
|
system("pkg_add apache-httpd");
|
||||||
|
|
||||||
|
# enable the userdir module
|
||||||
|
system("sed -i -e 's/^\(.\)*#\(LoadModule userdir_module\)/\1\2/' /etc/apache2/httpd2.conf");
|
||||||
|
system("sed -i -e 's/^\(.\)*#\(Include \/etc\/apache2\/extra\/httpd-userdir.conf\)/\1\2/' /etc/apache2/httpd2.conf");
|
||||||
|
# Enable the CGI directory
|
||||||
|
system("echo '<Directory \"/home/*/public_html/cgi/\">
|
||||||
|
Require all granted
|
||||||
|
Options +ExecCGI
|
||||||
|
AddHandler cgi-script .cgi
|
||||||
|
</Directory>' >> /etc/apache2/extra/httpd-userdir.conf");
|
||||||
|
# Enable the CGI modules
|
||||||
|
system("sed -i -e 's/^\(.\)*#\(LoadModule cgi_module\)/\1\2/' /etc/apache2/httpd2.conf");
|
||||||
|
system("sed -i -e 's/^\(.\)*#\(LoadModule cgid_module\)/\1\2/' /etc/apache2/httpd2.conf");
|
||||||
|
# Disable directory listing
|
||||||
|
system("sed -i -e 's/\(<\/Directory>\)/ Options -Indexes\
|
||||||
|
\1/g' /etc/apache2/extra/httpd-userdir.conf");
|
||||||
|
|
||||||
|
# Change the port to 5001
|
||||||
|
system("sed -i -e 's/^\(.\)*Listen *80/\1Listen 5001/' /etc/apache2/httpd2.conf");
|
||||||
|
Loading…
Reference in New Issue
Block a user