SlideShare une entreprise Scribd logo
1  sur  34
Télécharger pour lire hors ligne
Perl web hosting
for beginners
Árpád Szász
Freelance Perl Developer
Twitter: @arpadszasz
Blog: http://arpi.plenum.ro
Background
●

Programming newbie
Background
●

Programming newbie

●

Want to host a simple dynamic website
Background
●

Programming newbie

●

Want to host a simple dynamic website

●

Process must be easy
Background
●

Programming newbie

●

Want to host a simple dynamic website

●

Process must be easy

●

Using Microsoft Windows as a workstation
Background
●

Programming newbie

●

Want to host a simple dynamic website

●

Process must be easy

●

Using Microsoft Windows as a workstation

●

Using GNU/Linux on the server side
Why use Perl?
●

Perl makes easy things easy and hard things
possible
Why use Perl?
●

●

Perl makes easy things easy and hard things
possible
Perl is available by default on every shared
host provider's servers (GNU/Linux)
Why use Perl?
●

●

●

Perl makes easy things easy and hard things
possible
Perl is available by default on every shared
host provider's servers (GNU/Linux)
Perl is Modern
Why use shared hosting?
●

Inexpensive
Why use shared hosting?
●

Inexpensive

●

Easy to setup
Strawberry Perl
●

Perl distribution for Windows
Strawberry Perl
●

Perl distribution for Windows

●

Available at http://strawberryperl.com/
Strawberry Perl
●

Perl distribution for Windows

●

Available at http://strawberryperl.com/

●

Up to date (Perl version 5.16.3)
Apache
●

Most popular web server
Apache
●
●

Most popular web server
Windows binaries available at
http://httpd.apache.org/download.cgi
Mojolicious
●

Next generation web framework
Mojolicious
●
●

Next generation web framework
Easy to deploy (only dependent on core Perl
5)
Mojolicious
●
●

Next generation web framework
Easy to deploy (only dependent on core Perl
5)
–

download from
https://github.com/jamadam/mojo-legacy
Mojolicious
●
●

Next generation web framework
Easy to deploy (only dependent on core Perl
5)
–

download from
https://github.com/jamadam/mojo-legacy

–

extract lib folder from archive to Apache's htdocs
folder
Configuring Apache
●

Allow the use of .htaccess files

<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin">
AllowOverride All
Options FollowSymlinks
Order allow,deny
Allow from all
</Directory>
Configuring Apache
●

Allow the use of .htaccess files

●

Enable mod_rewrite

LoadModule rewrite_module modules/mod_rewrite.so
Configuring Mojolicious app
●

Goes into Apache's htdocs folder as app.pl

#!perl
use 5.10.1;
use strict;
use lib qw(lib);
use Mojolicious::Lite;
get '/' => sub {
return shift->render('index');
};
get '/*page' => sub {
my $self = shift;
return $self->render( $self->param('page') );
};
app->start('cgi');
Configuring Mojolicious app
●

Goes into Apache's htdocs folder as app.pl

●

Templates go into htdocs/templates
htdocs/templates/index.html.ep
htdocs/templates/contact.html.ep
...
Configuring .htaccess file
●

Execute Perl programs as CGI
AddHandler cgi-script .pl
Options +ExecCGI
Configuring .htaccess file
●

Execute Perl programs as CGI

●

Route all requests to Mojolicious app
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.pl/$1 [L,QSA]
Configuring .htaccess file
●

Execute Perl programs as CGI

●

Route all requests to Mojolicious app

●

Deny listing of templates
<FilesMatch ".html.ep">
Order deny,allow
Deny from all
</FilesMatch>
Configuring .htaccess file
●

Execute Perl programs as CGI

●

Route all requests to Mojolicious app

●

Deny listing of templates

●

Directory index points to app
DirectoryIndex app.pl
Configure templates
Add HTML markup to templates

●

<h1>Welcome!</h1>
<p>
Hello and welcome to our silly website.
</p>
Configure templates
●

Add HTML markup to templates

●

Add Perl code to templates

<h1>Welcome!</h1>
<p>
Hello and welcome to our silly website. Server time is: <%= time %>
</p>
Deploy
●

Transfer contents of htdocs using FTP to
server
Deploy
●

●

Transfer contents of htdocs using FTP to
server
Access the application on the server via CGI
Questions?
Thank You!
Talk and code available at
https://github.com/arpadszasz/perl-hosting-beginners-talk

Contenu connexe

Tendances

