Apache2 on Raspbian

Apache2 のインストール

sudo apt install apache2

sudo systemctl status apache2

/var/www/html/index.html

php をインストール

  1. パッケージのインストール
  2. sudo apt install php php-cli php-curl

  3. バージョンの確認
  4. $ php --version
    PHP 7.3.14-1~deb10u1 (cli) (built: Feb 16 2020 15:07:23) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.3.14, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.3.14-1~deb10u1, Copyright (c) 1999-2018, by Zend Technologies
    	
Perl をインストール

  1. バージョンの確認
  2. $ perl --version
    
    This is perl 5, version 28, subversion 1 (v5.28.1) built for arm-linux-gnueabihf-thread-multi-64int
    (with 61 registered patches, see perl -V for more detail)
    
    Copyright 1987-2018, Larry Wall
    
    Perl may be copied only under the terms of either the Artistic License or the
    GNU General Public License, which may be found in the Perl 5 source kit.
    
    Complete documentation for Perl, including FAQ lists, should be found on
    this system using "man perl" or "perldoc perl".  If you have access to the
    Internet, point your browser at http://www.perl.org/, the Perl Home Page.
    	
  3. CGI を有効にする
  4. sudo a2enmod cgid

    sudo systemctl restart apache2

    /etc/apache2/apache2.conf

    AddHandler cgi-script .cgi .pl

  5. ページにアクセス
  6. Forbidden
    
    You don't have permission to access this resource.
    Apache/2.4.38 (Raspbian) Server at tulip.local Port 80
    
  7. 設定の変更
  8. /etc/apache2/apache2.conf

    <Directory /var/www/>
            Options Indexes FollowSymLinks ExecCGI
            AllowOverride None
            Require all granted
    </Directory>
    

戻る

Jun/16/2020