LAMP + phpMyAdmin¶
In this article
Information
LAMP - is a web development technology stack that includes the Linux operating system, Apache web server, MySQL database, and PHP interpreter. Linux provides hosting and server management, Apache acts as a web server that processes and responds to resource requests, MySQL is a relational database that stores and processes data, and PHP is a programming language. phpMyAdmin is a free and open source program written in PHP that allows you to manage MySQL through a web interface.
LAMP + phpMyAdmin. Key Features¶
-
phpMyAdmin: allows you to manage MySQL very easily and conveniently, without the need to use the command line or complex scripts. It is often used on hosting sites to manage user databases. Allows you to view and manage databases, tables, fields, indexes and other MySQL objects, execute SQL queries, import and export data in various formats (SQL, CSV, XML).
-
High Performance: Apache is a reliable, high-performance web server, and MySQL provides fast data access for high-performance applications.
-
Reliability and Security: Linux is a robust operating system with high security against hackers, and Apache has many tools to protect against attacks and other threats.
-
Scalability: With Apache's modular architecture and MySQL's horizontal scalability, LAMP easily scales to meet the needs of growing businesses.
-
Flexibility: PHP is a flexible and powerful programming language that allows you to create dynamic Web pages and applications with a variety of features.
-
Open and extensible code: All components of LAMP are open source, allowing you to customize and adapt the software to meet different needs.
-
Easy to use: Customizing LAMP is not a complicated process, especially for those familiar with Linux and Web development.
Deployment Features¶
ID | Compatible OS | VM | BM | VGPU | GPU | Min CPU (Cores) | Min RAM (Gb) | Min HDD/SDD (Gb) | Active |
---|---|---|---|---|---|---|---|---|---|
88 | Ubuntu 22.04 | + | + | + | + | 1 | 1 | - | Yes |
- Install Apache + SSL + Fail2ban + php-fpm + MariaDB in the hostkey.in zone.
- Installed software: PhpMyAdmin.
After installing, SSH into the server and add the site content to the /etc/apache2/sites-available
directory.
Note
Unless otherwise specified, by default we install the latest release version of software from the developer's website or operating system repositories.
Getting started after deploying LAMP + phpMyAdmin¶
A notification will be sent to the e-mail specified during registration that the server is ready for work after paying for the order. It will contain the IP address of the VPS, as well as the login and password for the connection. Clients of our company manage the hardware in the server`s and API control panel - Invapi.
- The web interface will be available at:
https://lamp{Server_ID_from_Invapi}.hostkey.in/phpmyadmin
- Login:
admin
; - Password:
admin
.
Database Creation¶
To add a new database, log in to the phpMyAdmin interface and navigate to the Databases tab.
Enter a unique name for the new database in the Database Name field and click the Create button.
Re-enter the table name and specify the number of rows. Once you have entered the data, click the Go button.
The database will be created and added to the list of existing databases. You can now create tables and work with data.
Note
Detailed information about working with the database can be found in the developer documentation.
Ordering a server with LAMP using the API¶
To install this software using the API, follow these instructions
Self-Installing LAMP on Ubuntu¶
-
Update System Packages:
-
Install Apache Web Server:
-
Add MariaDB GPG Key:
-
Add MariaDB Repository:
-
Install MariaDB Server and Client:
-
Add PHP Repository for Latest PHP:
-
Install PHP and Necessary Modules:
-
Install phpMyAdmin:
-
Install phpMyAdmin package
-
Create symbolic link for phpMyAdmin**
-
Set up database user for phpMyAdmin (using MySQL)
-
Set up .htaccess to allow login with admin user
- echo "AuthType Basic" | sudo tee /usr/share/phpmyadmin/.htaccess - echo "AuthName 'Restricted Files'" | sudo tee -a /usr/share/phpmyadmin/.htaccess - echo "AuthUserFile /etc/phpmyadmin/.htpasswd" | sudo tee -a /usr/share/phpmyadmin/.htaccess - echo "Require valid-user" | sudo tee -a /usr/share/phpmyadmin/.htaccess
-
Install apache2-utils
-
Create htpasswd file for admin user**
-
Create symbolic link for phpMyAdmin Apache configuration**
-
Enable phpMyAdmin site in Apache**
-
-
Restart Apache to apply changes
-
Restart Apache to Apply Changes:
-
Create Info.php File for Testing PHP:
Easy Setup with a Bash Script (SSH and Invapi Deployment)¶
#!/bin/bash
# Update system
sudo apt update -y
# Install Apache
sudo apt install apache2 -y
# Add MariaDB GPG Key
wget -qO- https://mariadb.org/mariadb_release_signing_key.asc | gpg --dearmor --batch --yes -o /usr/share/keyrings/mariadb-keyring.gpg
# Add MariaDB Repository
sudo echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/mariadb-keyring.gpg] http://mariadb.mirror.globo.tech/repo/10.11/ubuntu jammy main' | sudo tee /etc/apt/sources.list.d/mariadb.list
# Install MariaDB Server and Client
sudo apt update && sudo apt install mariadb-server mariadb-client -y
# Add PHP Repository for Latest PHP 8.2
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update
# Install PHP and Necessary Modules
sudo apt install php8.2 libapache2-mod-php8.2 php8.2-mysql php8.2-curl php8.2-cgi -y
# Install phpmyadmin
sudo apt install phpmyadmin -y
sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
mysql -u root -e "CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin';"
mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost';"
mysql -u root -e "FLUSH PRIVILEGES;"
echo "AuthType Basic" | sudo tee /usr/share/phpmyadmin/.htaccess
echo "AuthName 'Restricted Files'" | sudo tee -a /usr/share/phpmyadmin/.htaccess
echo "AuthUserFile /etc/phpmyadmin/.htpasswd" | sudo tee -a /usr/share/phpmyadmin/.htaccess
echo "Require valid-user" | sudo tee -a /usr/share/phpmyadmin/.htaccess
sudo apt install -y apache2-utils
echo "admin:$(openssl passwd -apr1 admin)" | sudo tee /etc/phpmyadmin/.htpasswd
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2ensite phpmyadmin.conf
# Restart Apache to apply changes
sudo systemctl restart apache2
# Create info.php File for Testing PHP
echo "<?php phpinfo(); ?>" > /var/www/html/info.php
sudo chmod 0644 /var/www/html/info.php
echo "Installation Complete!"
Use script on BASH commandline¶
- Connect to your server via SSH.
- Save the script as a
.sh
file (e.g.,install.sh
). - Make it executable:
chmod +x install.sh
. - Run the script on your server:
./install.sh
. -
Use http://
/phpmyadmin for connect to web interface. You would obtain you IP via commandline
Using the Script During Server Reinstallation¶
- Select the desired OS in the Reinstall >> Operating System tab.
- Paste the script for the supported OS into the Post-install script field in the Advanced options tab.
- Start the reinstallation by clicking the button
Reinstall this server