Setting up a LAMP server

Similar documents
Manually Password Protect Directories Apache Ubuntu

Apache Manual Install Ubuntu Php Mysql. Phpmyadmin No >>>CLICK HERE<<<

Installing LAMP on Ubuntu and (Lucid Lynx, Maverick Meerkat)

How To Start Mysql Using Linux Command Line Client In Ubuntu

Nextcloud 13: How to Get Started and Why You Should

Preparing Your Working Environment

macos High Sierra Apache Setup: Multiple PHP Versions First part in a multi-part blog series for Mac developers

#Uncomment the second line to enable any form of FTP write command. #write_enable=yes

Attacks Against Websites 3 The OWASP Top 10. Tom Chothia Computer Security, Lecture 14

The Wonderful World of Services. By: Stefanja

If you re the administrator on any network,

The WebGUI Runtime Environment. Roy Johnson Plain Black Corporation

A PAtCHy server: developed by the Apache group formed 2/95 around by a number of people who provided patch files for NCSA httpd 1.3 by Rob McCool.

Setting up the Apache Web Server

Topics. What is a RaspberryPi? Why should I want one? What is Raspbian? What is SSH? What is FTP? What is LAMP? Making a LAMP Stack!

L.A.M.P. Stack Part I

How to Stay Safe on Public Wi-Fi Networks

Installing PHP 5.1 On Windows

CSCE 548 Building Secure Software SQL Injection Attack

INFUZE NGINX MODULE USER GUIDE

Apache + PHP + MySQL. bdnog November 2017 Dhaka, Bangladesh

INSTALLING GUIDE FOR A WEB SERVER

MySQL: Access Via PHP

Installing Ubuntu Server

Apache, Php, MySql Configuration

An internal CA that is part of your IT infrastructure, like a Microsoft Windows CA

Tableau Server on Linux 2018 Update

Web Hosting. Important features to consider


Manual Linux Ubuntu Lts Server Install Webmin

Configure 802.1x - PEAP with FreeRadius and WLC 8.3

Backend IV: Authentication, Authorization and Sanitization. Tuesday, January 13, 15

Developing Online Databases and Serving Biological Research Data

Apache Manually Install Ubuntu From Usb

Phpmyadmin Ubuntu Server

A Seminar report On LAMP Technology

sqlite wordpress 06C6817F2E58AF4319AB84EE Sqlite Wordpress 1 / 6

The specifications and information in this document are subject to change without notice. Companies, names, and data used

Bitnami ez Publish for Huawei Enterprise Cloud

ULTEO OPEN VIRTUAL DESKTOP DEBIAN WHEEZY (7.0) SUPPORT

Ftp Get Command Line Linux Proxy Settings

Kollaborate Server. Installation Guide

LOMBA KETERAMPILAN SISWA

Optimizing LAMP Development with PHP5

Lecture 3: Web Servers / PHP and Apache. CS 383 Web Development II Monday, January 29, 2018

We want to install putty, an ssh client on the laptops. In the web browser goto:

Expedition. Hardening Guide Version Palo Alto Networks, Inc.

How To Start Mysql Use Linux Command Line Client In Ubuntu

K-RATE INSTALLATION MANUAL

Ubuntu Set Static Ip Address Command Line

Instructor s Notes Web Data Management Web Client/Server Concepts. Web Data Management Web Client/Server Concepts

Be smart. Think open source.

Course Wiki. Today s Topics. Web Resources. Amazon EC2. Linux. Apache PHP. Workflow and Tools. Extensible Networking Platform 1

Lassoing the Clouds: Best Practices on AWS. Brian DeShong May 26, 2017

I'm Andy Glover and this is the Java Technical Series of. the developerworks podcasts. My guest is Brian Jakovich. He is the

CCMS Installation Instructions

Stats of Web Server types

Apache Httpd Manual Conf Virtualhost Redirect

IT STARTED WITH A KICKSTARTER CAMPAIGN

Lassoing the Clouds: Best Practices on AWS. Brian DeShong May 26, 2017

Install Apache Manually Win7 7 Php Mysql Phpmyadmin Ubuntu Server

Web pages are a complex undertaking. The basic web page itself isn t

System Administration. NFS & Web Servers

Bitnami Piwik for Huawei Enterprise Cloud

Install and make Apache + PHP to work with PosgreSQL database server on Debian Linux and set up server Web Posgre interface Pgpadmin howto

Web insecurity Security strategies General security Listing of server-side risks Language specific security. Web Security.

Install Apache, PHP And MySQL On CentOS 7 (LAMP)

Eucalyptus User Console Guide

Installing OptiRain Open on Raspbian

I hate money. Release 1.0

CMSilex Documentation

Bitnami Tiny Tiny RSS for Huawei Enterprise Cloud

Securing ArcGIS Services

Bitnami Coppermine for Huawei Enterprise Cloud

Apache Manual Install Ubuntu Php Mysql >>>CLICK HERE<<<

Lesson 17 Transcript: Troubleshooting

Hellerstein/Olston. Homework 6: Database Application. beartunes. 11:59:59 PM on Wednesday, December 6 th

Mysql Server 4.1 Manually Windows 7 Start Service

Bitnami Dolibarr for Huawei Enterprise Cloud

Let's Play... Try to name the databases described on the following slides...

2. Installing OpenBiblio 1.0 on a Windows computer

Manual Ftp Windows 7 Server Iis 7.5 Smtp >>>CLICK HERE<<<

PHP-security Software lifecycle General Security Webserver security PHP security. Security Summary. Server-Side Web Languages

3 Installation from sources

gosint Documentation Release Cisco CSIRT

