Installing LAMP

Hello guys this blog is to about installing LAMP (Linux,Apache2,MYSQL,PHP)

Make sure you have already installed Ubuntu server edition and that you have root access to it. If you do, run the commands below to update your systems.

sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove

2.Simply you have to install LAMP(Linux Apache MySql PHP).Now lets install apache.

sudo apt-get install apache2

3.Now try to restart it.

sudo service apache2 restart

4.Go to your browser check you have successfully installed it or not.

localhost/

If you have..then next

5.Installing mysql

sudo apt-get install mysql-server mysql-client

6.It will prompt for window for password..set your mysql password.

7.then try to start and enable it.

sudo systemctl start mysql
sudo systemctl restart mysql
sudo systemctl enable mysql

8.Securing your installation.

sudo mysql_secure_installation

will ask..password..then several questions answer them in following type.

Change the root password? N
Remove anonymous users? Y
Disallow root login remotely? Y
Remove test database and access to it? Y
Reload privilege tables now? Y

9.Go to mysql.

mysql -u root -p

will prompt  Enter password:

then enter the password which you were set.

10.Installing PHP.and additional software which will require in further steps.

 sudo apt-get install php5 libapache2-mod-php5 php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-sqlite php5-tidy php5-xmlrpc php5-xsl

11.Now the /var/www/html directory is your root directory for entering files which you want to access from browser.

Thank You!!!

 

Resetting the mysql root password.

If you don’t remember password for your root mysql.Here are the few steps.

Step 1 : Enter the query in terminal

sudo etc/init.d/mysql stop

it will stop your mysql server.

Step 2:

sudo mysqld –skip-grant-tables &

will skip the autherized tables(tables which were invoking for password confirmation).

Step 3:

Try for login in your mysql again.

sudo mysql -u root

Now reset the password using

SET PASSWORD ‘root’@’localhost’ NEWPASSWORD

Thank You!!

If you face any problem please do contact.

Install WordPress.

 If you want to install wordpress on your server please follow the following steps.

1.Make sure you have already installed Ubuntu server edition and that you have root access to it. If you do, run the commands below to update your systems.

sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove

2.Simply you have to install LAMP(Linux Apache MySql PHP).Now install apache.If you have already installed lamp then skip this part(Go to step 9).

sudo apt-get install apache2

3.Now try to restart it.

sudo service apache2 restart

4.Go to your browser check you have successfully installed it or not.

localhost/

If you have..then next

5.Installing mysql

sudo apt-get install mysql-server mysql-client

6.It will prompt for window for password..set your mysql password.

7.then try to start and enable it.

sudo systemctl start mysql
sudo systemctl restart mysql
sudo systemctl enable mysql

8.Securing your installation.

sudo mysql_secure_installation

will ask..password..then several questions answer them in following type.

Change the root password? N
Remove anonymous users? Y
Disallow root login remotely? Y
Remove test database and access to it? Y
Reload privilege tables now? Y

9.Go to mysql.

mysql -u root -p

10.Create database for WordPress.

CREATE database wordpress;

11.Create a new database user.

CREATE USER wordpressuser@localhost IDENTIFIED BY 'new_password_here';

you may want to change username and password.

12.Grant permissions to created user.

GRANT ALL ON wpdb.* to wordpressuser@localhost;

13.Run this.

FLUSH PRIVILEGES;

exit;

BYE.

14.Installing PHP.and additional software which will require in further steps.

 sudo apt-get install php5 libapache2-mod-php5 php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-sqlite php5-tidy php5-xmlrpc php5-xsl

15.Download a zip file of wordpress separately by link.

https://wordpress.org/download/

16.Remove the files in the folder /var/www/html if any.

17.Extract the wordpress zip file into /var/www/html or copy extracted file into this html directory.This html directory is similar to the directory in xampp(Windows) i.e, htdocs.

18.Go to browser

localhost/wordpress

  1. Select language Select db which we created.(wordpressuser,new_password) Give password.

20.Success.

Thank You.

How to Solve the error “Error while connecting to DB”?”

 One I was also as my schedule opening my WordPress CMS from localhost but it gave me error Error in establishing DB connection.This can be happen due to multiple use creation of databases of CMS system daily or altering of the database,non-mysql passwords.This can be solved easily.

Step 1:

Open terminal connect to your mysql database.If you haven’t installed LAMP please go through this.Installing LAMP

$ sudo mysql -u root -p

will prompt for mysql database password.Enter that password which you were entered during mysql database.If you forgot the password please refer this .Resetting the mysql root password.

Step 2:

Create a database for wordpress.

mysql> CREATE database wordpress;

Step 3:

Creating a new user for the databse.

mysql> CREATE USER “wordpressuser”@”localhost” IDENTIFIED BY “newpassword”;

Step 3:

Grant all privileges to created user database.

mysql>GRANT all privileges on wordpress .* TO “wordpressuser”@”localhost”  IDENTIFIED BY “newpassword”;

Step 4:

Once the new user has been created and privileges has been assigned to it, run the command FLUSH PRIVILEGES; to flush the old privileges and start using the new assigned ones.

mysql> FLUSH PRIVILEGES;

Step 5:

Exit the database.

mysql>quit

Step 6:

Now try installing wordpress again.localhost/path/to/wordpress.(wordopress directory path)

Thank You.

About PHP

Hey guys you have heard about PHP for many times from web developers,teachers,techs,persons belonging to geeky knowledge.What is PHP then?It is commonly known as Personal Home Page but now we didn’t call it we officially call it as Hypertext Preprocesser and its acronym as PHP.

It is server side scripting language used for handling back end of most of the websites.PHP helps in easily handling of the databases.That is,sorting options validating options rather to suffer from the page code php handels it in small. Also generally lets go deeper,PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly.  Also many versions of php are now available,lets talk about them,PHP/FI 2.0 is an early and no longer supported version of PHP. PHP 3 is the successor to PHP/FI 2.0 and is a lot nicer. PHP 5 is  generation of PHP, which uses the » Zend engine 2 which, among other things, offers many additional OOP features.  Now the current generation of php is PHP 7.Supporting all of the features of previous versions + OOPs.