SlideShare uma empresa Scribd logo
1 de 16
Gaurav Mishra
<gmishx@gmail.com>
Linux - 5
Apache Configuration file,
Cron jobs,
Proxy server
2/27/2018
Unrestricted
Gaurav Mishra <gmishx@gmail.com>
Apache http server
• One of the most commonly used open source sever
• Can be easily tuned
• Works in harmony with PHP
• Provides various security measures
• Installs as httpd in many Linux distros
• Packages as apache2 in Debian based distributions
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
Apache directory structure
• The apache foundation have their hierarchical structure for the respective
configuration files.
• The root is located at: /etc/apache2/
• The main configuration file is located at ./apache2.conf
• The modules currently installed are located at: ./mods-available/
• The modules currently in use are located at: ./mods-enabled/
• The websites/virtual host available for current install are located at: ./sites-available/
• The websites/virtual host being used for current run are located at: ./sites-enabled/
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
Apache configuration file
• The global configuration file is stored at /etc/apache2/apache2.conf
• Can be overridden for each directory using .htaccess
• The file contains directives, mostly distributed in directive blocks
• Commonly used directive blocks:
▫ directory
 Contains directives defined for a particular directory
▫ VirtualHost
 Directives defined for a virtual host
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
List of common directives
• Alias
• Allow
• AllowOverride
• AuthBasicAuthoritative
• AuthType
• Deny
• <Directory>
• DocumentRoot
• <Else>
• ErrorLog
• ErrorLogFormat
• <If>
• <IfModule>
• Include
• KeepAlive
• Listen
• LoadModule
• Redirect
• RedirectMatch
• ServerAdmin
• ServerAlias
• ServerLimit
• ServerName
• SSLCertificateFile
• SSLCertificateKeyFile
• SSLEngine
• <VirtualHost>
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
Setting up directory directive
Alias “/holidaypics” “/var/www/html/newpics”
<Directory /var/www/html/newpics>
AuthType Basic
AuthName Newpics
AuthUserFile /web/users
AuthGroupFile /web/groups
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
<Files dinner.jpg>
order deny,allow
deny from all
allow from 127.0.0.1
</Files>
</Directory>
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
Setting up VirtualHost
• Virtual hosting allows the Apache web server to host multiple websites as part of its
own.
ServerName server.example.com
ServerAlias server server2.example.com server2
ServerAlias *.example.com
<VirtualHost server.example.com:80>
Alias /files /home/user/Documents/files
<Directory "/home/user/Documents/files">
AllowOverride None
Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
Setting up SSL support
<IfModule mod_ssl.c>
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/certi.cer
SSLCertificateKeyFile /etc/ssl/keys/certi.key
</VirtualHost>
</IfModule>
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
Apache tools
• To enable a website configuration from /etc/apache2/sites-available/mysite.conf
▫ a2ensite mysite
• To disable a website configuration from /etc/apache2/sites-available/mysite.conf
▫ a2dissite mysite
• To enable a module from /etc/apache2/mods-available/mymod.conf
▫ a2enmod mymod
• To disable a module from /etc/apache2/mods-available/mymod.conf
▫ a2dismod mymod
• Check the syntax of apache2.conf
▫ apachectl configtest
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
Cron jobs
• Cron jobs are set of actions which must be executed at a certain time on a given day.
• Cron daemon keeps checking these cron jobs and execute them whenever required.
• Each user can have their own cron jobs.
• The job set by a user run with their privileges.
• The cron jobs are stored in crontab files.
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
Crontab format
• The format of a crontab field follows:
▫ minute hour day-month month day(s)-week task
• A crontab entry has six fields:
▫ The first five are used to specify the time for an action
 The first field specifies the minute (0–59)
 The second field specifies the houst (0-23)
 The third field specifies the day of the month (1–31)
 The fourth field specifies the month of the year (1–12, or month prefixes like Jan and Sep)
 And the fifth field specifies the day of the week (0–6, or day prefixes like Wed and Fri),