SOFTWARE INSTALLATION README

Apache Manually Install Ubuntu Alongside Windows 8 After

CSE 498 CSE Courses and Skills Inventory Fall Name:

OpenPro Installation Instructions

OptiRain Open 2 Installation Guide for LInux. This guide provides general instructions for installing OptiRain Open 2 on a Linux based server.

LAMP Stack - VMware Sample Blueprint

How to Secure SSH with Google Two-Factor Authentication

Deployment. Chris Wilson, AfNOG / 26

BeBanjo Infrastructure and Security Overview

WEB DESIGN & DEVELOPMENT

Installing MediaWiki using VirtualBox

AWS/LAMP/Wordpress/Bootstrap Extravaganza. I am determined to make this shit fun.

Bitnami Spree for Huawei Enterprise Cloud

Bitnami TestLink for Huawei Enterprise Cloud

Setting up VPS on Ovh public cloud and installing lamp server on Ubuntu instance

Transcription:

Setting up a LAMP server

What is a LAMP?

Duh.

Actually, we re interested in... Linux, Apache, Mysql, and PHP A pretty standard web server setup Not the only technology options!

Linux Pick any! Common choices are Debian, Ubuntu Server, RHEL, and related distros Normally it s wise to pick a distro that s somewhat stable You can run Arch on a webserver if you re daring (I do!)

Apache Very commonly used web server software Available in your package manager! To enable the service if your installation doesn t do it automatically, enable `httpd` or `apache` depending on your distro

MySQL Database server Available in your package manager Runs as a service, so you may need to enable it if your installation doesn t Install PHPMyAdmin to manage your database with a web GUI Requires you to know less SQL

PHP Common web application programming language We won t discuss why it is or isn t awful here Available in your package manager! (Seems like a trend...aren t package managers great?)

Setting up LAMP

http://www.wikihow.com/build-a-lamp

Initial Installation Install your distro s Apache2, MySQL, and PHP packages You may also need to install an apache-php package Some distros provide a package called LAMP which installs these all for you in one shot. Depending on your distro, there may be good reason not to use it. Enable Apache2 and MySQL systemd based systems: systemctl enable httpd --now && systemctl enable mysql --now

Tell Apache about PHP Apache will not handle PHP scripts by default This process may vary slightly depending on your distro and particular versions of Apache and PHP

Tell Apache about PHP Edit /etc/httpd/conf/httpd.conf Add LoadModule php7_module modules/libphp7.so under the line LoadModule dir_module modules/mod_dir.so Add Include conf/extra/php7_module.conf in the Include list in the file near the bottom, find the last line that starts with Include that s not in a conditional

If you re using PHP 7 like me... In that same file: Comment out LoadModule mpm_event_module modules/mod_mpm_event.so Uncomment LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

Finally... 1. Restart Apache (or httpd, if that s what your distro calls it) 2. Find the directory Apache will serve files from. Configurable, usually defaults to: a. /srv/http/ b. /var/www/ 3. Put a test file there named test.php a. Put <?php phpinfo();?> in it 4. Visit http://localhost/test.php a. Hopefully, that loads and you get a page with a bunch of PHP information 5. Delete the test file, leaving it up can be a security problem

Alternatives

LNMP Linux, Nginx, MySQL, and PHP Nginx is much lighter weight, much faster, and easier to configure than Apache Frequently used in load balancing and proxy servers due to speed Can do many of the same things, but is less powerful and is a younger project

Install Nginx Install nginx, php, and php-fpm Start nginx and php-fpm Once started, visit http://localhost and you should see a simple welcome to nginx page

Set up Nginx Edit /etc/nginx/nginx.conf. In the server{} block, add: location ~ \.php$ { root /usr/share/nginx/html # You can change this path! fastcgi_pass unix:/run/php-fpm/php-fpm.sock fastcgi_index index.php; include fastcgi.conf; } Restart nginx and php-fpm

Set up Nginx Create a file called test.php in your PHP root with the contents: <?php phpinfo();?> (If you followed the defaults on the previous slide, this will be /usr/share/nginx/html/test.php) Visit http://localhost/test.php

LAPP Linux, Apache, PostgreSQL, PHP PostgreSQL is an alternative database, regarded in some ways to be better But, it doesn t have shiny web UIs for management so you need to know some SQL

Or mix and match There are other options, depending on what you re building You can develop web applications in any language and make Apache, Nginx, or other web server software serve them PHP may not be a good language to start with because it s extremely easy to write awful, insecure code and difficult to master You can even use multiple languages for the same web application If you use a technology such as Rails (Ruby web framework), they may provide you with a server

Running on a large scale Usually, the web server and the database server are not on the same system Multiple web servers that serve requests, with a load balancer in front Does what it implies; it decides which server to send traffic to so things don t get overloaded Often powered by Nginx! Frequently run in containers or virtual machines Some companies even consider servers disposable and automatically wipe and rebuild them regularly

Be Conscious of Security Set up your database correctly A disturbing number of sites have their database(s) exposed and open Use a good password and change the defaults Don t open your database to the Internet; only your webserver needs to talk to it HASH (and salt) passwords, don t keep them in plaintext or reversible encryption Don t trust any data HTML escape everything you send to the user with an existing library (don t roll your own!) Use prepared statements when talking to your database so users can t run arbitrary SQL Don t roll your own encryption Learn how to do things properly (this is not an exhaustive list of tips!)

Use HTTPS for Everything! Back in the old days verified SSL certs cost money and took a bit of work to get Let s Encrypt has changed all of this! Free SSL certs for everyone! There is no reason not to use HTTPS for all traffic these days. Protect yourself and your users!