Glance at Visual Studio 2013 ASP.NET and Web tools 2013
Glance at Visual Studio 2013  ASP.NET and Web tools 2013Glance at Visual Studio 2013  ASP.NET and Web tools 2013
Glance at Visual Studio 2013 ASP.NET and Web tools 2013
Shravan Kumar Kasagoni
 

Tendances (19)

Swagger code motion talk
Swagger code motion talkSwagger code motion talk
Swagger code motion talk
 
Vagrant&amp;ansible
Vagrant&amp;ansibleVagrant&amp;ansible
Vagrant&amp;ansible
 
Blazor - The New Silverlight?
Blazor - The New Silverlight?Blazor - The New Silverlight?
Blazor - The New Silverlight?
 
Nginx, PHP and Node.js
Nginx, PHP and Node.jsNginx, PHP and Node.js
Nginx, PHP and Node.js
 
Effective version control
Effective version controlEffective version control
Effective version control
 
Glance at Visual Studio 2013 ASP.NET and Web tools 2013
Glance at Visual Studio 2013  ASP.NET and Web tools 2013Glance at Visual Studio 2013  ASP.NET and Web tools 2013
Glance at Visual Studio 2013 ASP.NET and Web tools 2013
 
Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Angular2.0@Shanghai0319
Angular2.0@Shanghai0319
 
TypeScript Jump Start
TypeScript Jump StartTypeScript Jump Start
TypeScript Jump Start
 
Aprende, contribuye, y surfea Cloud Native Java - GuateJUG 2021
Aprende, contribuye, y surfea Cloud Native Java - GuateJUG 2021Aprende, contribuye, y surfea Cloud Native Java - GuateJUG 2021
Aprende, contribuye, y surfea Cloud Native Java - GuateJUG 2021
 
Migrating .NET Application to .NET Core
Migrating .NET Application to .NET CoreMigrating .NET Application to .NET Core
Migrating .NET Application to .NET Core
 
Capybara + RSpec - ruby dsl-based web ui qa automation
Capybara + RSpec - ruby dsl-based web ui qa automationCapybara + RSpec - ruby dsl-based web ui qa automation
Capybara + RSpec - ruby dsl-based web ui qa automation
 
Everything as code - Johan Siebens STS presentation 14-01-2020
Everything as code - Johan Siebens STS presentation 14-01-2020Everything as code - Johan Siebens STS presentation 14-01-2020
Everything as code - Johan Siebens STS presentation 14-01-2020
 
Introduce Angular2 & render & firebase flow
Introduce Angular2 & render & firebase flowIntroduce Angular2 & render & firebase flow
Introduce Angular2 & render & firebase flow
 
Mojolicious and REST
Mojolicious and RESTMojolicious and REST
Mojolicious and REST
 
Stripe con 2021 UI stack
Stripe con 2021 UI stackStripe con 2021 UI stack
Stripe con 2021 UI stack
 
Hands on Gradle
Hands on GradleHands on Gradle
Hands on Gradle
 
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
 
Docker from a team perspective
Docker from a team perspectiveDocker from a team perspective
Docker from a team perspective
 
Euroclojure2014: Schema & Swagger - making your Clojure web APIs more awesome
Euroclojure2014: Schema & Swagger - making your Clojure web APIs more awesomeEuroclojure2014: Schema & Swagger - making your Clojure web APIs more awesome
Euroclojure2014: Schema & Swagger - making your Clojure web APIs more awesome
 

En vedette

Introduction to Web Programming with Perl
Introduction to Web Programming with PerlIntroduction to Web Programming with Perl
Introduction to Web Programming with Perl
Dave Cross
 
Introduction to Perl - Day 2
Introduction to Perl - Day 2Introduction to Perl - Day 2
Introduction to Perl - Day 2
Dave Cross
 
Database Programming with Perl and DBIx::Class
Database Programming with Perl and DBIx::ClassDatabase Programming with Perl and DBIx::Class
Database Programming with Perl and DBIx::Class
Dave Cross
 
Web Operations and Perl kansai.pm#14
Web Operations and Perl kansai.pm#14Web Operations and Perl kansai.pm#14
Web Operations and Perl kansai.pm#14
Masahiro Nagano
 
Perl programming language
Perl programming languagePerl programming language
Perl programming language
Elie Obeid
 

En vedette (16)

Introduction to Web Programming with Perl
Introduction to Web Programming with PerlIntroduction to Web Programming with Perl
Introduction to Web Programming with Perl
 
Perl Scripting
Perl ScriptingPerl Scripting
Perl Scripting
 