starting with 0 as Sunday.
▫ The last field is the action itself.
• Each field can be defined as range or using * to match all
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
Crontab examples
• Take backup at 2:00 AM from Mon-Friday of every month
▫ 0 2 * * 1-5 tar cf /home/backp /home/projects
• Take backup at 2:00 AM on Sun, Wed, Fri of every month
▫ 0 2 * * 0,3,5 tar cf /home/backp /home/projects
• Take backup every other day at 2:00 AM on any day
▫ 0 2 */2 * * tar cf /home/backp /home/projects
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
Adding a cron job
To add a cron job
1. First write the job in the respective 6 columns in a file.
▫ echo “0 2 * * 1-5 tar cf /home/backp /home/projects” > mybackup_script
2. Pass the file to crontab
▫ crontab mybackup_script
To edit a job already added
1. Open the crontab in edit mode
▫ crontab -e
2. Edit the job
3. Save the changes
Check all the jobs for current user
• crontab -l
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
Cron file organization
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
Proxy servers
• Proxy servers acts as an intermediate
between the client and the server.
• They serve many purpose.
• Caching
• Anonymizing
• Load management
• Redirection
• Every client sends a request to the
proxy, the proxy checks if it can serve
the request from it’s cache otherwise
forward it.
• Proxy sometimes helps working with
firewalls.
2/27/2018
Gaurav Mishra <gmishx@gmail.com>
Setting up proxy on host
• Majority of the software support proxy
• The most common place to find the proxy setting is in the System environment
variable http_proxy, https_proxy, ftp_proxy.
• The variables can be set using the export command a given terminal session.
• They can also be set using the /etc/profile and /etc/bash.bashrc files for sessions
globally.
• The string follows following pattern:
▫ [username]:[password]@ipaddress:port
▫ http://[username]:[password]@address.com:port
2/27/2018

Mais conteúdo relacionado

Mais procurados

Git lab installation guide
Git lab installation guideGit lab installation guide
Git lab installation guideRaiful Hasan
 
Boulder dev ops-meetup-11-2012-rundeck
Boulder dev ops-meetup-11-2012-rundeckBoulder dev ops-meetup-11-2012-rundeck
Boulder dev ops-meetup-11-2012-rundeckWill Sterling
 
Ansible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaAnsible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaJuan Diego Pereiro Arean
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An IntroductionBehzad Altaf
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleMichael Bahr
 
Apache development with GitHub and Travis CI
Apache development with GitHub and Travis CIApache development with GitHub and Travis CI
Apache development with GitHub and Travis CIJukka Zitting
 
under the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or lessunder the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or lesssarahnovotny
 
Dependencies and Licenses
Dependencies and LicensesDependencies and Licenses
Dependencies and LicensesRobert Reiz
 
Apache Camel: Jetty Component With Example
Apache Camel: Jetty Component With ExampleApache Camel: Jetty Component With Example
Apache Camel: Jetty Component With ExampleAmit Aggarwal
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners HubSpot
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chefkevsmith
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = CodeGeorg Sorst
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction Robert Reiz
 
Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...SaltStack
 

Mais procurados (20)

Git lab installation guide
Git lab installation guideGit lab installation guide
Git lab installation guide
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Boulder dev ops-meetup-11-2012-rundeck
Boulder dev ops-meetup-11-2012-rundeckBoulder dev ops-meetup-11-2012-rundeck
Boulder dev ops-meetup-11-2012-rundeck
 
Ansible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaAnsible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers Galicia
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Nginx
NginxNginx
Nginx
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Apache development with GitHub and Travis CI
Apache development with GitHub and Travis CIApache development with GitHub and Travis CI
Apache development with GitHub and Travis CI
 
under the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or lessunder the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or less
 
Dependencies and Licenses
Dependencies and LicensesDependencies and Licenses
Dependencies and Licenses
 
Apache Camel: Jetty Component With Example
Apache Camel: Jetty Component With ExampleApache Camel: Jetty Component With Example
Apache Camel: Jetty Component With Example
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Chef introduction
Chef introductionChef introduction
Chef introduction
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = Code
 
Deep dive networking
Deep dive networkingDeep dive networking
Deep dive networking
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...
 

Semelhante a Apache, cron and proxy

Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Gitatishgoswami
 
Introduction to apache maven
Introduction to apache mavenIntroduction to apache maven
Introduction to apache mavenKrish
 
Securing Your WordPress Installation
Securing Your WordPress InstallationSecuring Your WordPress Installation
Securing Your WordPress InstallationLester Chan
 
Git Workshop : Git On The Server
Git Workshop : Git On The ServerGit Workshop : Git On The Server
Git Workshop : Git On The ServerWildan Maulana
 
Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Rich Bowen
 
WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019Anam Ahmed
 
