Sohaib's Tech Blog

Something for every one

Apache2 w/Percona 5.6 Installation Ubuntu Willy — 2016

Apache2 w/Percona 5.6 Installation Ubuntu Willy

Its been a long time since my last update, I was busy with family and work. Today I will show how we install Apache2 using Ubuntu latest edition Willy as of Jan-23-2016

apt-get update
apt-get install apache2 apache2-doc apache2-utils libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libruby libapache2-mod-python php5-curl php5-intl php5-memcache php5-memcached php5-ming php5-ps php5-pspell php5-recode php5-sqlite php5-tidy php5-xmlrpc php5-xsl memcached php5-apcu libapache2-mod-fastcgi php5-fpm -y
a2enmod actions fastcgi alias
service apache2 restart
a2enmod suexec rewrite ssl actions include cgi
a2enmod dav_fs dav auth_digest
php5enmod mcrypt

Finally we restart Apache2  for the last time

service apache2 restart

Now will install Percona Database Server Instead of MySQL Server

Fetch the repository packages from Percona web:

wget https://repo.percona.com/apt/percona-release_0.1-3.$(lsb_release -sc)_all.deb<span id="mce_marker" data-mce-type="bookmark"></span>

Install the downloaded package with dpkg. To do that, run the following commands as root or with sudo:

Once the following installed you can check Percona repositories should be added. /etc/apt/sources.list.d/percona-release.list file.

dpkg -i percona-release_0.1-3.$(lsb_release -sc)_all.deb
<span id="mce_marker" data-mce-type="bookmark"></span>
apt-get update
apt-get install percona-server-server-5.6 percona-server-client-5.6 -y<span id="mce_marker" data-mce-type="bookmark"></span>

You are Done.

Now you’ve a great rock solid Apache2 Server

You also copy and paste the complete script :-

 

apt-get update

apt-get install apache2 apache2-doc apache2-utils libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libruby libapache2-mod-python php5-curl php5-intl php5-memcache php5-memcached php5-ming php5-ps php5-pspell php5-recode php5-sqlite php5-tidy php5-xmlrpc php5-xsl memcached php5-apcu libapache2-mod-fastcgi php5-fpm -y

a2enmod actions fastcgi alias
service apache2 restart
a2enmod suexec rewrite ssl actions include cgi
a2enmod dav_fs dav auth_digest
php5enmod mcrypt
service apache2 restart

wget https://repo.percona.com/apt/percona-release_0.1-3.$(lsb_release -sc)_all.deb
dpkg -i percona-release_0.1-3.$(lsb_release -sc)_all.deb

apt-get install percona-server-server-5.6 percona-server-client-5.6 -y

Speed the web with Google Page speed – Click here

Advertisements
How I got my Gtmetrix.com Score to 1.98s — 2015

How I got my Gtmetrix.com Score to 1.98s

My last project was very challenging where I was told to optimize Magento Site, Customer was using a dedicated server where I’ve to optimize not only Magento but also Optimize & Speed up the server, Took me some real time and hard work. I am happy Yayyyyy.

I don’t want to get in details as far as server configuration but I achieve 1.98s load time

Magento which was loading in 22s to 15s , I got it down to 1.98s

I’ve setup the following

APC
Memcached
Nginx with Pagespeed

If you need any assistance from me speeding up your Magento, Drop me a line, I charge flat $1,000 and trust me it takes a lot of time and effort, Oh yea client was using Amazon Cloudfront CDN but then he switch to Akamai CDN which is the TOP Dawg in CDN world I am here to assist.

So do you want to speed up your magento store ?

WebServer with Percona Google Pagespeed — 2014

WebServer with Percona Google Pagespeed

Today : I would like to share how you setup a fast Webs Server with MYSQL .

In this tutorial you don’t really need any control panel and waste your money, like Cpanel or this and that, I am not discouraging any one but I cant stand them.

We are setting up the following
NGINX
Google Page Speed
Percona *MYSQL Database
Memcahed
PHPmyadmin

No Apache so NO MORE .htaccess file…

In my environment, I have a 15GB Server with 200GB SSD RAID 10

Oh yea, before I forget I have a Ubuntu 12.04 Precise.

Assuming you are a ROOT user.

apt-get update
apt-get install memcached php5-cli php5-fpm php5-mysql php5-curl php5-gd php5-imagick php5-mcrypt php5-memcached php5-imap

Simply and easy and you are done.

Now let’s create a user and public_html

adduser sohaib

Go to

cd /home/sohaib/

Create public_html or whatever you wanted to call your HOME directory, regarding setting up nginx configuration How to Nginx Google Pagespeed

How To Install Zabbix on Ubuntu 12.04 Precise & Configure — 2014

How To Install Zabbix on Ubuntu 12.04 Precise & Configure

Hello –

Today, I am going to show how you can install zabbix monitoring tool on Ubuntu 12.04 Precise.

Edit apt source list to add the PPA:

