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
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.
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 )
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
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
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 !!!
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
Content type
Image
Digest
Size
155.9 MB
Last updated
over 6 years ago
docker pull 4dteam/lamp-stack