Building a production ready meteor app
Building a production ready meteor appBuilding a production ready meteor app
Building a production ready meteor appRitik Malhotra
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!Cory Webb
 
Tips & Tricks in securing your WordPress installation
Tips & Tricks in securing your WordPress installationTips & Tricks in securing your WordPress installation
Tips & Tricks in securing your WordPress installationLester Chan
 
Git and github fundamental
Git and github fundamentalGit and github fundamental
Git and github fundamentalRajesh Kumar
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github Max Claus Nunes
 
Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010Rich Bowen
 
Deploying Django with Ansible
Deploying Django with AnsibleDeploying Django with Ansible
Deploying Django with Ansibleandrewmirskynet
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in UnityRifauddin Tsalitsy
 
How to push to production a project with 100+ plugins in less than 10 minutes
How to push to production a project with 100+ plugins in less than 10 minutes How to push to production a project with 100+ plugins in less than 10 minutes
How to push to production a project with 100+ plugins in less than 10 minutes Thiago Leão Moreira
 
Exam Overview 70-533 Implementing Azure Infrastructure Solutions
Exam Overview 70-533 Implementing Azure Infrastructure SolutionsExam Overview 70-533 Implementing Azure Infrastructure Solutions
Exam Overview 70-533 Implementing Azure Infrastructure SolutionsGustavo Zimmermann (MVP)
 
Version control git - lecture-1
Version control git - lecture-1Version control git - lecture-1
Version control git - lecture-1Abdul Rahim
 
Liquibase via maven
Liquibase via mavenLiquibase via maven
Liquibase via mavenMaki Turki
 
Freelancer Weapons of mass productivity
Freelancer Weapons of mass productivityFreelancer Weapons of mass productivity
Freelancer Weapons of mass productivityGregg Coppen
 

Semelhante a Apache, cron and proxy (20)

Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Introduction to apache maven
Introduction to apache mavenIntroduction to apache maven
Introduction to apache maven
 
Securing Your WordPress Installation
Securing Your WordPress InstallationSecuring Your WordPress Installation
Securing Your WordPress Installation
 
Git Workshop : Git On The Server
Git Workshop : Git On The ServerGit Workshop : Git On The Server
Git Workshop : Git On The Server
 
Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011
 
WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019
 
Building a production ready meteor app
Building a production ready meteor appBuilding a production ready meteor app
Building a production ready meteor app
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!
 
Tips & Tricks in securing your WordPress installation
Tips & Tricks in securing your WordPress installationTips & Tricks in securing your WordPress installation
Tips & Tricks in securing your WordPress installation
 
Git and github fundamental
Git and github fundamentalGit and github fundamental
Git and github fundamental
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010
 
Deploying Django with Ansible
Deploying Django with AnsibleDeploying Django with Ansible
Deploying Django with Ansible
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 
How to push to production a project with 100+ plugins in less than 10 minutes
How to push to production a project with 100+ plugins in less than 10 minutes How to push to production a project with 100+ plugins in less than 10 minutes
How to push to production a project with 100+ plugins in less than 10 minutes
 
Exam Overview 70-533 Implementing Azure Infrastructure Solutions
Exam Overview 70-533 Implementing Azure Infrastructure SolutionsExam Overview 70-533 Implementing Azure Infrastructure Solutions
Exam Overview 70-533 Implementing Azure Infrastructure Solutions
 
Version control git - lecture-1
Version control git - lecture-1Version control git - lecture-1
Version control git - lecture-1
 
Working with GIT
Working with GITWorking with GIT
Working with GIT
 
Liquibase via maven
Liquibase via mavenLiquibase via maven
Liquibase via maven
 
Freelancer Weapons of mass productivity
Freelancer Weapons of mass productivityFreelancer Weapons of mass productivity
Freelancer Weapons of mass productivity
 

Mais de Gaurav Mishra

FOSSology and OSS-Tools for License Compliance and Automation
FOSSology and OSS-Tools for License Compliance and AutomationFOSSology and OSS-Tools for License Compliance and Automation
FOSSology and OSS-Tools for License Compliance and AutomationGaurav Mishra
 
FOSSology & GSOC Journey
FOSSology & GSOC JourneyFOSSology & GSOC Journey
FOSSology & GSOC JourneyGaurav Mishra
 
Block Chain - Merkel and Key exchange
Block Chain - Merkel and Key exchangeBlock Chain - Merkel and Key exchange
Block Chain - Merkel and Key exchangeGaurav Mishra
 
