• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Sunday, May 11, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Arch

How to Install Perl 5.28 on an Arch Linux Webserver

How VPS by How VPS
August 8, 2019
in Arch, Uncategorized
0
0
SHARES
21
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Prerequisites
  2. Install Perl 5.28 On Your Webserver
    1. For Apache
    2. For Nginx
  3. Test Perl
  4. Want to contribute?


Prerequisites

  • A Vultr server running up to date Arch Linux (see this article.)
  • A running webserver, either Apache or Nginx
  • Sudo access:
    • Commands required to be ran as root are prefixed by #. The recommended way to run commands as root is to, as a regular user, prefix each of them with sudo
  • Have a text editor installed, and be familiar with it, such as vi, vim, nano, emacs or a similar editor

Install Perl 5.28 On Your Webserver

Perl is part of the Arch base group, so it was installed along with the rest of Arch.

For Apache

Install the AUR (Arch User Repository) package mod_perl. See Building Packages on Arch Linux (Including the AUR).

Enable the Apache Perl module by editing /etc/httpd/conf/httpd.conf, and at the end of the list of LoadModule commands, add the following:

LoadModule perl_module modules/mod_perl.so

Make each Directory section you want to be able to run Perl scripts contain these options the following options.

<Directory "/srv/http/cgi-bin">
    AllowOverride None
    Require all granted
    AddHandler perl-script .pl
    AddHandler perl-script .cgi
    PerlResponseHandler ModPerl::Registry
    Options +ExecCGI
    PerlOptions +ParseHeaders
</Directory>

Note if you are editing an existing Directory section, and it already contains Options None, comment that line out or delete it.

If you are running multiple host directories, you also need to edit /etc/httpd/conf/httpd.conf and comment out the ScriptAlias command as shown, or all “/cgi-bin/” web requests will be served out of /srv/http/cgi-bin/ regardless of which host it is:

<IfModule alias_module>
...
    #ScriptAlias /cgi-bin/ "/srv/http/cgi-bin/"
</IfModule>

Restart Apache:

# systemctl restart httpd

Create the appropriate directory:

# mkdir /srv/http/cgi-bin

For Nginx

Install FCGI Wrap:

# pacman -S fcgiwrap

Start FCGI Wrap, and make it start after every boot:

# systemctl enable --now fcgiwrap.socket

Allow Nginx to use FCGI Wrap by editing /etc/nginx/nginx.conf, and to every server block you want to use Perl, add the following: Alternatively, if you are using virtual hosts, edit each host’s configuration file:

location ~ /cgi-bin/.*/.(cgi|pl)$ {
    root         /usr/share/nginx/html/;
    fastcgi_pass unix:/run/fcgiwrap.sock;
    include      fastcgi.conf;
}

Create the appropriate directory:

# mkdir /usr/share/nginx/html/cgi-bin/

Test Perl

Within the appropriate directory, create test.cgi with contents:

#!/usr/bin/perl
print "Content-type: text/plain/n/n";
print "perl works/n";

Make it executable, (required for perl scripts):

# chmod +x test.cgi

In a web browser, visit http://YOUR-SERVER-WEB-ADDRESS-OR-IP/test.cgi, and you will see perl works.

Be sure to delete the test.cgi test file you just created.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How to Install PHP 7.3 on an Arch Linux Webserver

Next Post

How To Install Python 3.7 On An Arch Linux Webserver

Next Post

How To Install Python 3.7 On An Arch Linux Webserver

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet