How to install LAMP on the Banwagonhost VPS cloud server

888u

Last update at :2024-01-15,Edit by888u

LAMP is an acronym that stands for Linux (L), Apache (A), MySQL (M), and PHP (P). LAMP helps many different web applications, providing the core foundation required for proper hosting. LAMP builds support for established applications such as WordPress, Drupal, etc.

To use LAMP, only basic Linux packages are required. After connecting as root via SSH, you can install LAMP on your VPS.

Preparation

Before starting further installation, you need to ensure that your operating system is up to date by running the following command:

yum update

Install Apache

Step 1: Install Apache as a web server. Enter "Y" for Yes when prompted.

yum install httpd

Step 2: Enable Apache.

systemctl enable httpd

Step 3: Set up Apache to start at boot.

systemctl start httpd

Step 4: Check the status of Apache (httpd).

systemctl status httpd

Step 5: Once Apache is installed and verified, make sure it is working properly by navigating to the server IP in the URL. An HTTP server test page should now appear.

Install MySQL

Step 1: Now, you need to install MySQL. Follow these quick steps:

yum -y install @mysql

Step 2: Enable MySQL.

systemctl enable --now mysqld

Step 3: Set mySQL to start when the server starts.

systemctl start mysqld

Step 4: Verify that MySQL is active.

systemctl status mysqld

Step 5: Secure your MySQL.

mysql_secure_installation

MySQL asks if you want to verify the password component to test the password and improve security. Go ahead and enter "y" or "Y" for yes.

Select a password strength between 0 and 2. Next, you need to enter the password you will need in the future. Once you've done this and set your password, go ahead and reply "Yes" to the following options:

  • Do you want to continue using the password provided?
  • Delete anonymous users?
  • Disable remote root login?
  • Delete the test database and access it?
  • Reload the permissions table now?

Step 6: From here, you need to log in to your MySQL installation.

mysql -u root -p

Step 7: You now need to create the database with a user who has permissions. Note that we are using "lampuser" and "password" as the database username and password for this tutorial. You can then interchange these with your requirements.

CREATE DATABASE lamp_db; CREATE USER lampuser@localhost IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON * . * TO 'lampuser'@'localhost'; FLUSH PRIVILEGES;

(Note: When running the above MySQL command, "lamp_db" is the database, "lampuser" is the database username, and "password" is the database password

Install PHP

Step 1: You need to install PHP using the following line yum and answer "Y" for yes when prompted.

yum installphp

Step 2: Install more php extensions and applications. Answer "Y" for Yes when prompted.

yum install php-pear php-mysqlnd php-curl php-mbstring php-gd php-xml php-pear php-fpm php-pdo php-opcache php-json php-zip php-cli

Step 3: Enable PHP.

systemctl enable php-fpm

Step 4: Make sure PHP starts on boot.

systemctl start php-fpm

Check whether it is running normally

Step 1: Make sure Apache is running by running the following command. Note that if this process is working properly, it should also show the active (running) status in green.

systemctl status httpd

Step 2: Make sure MySQL is running by running the following command. Note that if this process is working properly, it should also show the active (running) status in green.

systemctl status mysqld

Step 3: Make sure PHP is running by running the following command. Note that if this process is working properly, it should also show the active (running) status in green.

systemctl status php-fpm

Step 4: You are now done! Your LAMP is installed and ready for any of your future hosting needs.

Recommended discounts/cost-effective packages for bricklayers

Warm reminder: If you have difficulty choosing, just choose the CN2 GIA-E plan in the middle. The quarterly payment is $49.99, and you can switch between up to 12 computer rooms at will.

Banwagonhost discount code: BWH3HYATVBJW, discount 6.58%, available everywhere. The table below summarizes more preferential packages for bricklayer removal.

plan Memory CPU harddisk Traffic/month bandwidth engine room price Buy
CN2 (cheapest) 1GB 1 core 20GB 1TB 1Gbps DC3 CN2 DC8 ZNET $49.99/year Buy
CN2 2GB 1 core 40GB 2TB 1Gbps $52.99/half year $99.99/year Buy
CN2 GIA-E (Most recommended) 1GB 2 cores 20GB 1TB 2.5Gbps DC6 CN2 GIA-E DC9 CN2 GIA Japan SoftBank JPOS_1 China Unicom Netherlands EUNL_9 $49.99/quarter $169.99/year Buy
CN2 GIA-E 2GB 3 core 40GB 2TB 2.5Gbps $89.99/quarter $299.99/year Buy
HK 2GB 2 cores 40GB 0.5TB 1Gbps Hong Kong CN2 GIA $89.99/month $899.99/year Buy
HK 4GB 4 core 80GB 1TB 1Gbps $155.99/month $1559.99/year Buy

Select a suggestion:

  • Getting started: Los Angeles CN2 package, currently the cheapest, optional CN2 GT computer room, the entry-level choice.
  • Recommendation: Los Angeles CN2 GIA-E package, affordable, super fast, with many optional computer rooms, and the most cost-effective.
  • High-end: Hong Kong CN2 GIA package, the price is higher, but impeccable.

Recommended site search: registered domain names, Chinese domain name query, domain name prices, server space rental, foreign website space, .net virtual host, how much does it cost to rent a server for a year, high-defense server rental qy, dynamic ip server, Hong Kong Cloud host,

How to install LAMP on the Banwagonhost VPS cloud server

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码