sudo nano /etc/apt/sources.list

Add the following items at the end of the file:

# Zabbix Application PPA

deb http://ppa.launchpad.net/tbfr/zabbix/ubuntu precise main
deb-src http://ppa.launchpad.net/tbfr/zabbix/ubuntu precise main

Save and close the file.

Next, we need to add the PPA’s key so that apt-get trusts the source:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C407E17D5F76A32B

We can now install Zabbix. It will pull in the necessary LAMP dependencies as well:

sudo apt-get update
sudo apt-get install zabbix-server-mysql apache2 mysql-server php5 php5-cli php5-common php5-mysql zabbix-frontend-php

During the installation, you will be asked to choose a password for the MySQL root account. Make a selection and confirm your choice.

Configuring the Zabbix Server
Next, we will need to configure the packages we just installed.

First, we will edit the main Zabbix server configuration file. Open the file with root privileges:

sudo nano /etc/zabbix/zabbix_server.conf

Search for the following properties and set them accordingly. Some may already be set correctly, and some you may have to add. Choose a password as well:

DBName=zabbix
DBUser=zabbix
DBPassword=Your.Password.Here
Save and close the file.

MySQL Configuration
Next, we will go into the package directory and unzip the SQL files that will define our database environment:

cd /usr/share/zabbix-server-mysql/
sudo gunzip *.gz

We will import the SQL files into our database. However, we first must create the database and do some initial configuration.

Log into MySQL as the root user using the password that you set up during installation:

mysql -u root -p
First, create a user for Zabbix that matches the information we entered in the “/etc/zabbix/zabbix_server.conf” file. Make sure to use the same information:

create user ‘zabbix’@’localhost’ identified by ‘Your.Password.Here’;
Next, we will create the Zabbix database:

create database zabbix;
Give control over the new database to the new user we created:

grant all privileges on zabbix.* to ‘zabbix’@’localhost’;
The following line will implement our new permissions:

flush privileges;
We are now done with the initial MySQL configuration. Exit back to the shell:

exit;
Now that we have our database set up, we can import the files that Zabbix needs to function. Enter the password for the user “zabbix” that you configured when prompted:

mysql -u zabbix -p zabbix < schema.sql
Do the same with the images file:

mysql -u zabbix -p zabbix < images.sql
And finally, import the data file:

mysql -u zabbix -p zabbix < data.sql

PHP Configuration
We need to adjust some values for the php processing of our monitoring data. Open the php configuration file:

sudo nano /etc/php5/apache2/php.ini
Search for and adjust the following entries. If they do not exist, add them:

post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = UTC
Save and close the file.

Next, we will copy the Zabbix-specific php file into the configuration directory:

sudo cp /usr/share/doc/zabbix-frontend-php/examples/zabbix.conf.php.example /etc/zabbix/zabbix.conf.php
Open the file:

sudo nano /etc/zabbix/zabbix.conf.php
Edit the following values. Use the same info as when you set up the database earlier:

$DB['DATABASE'] = 'zabbix';
$DB['USER'] = 'zabbix';
$DB['PASSWORD'] = 'Your.Password.Here'

Save and close the file.

Configuring Additional Files
There are a few more files that we need to configure.

First, we’ll move the Zabbix apache file from the package directory:

sudo cp /usr/share/doc/zabbix-frontend-php/examples/apache.conf /etc/apache2/conf.d/zabbix.conf
Ensure that the “alias” mod is enabled within Apache:

sudo a2enmod alias
Restart Apache to use the copied configuration file:

sudo service apache2 restart
Edit the Zabbix init file to ensure that it performs the correct action:

sudo nano /etc/default/zabbix-server
Go to the bottom and adjust the “START” property to read “yes”:

START=yes
Save and close the file. We can now start Zabbix:

sudo service zabbix-server start
Installing and Configuring Zabbix Agent
Next, we need to configure the agent software that reports to the Zabbix server. We will install the agent software on our server machine and an additional client machine.

Follow these steps on both machines. Adjust the commands to reflect the correct information.

First, install the agent software:

sudo apt-get update
sudo apt-get install zabbix-agent
Next, we need to update the configuration files:

sudo nano /etc/zabbix/zabbix_agentd.conf
Edit the “Server” property to reflect the IP Address of the Zabbix server. For the agent configuration on the Zabbix server, you can use “127.0.0.1”:

Server=Zabbix.Server.IP.Address
Adjust the “Hostname” property to reflect the hostname of the machine being monitored.

Hostname=Hostname_Of_Current_Machine
Save and close the file.

Restart the agent software:

sudo service zabbix-agent restart
Logging In for the First Time
In your web browser, navigate to your Zabbix server’s IP address followed by “/zabbix”:

Your.Zabbix.IP.Address/zabbix
You will be presented with a login screen. The default credentials are as follows:

Username = admin
Password = zabbix

How can I setup a remote connection to MySQL? — 2013