Sign inSign up

4dteam/lamp-stack

By 4dteam

Updated over 6 years ago

A LAMP Stack Running on Ubuntu 18.04

Image
0

2.9K

4dteam/lamp-stack repository overview

About The Image & Getting Started

First Things First

Its A LAMP On Ubuntu 18.04 Docker Image And Its Also Have PHP7.1 Means (MCrypt exetension) Supported.

Also It Has Like 6 + Exetension PreInstalled !

And You Can Also Install Additional PHP Exetension Installed In It ( In The Container ) . This Has Also GIT Installed.

So Lets Get Started

Usage Of The Image

First Of All Lets Pull This Image

root@iamanubhab~# docker pull 4dteam/lamp-stack

After Pulling That Image You Can Now Create & Start A Docker Container.

But Remember :

You Need To Expose Some Ports To Like 6000 (Your Choice ) For 3306 ( Internal Port )

You Need To Expose Port Like 8080 ( Your Choice ) For 80 ( Internal Port )

You Need To Expose Port Like 4433 ( Your Choice ) For 443 ( Internal Port )


Launching The Docker Container

So Now We Are Going To Launch The Docker Container With The Image

root@iamanubhab~# docker run -dit --name lamp-stack -p 6000:3306 -p 8080:80 -p 4433:443 4dteam/lamp-stack

A Response Like This "3b5ef3d4b27aa5a5ab8af914289c7245712a3c93da3a042913054754b69bf6a7" Will Come

It Means Its Successfully Started

Lets See

root@iamanubhab:~# docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3b5ef3d4b27a 4dteam/lamp-stack "/bin/bash" About a minute ago Up About a minute 22/tcp, 0.0.0.0:8080->80/tcp, 0.0.0.0:4433->443/tcp, 0.0.0.0:6000->3306/tcp lamp-stack

NOTE : THE SERVICES IS STILL NOT STARTED WE NEED TO MANUALLY START IT

So Lets Bash Into The Container And Start All Services

root@iamanubhab:~# docker exec -it 3b5ef3d4b27a bash

root@3b5ef3d4b27a:/#

Here "3b5ef3d4b27a" Refers To Your Container ID

So Lets Start All Services

root@3b5ef3d4b27a:/# cd /

root@3b5ef3d4b27a:/# ./setup.sh

  • Starting MariaDB database server mysqld [ OK ]
  • Starting Apache httpd web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message

root@3b5ef3d4b27a:/# chown -R www-data:www-data /var/www/html/

Now All Services Have Been Started Successfully.

Now Lets See The Setup Is Working Or Not

Hit Your Browser On & Go To

YOUR_SERVER_IP:8080

Upon Visiting It Will Show A PHP Info Page

Then It Means Your Setup Is Working

NOTE : IF YOU CANT ACCCESS THE PAGE VIA YOUR BROWSER IT MAYBE POSSIBLE THE FIREWALLD ON THE SERVER IS RESTRICTING ITS ACCESS

Lets Access MySQL

root@3b5ef3d4b27a:/# mysql -u root -proot

Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 38 Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

NOTE : IN THIS IMAGE MYSQL ROOT PASS Is root

Lets Also See The PHP Version

root@3b5ef3d4b27a:/# php -v

PHP 7.1.2 (cli) (built: May 5 2020 12:14:27) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

root@3b5ef3d4b27a:/#

Now Its Means We Are Done ! Lets Move To FAQ

FAQ

1 . What Is The MySQL Root Pass In This Image. ?

ANS : root

2 . What is the PHP Version Inbuilt In this image ?

ANS : 7.1.2 , You Can Also Check Via php -v Command

3 . I Cannot Access The Page Via My Server IP : 8080 Port

ANS : Firewall is causing problem . Stop It

For CentOs <7 & Rhel <7

[root@localhost]:# service iptables stop

For CentOs 7+ & Rhel 7 +

[root@localhost]:# service firewalld stop

For Debian Based 9 + Systems

root@iamanubhab:# service ufw stop

For Debain <9 Based Systems

root@iamanubhab:# service iptables stop

And Now Your Problem Is Now Fixed !!!

  1. Donations Accepted ?

ANS : Yes On

https://paypal.me/anubhabhost

5 . Author Name ?

Ans : Anubhab , 4d-Team

6 . What Is The Root Directory Of LAMP (WWW) ?

ANS : /var/www/html

Thank You This Is End Of This FAQ Donations Is Much Appericiated & Also if you have any issue then file a issue i will fix it

Tag summary

Content type

Image

Digest

Size

155.9 MB

Last updated

over 6 years ago

docker pull 4dteam/lamp-stack