Block Chain - Introduction
Block Chain - IntroductionBlock Chain - Introduction
Block Chain - IntroductionGaurav Mishra
 
Disk quota and sysd procd
Disk quota and sysd procdDisk quota and sysd procd
Disk quota and sysd procdGaurav Mishra
 
Linux User Management
Linux User ManagementLinux User Management
Linux User ManagementGaurav Mishra
 
Firewall and IPtables
Firewall and IPtablesFirewall and IPtables
Firewall and IPtablesGaurav Mishra
 

Mais de Gaurav Mishra (11)

FOSSology and OSS-Tools for License Compliance and Automation
FOSSology and OSS-Tools for License Compliance and AutomationFOSSology and OSS-Tools for License Compliance and Automation
FOSSology and OSS-Tools for License Compliance and Automation
 
FOSSology & GSOC Journey
FOSSology & GSOC JourneyFOSSology & GSOC Journey
FOSSology & GSOC Journey
 
Block Chain - Merkel and Key exchange
Block Chain - Merkel and Key exchangeBlock Chain - Merkel and Key exchange
Block Chain - Merkel and Key exchange
 
Block Chain - Introduction
Block Chain - IntroductionBlock Chain - Introduction
Block Chain - Introduction
 
Backup using rsync
Backup using rsyncBackup using rsync
Backup using rsync
 
Disk quota and sysd procd
Disk quota and sysd procdDisk quota and sysd procd
Disk quota and sysd procd
 
Linux User Management
Linux User ManagementLinux User Management
Linux User Management
 
Linux Run Level
Linux Run LevelLinux Run Level
Linux Run Level
 
Firewall and IPtables
Firewall and IPtablesFirewall and IPtables
Firewall and IPtables
 
Linux securities
Linux securitiesLinux securities
Linux securities
 
wget, curl and scp
wget, curl and scpwget, curl and scp
wget, curl and scp
 

Último

WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKUXDXConf
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsUXDXConf
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreelreely ones
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoUXDXConf
 

Último (20)

WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreel
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, Ocado
 

