NuHarbor Security
  • Solutions
    Solutions
    Custom cybersecurity solutions that meet you where you are.
    • Overview
    • Our Approach
    • Data Icon Resources
    • Consultation Icon Consult with an expert
    • By Business Need
      • Identify Gaps in My Cybersecurity Plan
      • Detect and Respond to Threats in My Environment
      • Fulfill Compliance Assessments and Requirements
      • Verify Security With Expert-Led Testing
      • Manage Complex Cybersecurity Technologies
      • Security Monitoring With Splunk
    • By Industry
      • State & Local Government
      • Higher Education
      • Federal
      • Finance
      • Healthcare
      • Insurance
    Report 2023-2024 SLED Cybersecurity Priorities Report
    2023-2024 SLED Cybersecurity Priorities Report
    Read Report
  • Services
    Services
    Outcomes you want from a team of experts you can trust.
    • Overview
    • Data Icon Resources
    • Consultation Icon Consult with an expert
    • Security Testing
      • Penetration Testing
      • Application Penetration Testing
      • Vulnerability Scanning
      • Wireless Penetration Testing
      • Internal Penetration Testing
      • External Penetration Testing
    • Assessment & Compliance
      • CMMC Compliance
      • NIST 800-53
      • HIPAA Security Standards
      • ISO 27001
      • MARS-E Security Standards
      • New York Cybersecurity (23 NYCRR 500)
      • Payment Card Industry (PCI)
    • Advisory & Planning
      • Security Strategy
      • Incident Response Planning
      • Security Program Reviews
      • Security Risk Assessments
      • Virtual CISO
      • Policy Review
    • Managed Services
      • Curated Threat Intelligence
      • Managed Detection and Response (MDR)
      • Sentinel Managed Extended Detection and Response (MXDR)
      • SOC as a Service
      • Splunk Managed Services
      • Tenable Managed Services
      • Vendor Security Assessments
      • Vulnerability Management
      • Zscaler Support Services
    Report 2023-2024 SLED Cybersecurity Priorities Report
    2023-2024 SLED Cybersecurity Priorities Report
    Read Report
  • Partners
  • Resources
    Resources
    Explore reports, webinars, case studies, and more.
    • Browse Resources
    • Consultation Icon Consult with an expert
    • Blog icon Blog
    • Podcast icon Podcast
    • Annual SLED CPR icon Annual SLED CPR
    • Downloadable Assets icon Downloadable Assets
    Report 2023-2024 SLED Cybersecurity Priorities Report
    2023-2024 SLED Cybersecurity Priorities Report
    Read Report
  • Company
    Company
    We do cybersecurity differently – the right way.
    • Overview
    • Data Icon Resources
    • Consultation Icon Consult with an expert
    • Leadership
    • News
    • Careers
    • Contact
    Report 2023-2024 SLED Cybersecurity Priorities Report
    2023-2024 SLED Cybersecurity Priorities Report
    Read Report
  • Consult with an expert
  • Client support
  • Careers
  • Contact
1.800.917.5719
NuHarbor Security Blog
    • Compliance
    • Cybersecurity Technology
    • Security Operations
    • Industry Insights
    • Security Testing
    • Advisory and Planning
    • Application Security
    • Managed Detection and Response
    • Threat Intelligence
    • NuHarbor
    • Managed Services
    • Cyber Talent
December 29, 2015

Installing LAMP Server On Ubuntu (Linux, Apache, PHP, MySQL)

Justin Fimlaid Justin Fimlaid

By: Hunter Gregal

LAMP_software_bundle.svg

A key component of any enterprise network will often be a functional webserver with PHP compatibility and a database back-end. On a Linux server, a common setup is to use Apache HTTP Server as the primary webserver.

Combining the Apache HTTP Server along with PHP and MySQL functionality on a Linux machine is referred to as a LAMP stack. LAMP simply stands for Linux, Apace, MySQL, and PHP.

The following guide will streamline the process of setting up a LAMP stack on your own Ubuntu server.

Install Apache

The first step to any successful LAMP stack is to install the base webserver - Apache. Apache is a highly configurable free and open-source software that can serve dynamic HTTP and HTTPS content For this guide we will keep the installation simple, but please note that there is a lot of flexibility in customizing Apache to fit your webserver needs.

Run the following command to install Apache, documentation, and utilities:
sudo apt-get update && sudo apt-get install apache2 libapache2-mod-php5

To confirm that the Apache service installed correctly and is running, run:
sudo service apache2 status

To test the Apache webserver, navigate a web browser to your server's IP address:
http://$IP_ADDRESS (replace $IP_ADDRESS with your server's IP address)

Now that you have a webserver, you probably want to change the content that it serves to clients. By default, Apache serves all pages located in the directory:
/var/www

To configure your Apache webserver, all primary configuration files are located in the directory:
/etc/apache2

The primary configuration file is located at:
/etc/apache2/apache2.conf

Remember: Any changes to Apache's configuration settings will require a restart of the service:
sudo service apache2 restart

Install MySQL Server

MySQL is a commonly used open-source relational database management system. It is used for storing and managing data both small and large scale.

Run the following command to install MySQL Server:
sudo apt-get install mysql-server

Follow the installation prompt and set the root password.

Install PHP

The final step is to install the PHP server-side scripting language along with support for Apache and MySQL. This further enhances the content your webserver can serve and allows for the use of PHP scripts to handle dynamic content and interaction with our database backend. Additionally, it is a good idea to add basic encryption/decryption support via the mcrypt extension.

Run the following command to install PHP with Apache, MySQL, and mcrypt support:
sudo apt-get install php5 libapache2-mod-php5 php5-mysql php5-mcrypt
Restart Apache
sudo service apache2 restart

Congratulations! You should now have a fully functional LAMP server that is ready to serve dynamic content to clients. You may now consider to further secure and customize your Apache webserver via its configurations (Here’s some tips!), setup virtual hosts, or install a content managements system such as WordPress.

Justin Fimlaid
Justin Fimlaid

Justin (he/him) is the founder and CEO of NuHarbor Security, where he continues to advance modern integrated cybersecurity services. He has over 20 years of cybersecurity experience, much of it earned while leading security efforts for multinational corporations, most recently serving as global CISO at Keurig Green Mountain Coffee. Justin serves multiple local organizations in the public interest, including his board membership at Champlain College.

Related Posts

1 min read
Vermont's cybersecurity landscape Read More
2 min read
Get Informed: Learn About Phishing Attacks Read More
Compliance 1 min read
Why Boutique Security Firms Will Lead in the Age of Guerrilla Cyberwarfare Read More

Subscribe via Email

Subscribe to our blog to get insights sent directly to your inbox.

Subscribe Here!

Latest Pwned episodes

Episode 200 - Reflections of Pwned...Until Next Time
April 03, 2024
Episode 200 - Reflections of Pwned...Until Next Time
Listen Now
Episode 199 - When a BlackCat Crosses Your Path...
March 21, 2024
Episode 199 - When a BlackCat Crosses Your Path...
Listen Now
Episode 198 - Heard it Through the Grapevine - Beyond the Beltway, 2024
March 08, 2024
Episode 198 - Heard it Through the Grapevine - Beyond the Beltway, 2024
Listen Now
NuHarbor Security logo
NuHarbor Security

553 Roosevelt Highway
Colchester, VT 05446

1.800.917.5719

  • Solutions
  • Services
  • Partners
  • Resources
  • Company
  • Contact
  • Privacy Policy
Connect
  • Twitter
  • Linkedin
  • YouTube
©2025 NuHarbor Security. All rights reserved.