secure setup mariadb
0

You don’t must install your whole package of any Hosting control interface particularly when your host has RAM that is minimum quota. Just follow this guide that is thorough starting Apache, PHP, MariaDB MySQL and PhpMyAdmin on Ubuntu 15.10 host. This guide will make suggestions, with screenshot photos, to any or all the actions had a need to build a web that is working to host dynamic websites like WordPress, Joomla, etc. This full stack Apache package is most commonly known as LAMP Stack (Linux, Apache, MySQL and PHP). This article is for newbie who want to learn using Virtual Private Server for their very time that is first. Keep reading..

Prerequisites

  1. A SSH customer like Bitvise or Putty and knowledge that is basic how to use it.
  2. Basic knowledge about common Unix command to SSH to your server.
  3. A server or VPS with at least 256MB of RAM (OpenVZ) but 512MB is recommended if you are using KVM or Xen.
  4. About 30 minutes of your time
  5. a cup of coffee or tea.

Confused on choosing which VPS provider to install VestaCP? Read my recommended VPS providers or top end that is low host providers. Quick suggestion: Digital Ocean, Atlantic.net or Ramnode.

In this guide i will be utilizing a 512MB RAM Cloud VPS from Digital Ocean operating Ubuntu 15.10 x64.

Install apache*******************) that is 2(***)Step 1 – Login to your server as root or as a user with root privilege (sudo) :

setup apache 1

Step 2 – It is strongly recommended to firstly upgrade several things :

apt-get update -y
 apt-get upgrade -y

setup apache update apt

Step 3 – Next, check whether Apache is installed or not. Some providers include Apache preinstalled within their templates while others do not.

service apache2 stop

You don’t need to install it again if you already have it. Otherwise, install Apache with this command that is simple******)

apt-get install apache2 -y

setup apache 2

Install PHP

Step 1 – Now you’ve got Apache webserver set up. Once, after that you can check out install PHP using this demand :

apt-get install php5 php5-mysql libapache2-mod-php5***********************) that are-y(***)setup apache 3 php 

Step 2 – Next, it is better to also restart Apache and verify which PHP version has been installed :

service apache2 restart
 php -v

setup apache 4

Step 3 – PHP is now installed but in most cases users usually need additional PHP modules so any CMS can simply works. Command below will install most common PHP modules / addons :

apt-get install php5-cgi php5-cli php5-common php5-curl php5-dev php5-gd php5-tidy php5-xmlrpc php5-xsl php5-mcrypt php5-imap php5-imagick -y

install php modules ubuntu

Install MySQL

We will use MariaDB as a replacement that is drop-in of MySQL. MariaDB is considered quicker and lighter to deal with databases. Here’s tips on how to do the installation :

Step 1 – we are able to just utilize command that is apt-get usual :

apt-get install mariadb-server -y

install mariadb mysql server

Step 2 – Once installed, lets do initial mysql server setup :

mysql_secure_installation

You’ll then see several questions to answer. The most important part of the question is password that is defining mysql root individual. Mysql root individual just isn't the your that is same root user.

setup mariadb server

secure setup mariadb

Step 3 – Verify that MariaDB mysql is ( that is running

service mysql status

mariadb mysql status

Install PhpMyAdmin

PHPMyAdmin is a favorite online mysql administration user interface enabling users to handle, produce, delete, and edit databases along with database users. It's also appropriate for MariaDB.

Step 1 – Thank goodness, phpmyadmin had been a part of standard Ubuntu repository so installation would be effortless.

apt-get install phpmyadmin -y

install phpmyadmin mariadb

Step 2 – A question will appear. Merely choose Apache 2 then okay

setup mariadb server 2

Step 3 – another will appear requesting whether or not to utilize dbconfig-common or otherwise not. Simply solution Yes.

config mariadb

Step 4 – You’ll must also determine standard password to login to phpmyadmin******) that are

phpmyadmin app password

It will ask the password twice for confirmation.

Step 5 – Also provide the password for the account that is administrative******)

