소스 검색

provision.pl - added logic to setup apache

tags/release-00
gashapwn 3 년 전
부모
커밋
0cb0b4deb2
1개의 변경된 파일22개의 추가작업 그리고 0개의 파일을 삭제
  1. +22
    -0
      perl-script/provision.pl

+ 22
- 0
perl-script/provision.pl 파일 보기

@@ -58,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("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");

불러오는 중...
취소
저장