Introduction to Perl - Day 2
Introduction to Perl - Day 2Introduction to Perl - Day 2
Introduction to Perl - Day 2
 
Mojolicious. The web in a box!
Mojolicious. The web in a box!Mojolicious. The web in a box!
Mojolicious. The web in a box!
 
Web Development in Perl
Web Development in PerlWeb Development in Perl
Web Development in Perl
 
Database Programming with Perl and DBIx::Class
Database Programming with Perl and DBIx::ClassDatabase Programming with Perl and DBIx::Class
Database Programming with Perl and DBIx::Class
 
Web Operations and Perl kansai.pm#14
Web Operations and Perl kansai.pm#14Web Operations and Perl kansai.pm#14
Web Operations and Perl kansai.pm#14
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
 
Perl programming language
Perl programming languagePerl programming language
Perl programming language
 
Perl Dancer for Python programmers
Perl Dancer for Python programmersPerl Dancer for Python programmers
Perl Dancer for Python programmers
 
Modern Perl Catch-Up
Modern Perl Catch-UpModern Perl Catch-Up
Modern Perl Catch-Up
 
Introduction to Perl - Day 1
Introduction to Perl - Day 1Introduction to Perl - Day 1
Introduction to Perl - Day 1
 
Simple Photo Processing and Web Display with Perl
Simple Photo Processing and Web Display with PerlSimple Photo Processing and Web Display with Perl
Simple Photo Processing and Web Display with Perl
 
Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011
 
LPW: Beginners Perl
LPW: Beginners PerlLPW: Beginners Perl
LPW: Beginners Perl
 

Similaire à Perl hosting for beginners - Cluj.pm March 2013

Speed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGSpeed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PG
Marcus Sá
 
Provisioning with Puppet
Provisioning with PuppetProvisioning with Puppet
Provisioning with Puppet
Joe Ray
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment System
a3sec
 
Screaming Fast Wpmu
Screaming Fast WpmuScreaming Fast Wpmu
Screaming Fast Wpmu
djcp
 

Similaire à Perl hosting for beginners - Cluj.pm March 2013 (20)

Speed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGSpeed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PG
 
Chef - Administration for programmers
Chef - Administration for programmersChef - Administration for programmers
Chef - Administration for programmers
 
Building dynamic websites with Mod perl and apache
Building dynamic websites with Mod perl and apacheBuilding dynamic websites with Mod perl and apache
Building dynamic websites with Mod perl and apache
 
Chef, Vagrant, and VirtualBox
Chef, Vagrant, and VirtualBoxChef, Vagrant, and VirtualBox
Chef, Vagrant, and VirtualBox
 
Setting up LAMP for Linux newbies
Setting up LAMP for Linux newbiesSetting up LAMP for Linux newbies
Setting up LAMP for Linux newbies
 
Go with the Flow - A Guide to a WordPress Workflow
Go with the Flow - A Guide to a WordPress WorkflowGo with the Flow - A Guide to a WordPress Workflow
Go with the Flow - A Guide to a WordPress Workflow
 
Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)
 
Creation of Own Cloud
Creation of Own Cloud Creation of Own Cloud
Creation of Own Cloud
 
Volunteering at YouSee on Technology Support
Volunteering at YouSee on Technology SupportVolunteering at YouSee on Technology Support
Volunteering at YouSee on Technology Support
 
Configuration of Apache Web Server On CentOS 8
Configuration of Apache Web Server On CentOS 8Configuration of Apache Web Server On CentOS 8
Configuration of Apache Web Server On CentOS 8
 
Provisioning with Puppet
Provisioning with PuppetProvisioning with Puppet
Provisioning with Puppet
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment System
 
Warden @ Meet magento Romania 2021
Warden @ Meet magento Romania 2021Warden @ Meet magento Romania 2021
Warden @ Meet magento Romania 2021
 
Git pusshuten
Git pusshutenGit pusshuten
Git pusshuten
 
Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015
 
CloudOpen North America 2013: Vagrant & CFEngine
CloudOpen North America 2013: Vagrant & CFEngineCloudOpen North America 2013: Vagrant & CFEngine
CloudOpen North America 2013: Vagrant & CFEngine
 
Screaming Fast Wpmu
Screaming Fast WpmuScreaming Fast Wpmu
Screaming Fast Wpmu
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
Beyond Puppet
Beyond PuppetBeyond Puppet
Beyond Puppet
 
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Perl hosting for beginners - Cluj.pm March 2013