Apache, cron and proxy

  • 1. Gaurav Mishra <gmishx@gmail.com> Linux - 5 Apache Configuration file, Cron jobs, Proxy server 2/27/2018 Unrestricted
  • 2. Gaurav Mishra <gmishx@gmail.com> Apache http server • One of the most commonly used open source sever • Can be easily tuned • Works in harmony with PHP • Provides various security measures • Installs as httpd in many Linux distros • Packages as apache2 in Debian based distributions 2/27/2018
  • 3. Gaurav Mishra <gmishx@gmail.com> Apache directory structure • The apache foundation have their hierarchical structure for the respective configuration files. • The root is located at: /etc/apache2/ • The main configuration file is located at ./apache2.conf • The modules currently installed are located at: ./mods-available/ • The modules currently in use are located at: ./mods-enabled/ • The websites/virtual host available for current install are located at: ./sites-available/ • The websites/virtual host being used for current run are located at: ./sites-enabled/ 2/27/2018
  • 4. Gaurav Mishra <gmishx@gmail.com> Apache configuration file • The global configuration file is stored at /etc/apache2/apache2.conf • Can be overridden for each directory using .htaccess • The file contains directives, mostly distributed in directive blocks • Commonly used directive blocks: ▫ directory  Contains directives defined for a particular directory ▫ VirtualHost  Directives defined for a virtual host 2/27/2018
  • 5. Gaurav Mishra <gmishx@gmail.com> List of common directives • Alias • Allow • AllowOverride • AuthBasicAuthoritative • AuthType • Deny • <Directory> • DocumentRoot • <Else> • ErrorLog • ErrorLogFormat • <If> • <IfModule> • Include • KeepAlive • Listen • LoadModule • Redirect • RedirectMatch • ServerAdmin • ServerAlias • ServerLimit • ServerName • SSLCertificateFile • SSLCertificateKeyFile • SSLEngine • <VirtualHost> 2/27/2018
  • 6. Gaurav Mishra <gmishx@gmail.com> Setting up directory directive Alias “/holidaypics” “/var/www/html/newpics” <Directory /var/www/html/newpics> AuthType Basic AuthName Newpics AuthUserFile /web/users AuthGroupFile /web/groups <IfModule mod_dir.c> DirectoryIndex index.php </IfModule> <Files dinner.jpg> order deny,allow deny from all allow from 127.0.0.1 </Files> </Directory> 2/27/2018
  • 7. Gaurav Mishra <gmishx@gmail.com> Setting up VirtualHost • Virtual hosting allows the Apache web server to host multiple websites as part of its own. ServerName server.example.com ServerAlias server server2.example.com server2 ServerAlias *.example.com <VirtualHost server.example.com:80> Alias /files /home/user/Documents/files <Directory "/home/user/Documents/files"> AllowOverride None Options FollowSymLinks MultiViews </Directory> </VirtualHost> 2/27/2018
  • 8. Gaurav Mishra <gmishx@gmail.com> Setting up SSL support <IfModule mod_ssl.c> <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/ssl/certs/certi.cer SSLCertificateKeyFile /etc/ssl/keys/certi.key </VirtualHost> </IfModule> 2/27/2018
  • 9. Gaurav Mishra <gmishx@gmail.com> Apache tools • To enable a website configuration from /etc/apache2/sites-available/mysite.conf ▫ a2ensite mysite • To disable a website configuration from /etc/apache2/sites-available/mysite.conf ▫ a2dissite mysite • To enable a module from /etc/apache2/mods-available/mymod.conf ▫ a2enmod mymod • To disable a module from /etc/apache2/mods-available/mymod.conf ▫ a2dismod mymod • Check the syntax of apache2.conf ▫ apachectl configtest 2/27/2018
  • 10. Gaurav Mishra <gmishx@gmail.com> Cron jobs • Cron jobs are set of actions which must be executed at a certain time on a given day. • Cron daemon keeps checking these cron jobs and execute them whenever required. • Each user can have their own cron jobs. • The job set by a user run with their privileges. • The cron jobs are stored in crontab files. 2/27/2018
  • 11. Gaurav Mishra <gmishx@gmail.com> Crontab format • The format of a crontab field follows: ▫ minute hour day-month month day(s)-week task • A crontab entry has six fields: ▫ The first five are used to specify the time for an action  The first field specifies the minute (0–59)  The second field specifies the houst (0-23)  The third field specifies the day of the month (1–31)  The fourth field specifies the month of the year (1–12, or month prefixes like Jan and Sep)  And the fifth field specifies the day of the week (0–6, or day prefixes like Wed and Fri), starting with 0 as Sunday. ▫ The last field is the action itself. • Each field can be defined as range or using * to match all 2/27/2018
  • 12. Gaurav Mishra <gmishx@gmail.com> Crontab examples • Take backup at 2:00 AM from Mon-Friday of every month ▫ 0 2 * * 1-5 tar cf /home/backp /home/projects • Take backup at 2:00 AM on Sun, Wed, Fri of every month ▫ 0 2 * * 0,3,5 tar cf /home/backp /home/projects • Take backup every other day at 2:00 AM on any day ▫ 0 2 */2 * * tar cf /home/backp /home/projects 2/27/2018
  • 13. Gaurav Mishra <gmishx@gmail.com> Adding a cron job To add a cron job 1. First write the job in the respective 6 columns in a file. ▫ echo “0 2 * * 1-5 tar cf /home/backp /home/projects” > mybackup_script 2. Pass the file to crontab ▫ crontab mybackup_script To edit a job already added 1. Open the crontab in edit mode ▫ crontab -e 2. Edit the job 3. Save the changes Check all the jobs for current user • crontab -l 2/27/2018
  • 14. Gaurav Mishra <gmishx@gmail.com> Cron file organization 2/27/2018
  • 15. Gaurav Mishra <gmishx@gmail.com> Proxy servers • Proxy servers acts as an intermediate between the client and the server. • They serve many purpose. • Caching • Anonymizing • Load management • Redirection • Every client sends a request to the proxy, the proxy checks if it can serve the request from it’s cache otherwise forward it. • Proxy sometimes helps working with firewalls. 2/27/2018
  • 16. Gaurav Mishra <gmishx@gmail.com> Setting up proxy on host • Majority of the software support proxy • The most common place to find the proxy setting is in the System environment variable http_proxy, https_proxy, ftp_proxy. • The variables can be set using the export command a given terminal session. • They can also be set using the /etc/profile and /etc/bash.bashrc files for sessions globally. • The string follows following pattern: ▫ [username]:[password]@ipaddress:port ▫ http://[username]:[password]@address.com:port 2/27/2018