mysql administrative password

Step 6 – That’s it. Now introduce your web that is favorite browser try to open it through your server ip (replace x.x.x.x) :

http://x.x.x.x/phpmyadmin

Sometimes you might be lucky but sometimes you don’t.

phpmyadmin not found error

However then Control+X).

add phpmyadmin conf

Step 7 – Restart Apache and try reloading the page again in web browser :

systemctl restart apache 2

restart apache mariadb

You should now see something similar to this one :

phpmyadmin interface

Step 8 – You can now login for the very first time using root-privileged of Mysql users to the database if you see Not Found error like above, simply proceed this additional step : Edit Apache’s default configuration

nano /etc/apache2/apache2.conf

Scroll down the page till its very end and add this line there :

Include /etc/phpmyadmin/apache.conf

Save and exit the editor (Control+O. But nevertheless then do this :

lagu phpmyadmin vs indonesia

Login to mysql as root :

mysql -u root -p

then issue command below

CREATE USER 'servermomtest'@'localhost' IDENTIFIED BY 'servermompass';
 GRANT ALL PRIVILEGES ON * if somehow you can not login to phpmymysql admin, . * TO 'servermomtest'@'localhost' IDENTIFIED BY 'servermompass' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

replace servermomtest with another mysql that is new and change servermompass with a password you prefer.

After that, you'll just make use of the username that is new password you have just defined. The new database user has some kind like root privilege so you can create other users and databases once logged in to phpmyadmin.

fix phpmyadmin root

Add New Website to Apache

Before you can host your blogs / websites on your server, you should firstly create virtual hosts file that serves like identification of what website is hosted – domain, web directory, alias, port listening, etc. It means then Apache knows where is the location of the web files should be taken.( if someone is querying your server – through DNS of course – looking for website A, for instance,******)

Step 1 – Create internet directory for the internet site :

mkdir -p /var/www/domain.tld/public_html
 
 ## instance :
 mkdir/var/www/servermom that is-p.xyz/public_html(***********************) 

Step 2 – Now setup permission that is proper that directory :

chmod -R 755 /var/www

Step 3 – additionally, modification ownership associated with directory to www-data :

chown -R www-data:www-data /var/www/domain.tld/public_html

create web directory

Step 4 – Create a test file in .html structure for testing function :

cd /var/www/domain.tld/public_html
 nano index.html

Step 5 – place these lines inside that file :

<html>
   <head>
     <title>Success - Congratulation</title>
   </head>
   <body>
     <h1>Success: you have got create a Virtual Host</h1>
     <p>Apache is operating and setup fine</p>
   </body>
 </html>

Hit Control+O then Control+X to save lots of then leave the editor.

Step 6 – Now allows produce the hosts that are virtual :

cd /etc/apache2/sites-available
 nano domain.tld.conf

Step 7 – Then put this (copy-paste) in your hosts that are virtual :

<VirtualHost *:80>
 
     ServerName servermom.xyz
     ServerAlias www.servermom.xyz
     ServerAdmin [email protected]
     DocumentRoot /var/www/servermom.xyz/public_html
 
     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
 
 </VirtualHost>

Obviously you need to change servermom.xyz along with your domain that is own name. Done? Hit Control+O then Control+X to save and exit the editor.

Step 8(************)– restart Apache finally. :

service apache2 restart

Step 9 – Now allow your newly developed forum utilizing command that is simple******)

a2ensite domain.tld
 
 ## example :
 a2ensite servermom.xyz

Step 10 – Finally, you’ll be asked to reload apache

service apache2 reload

seup apache finish

Open up your web browser again and try. You should see something ( that is similar

mission success

What’s next?

That’s it. The explanation is hoped by me is comprehensive sufficient so that you can follow. Please feel free to talk your minds into the remark part below.

CPanel Backup restore and configuration tutorial

Previous article

The look for cheaper GPUs is arriving some unforeseen deals

Next article

You may also like

Comments

Leave a reply

Your email address will not be published. Required fields are marked *

More in Apache