RSS

How To Setup WordPress In CENTOS 6.X

How To Setup WordPress In CENTOS 6.X

There are many “how to’s” out there for setting up WordPress on your own CentOS server.  I will throw mine into the fray.  When I was researching on how to do this, I had to go through many websites to understand the nuances of WordPress, its dependencies, CentOS and other Linux Distro and how they relate to each other.  From the ashes, I have created what I hope is a comprehensive, secure yet simple set-up that most anyone can understand.  When following along, please be aware of the directory location that I’m working in (blue text).  Also you have to be root (type su, enter, then your root password) for this.  This is based on the LAMP model.  The “L” or Linux is your CentOS and “AMP” (Apache MySQL PHP) is installed at STEP 1.

Here we go…

STEP 1:  Prep your CentOS server for WordPress by installing, MySQL, PHP, PHP-MySQL and Apache

  • [root@linuxbox ~]# yum update
  • [root@linuxbox ~]#  yum install mysql-server httpd php php-mysql

STEP 2:  Have MySQL automatically start up each time your CentOS reboots

  • [root@linuxbox ~]# chkconfig –levels 235 mysqld on

STEP 3: Start MySQL for the first time

  • [root@linuxbox ~]# /etc/init.d/mysqld start

STEP 4: Have httpd (Apache server) start each time your CentOS server reboots.

  • [root@linuxbox ~]# chkconfig –levels 235 httpd on

STEP 5: Start your Apache server for the first time

  • [root@linuxbox ~]# /etc/init.d/httpd start

*Alternatively, following commands will also start and stop MySQL and Apache:
# service mysqld start
# service httpd start

~~~~NOW WE ARE GOING TO SECURE MySQL~~~~~

  • [root@linuxbox ~]# mysql_secure_installation
    In order to log into MySQL to secure it, we’ll need the current
    password for the root user.  If you’ve just installed MySQL, and
    you haven’t set the root password yet, the password will be blank,
    so you should just press enter here.

    Enter current password for root (enter for none):    ←————- Just press “enter” key

    STEP 2:
    Set root password? [Y/n]   ←——————————————–Just press “enter” key for yes

    STEP 3:
    New password:    ←——————————————————Create a  password

    Re-enter new password:    ←——————————————–Re-enter your password

    Password updated successfully!
    Reloading privilege tables..
    … Success!

    STEP 4:
    By default, a MySQL installation has an anonymous user, allowing anyone
    to log into MySQL without having to have a user account created for
    them.  This is intended only for testing, and to make the installation
    go a bit smoother.  You should remove them before moving into a
    production environment.

    Remove anonymous users? [Y/n]   ←——————————Press “enter” key for yes
    then following message appears…

    … Success!

    Step 5:

    Normally, root should only be allowed to connect from ‘localhost’.  This
    ensures that someone cannot guess at the root password from the network.

    Disallow root login remotely? [Y/n]     ←——————————-Press “enter” key for yes.

    STEP 6:

    By default, MySQL comes with a database named ‘test’ that anyone can
    access.  This is also intended only for testing, and should be removed
    before moving into a production environment.

    Remove test database and access to it? [Y/n]   ←————-Press “enter” key for yes.

    … Success!

    STEP 7:

    Reloading the privilege tables will ensure that all changes made so far
    will take effect immediately.

    Reload privilege tables now? [Y/n]     ←—————————Press “enter” key

    /usr/bin/mysql_secure_installation: line 58: .mysql.4122: Read-only file system
    … Success!

    Cleaning up…
    All done!  If you’ve completed all of the above steps, your MySQL
    installation should now be secure.

    Thanks for using MySQL!

    [root@linuxbox ~]#

    Securing of MySQL from hackers has been completed!

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Now We Are Going To Create WordPress Database In MySQL

STEP: 1   Log in to MySQL by issuing the following command below:

[root@linuxbox ~]# mysql -u root -p

    • Enter password:     ←———————————Enter MySQL password that you created from STEP: 3 (above).
    • STEP 2:
      mysql> CREATE DATABASE wordpress;
    • Query OK, 1 row affected (0.00 sec)
    • STEP 3:
      mysql> CREATE USER billybass@localhost;
    • Query OK, 0 rows affected (0.00 sec)
    • STEP 4:
      mysql> SET PASSWORD FOR billybass@localhost= PASSWORD(“yourpassword”);
    • Query OK, 0 rows affected (0.00 sec)
    • STEP 5:
      mysql> GRANT ALL PRIVILEGES ON wordpress.* TO billybass@localhost IDENTIFIED BY ‘yourpassword’;
    • Query OK, 0 rows affected (0.00 sec)
    • STEP 6:
      mysql> FLUSH PRIVILEGES;
    • Query OK, 0 rows affected (0.00 sec)STEP 7:
      mysql> exit

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Now We Are Going To Download/Install/Configure WordPress Program

    • STEP 2:  [root@linuxbox html]# tar -zxvf latest.tar.gz
    • STEP 3:  [root@linuxbox html]# mv wordpress/* /var/www/html
    • STEP 4:  [root@linuxbox html]# cp wp-config-sample.php wp-config.php
    • STEP 5: [root@linuxbox html]# nano wp-config.php 
       
    • STEP 6: Previous command (step 5) opened wp-config.php file for editing.
      Find and edit the following within this file: database name, username and password created from previous step when you created account for MySQL:
      define(‘DB_NAME’, ‘wordpress‘);
      define(‘DB_USER’, ‘billybass‘);
      define(‘DB_PASSWORD’, ‘yourpassword‘);
    • wp-config
    • STEP 7:  With wp-config.php file still open from STEP 6:
      go to, https://api.wordpress.org/secret-key/1.1/salt/ and obtain, “Authentication Unique Keys and Salts” (each time you visit this site, it generates different Keys and Salts.)  Then copy and replace it with existing keys within this wp-config file (towards the bottom).Then save the newly edited, wp-config file.  If you are using nano text editor, save by doing following 3 steps:

      1. hold down ctrl + X key
      2. type letter Y
      3. Then press “enter” key
    • STEP 8:  [root@linuxbox html]# rmdir wordpress/
    • STEP 9:  [root@linuxbox html]# mkdir wp-content/uploads wp-content/cache
    • STEP 10: [root@linuxbox html]# chown -R apache:apache wp-content/uploads wp-content/cache ./
    • STEP 11: Configure wp-content
      From browser, type “localhost” OR server’s IP address and it will load the page like one shown below.
    • Outcome… 1
    • Login 2

 
Leave a comment

Posted by on February 12, 2013 in Uncategorized

 

Tags: , , , , , , , , , , , , ,

2012 in review

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

600 people reached the top of Mt. Everest in 2012. This blog got about 6,100 views in 2012. If every person who reached the top of Mt. Everest viewed this blog, it would have taken 10 years to get that many views.

Click here to see the complete report.

 
Leave a comment

Posted by on January 4, 2013 in Uncategorized

 

How To Install VMware Tools On CentOS From Terminal

So you got the CentOS virtual machine running on VMware Player.  But virtual machine desktop is not using up your whole screen/monitor (below).  This is because you have to install additional software to make it happen. Steps below will resolve this issue.

1 2 3 4 5 6 7 8

 
Leave a comment

Posted by on December 10, 2012 in Uncategorized

 

Tags: , , , , , , , , , , , , , , , , ,

How to install VMware tools onto a Debian/Ubuntu based Linux systems

So you got the Linux virtual machine running on VMware Player.  But virtual machine desktop is not using up your whole screen/monitor (below).  This is because you have to install additional software to make it happen. Steps below will resolve this issue.
step0 step1 step2 step3 step4 step5 step6 step7 step8 step9

 
Leave a comment

Posted by on December 6, 2012 in Uncategorized

 

Tags: , , , , , , , , , , , , , , , ,

How To VNC To A Raspberry Pi Or Any Linux (how to configure VNC on linux machine remotely)

rasp

Raspberry Pi is a $25 credit card size SoC computer. It’s shipped with no VGA port (just HDMI and RCA video port). Since I didn’t have a monitor with HDMI or RCA video port and didn’t want to pay, then wait for a converter to be shipped to me, I configured a VNC connection to my Raspberry Pi remotely. Steps as follow:

Steps 1-6 will prepare you to connect to your Raspberry Pi via SSH connection.
Steps 7-8 will install and configure VNC so that you can view Raspberry Pi’s desktop.

  1. Physically connect Raspberry Pi to power outlet and router/modem
  2. Determine the ip address of the Raspberry Pi by downloading a free phone app called “Fing”.
  3. From a client computer (the computer that will remote to Raspberry Pi), download and install a VNC client called, “TightVNC” from the following link, http://www.tightvnc.com/download.php   <—For Windows environment, Most Linux distros have a VNC viewer pre-installed.
  4. From a client computer (the computer that will remote to the Raspberry Pi) If you’re on Windows environment (XP, 7, etc) download an SSH program called PuTTY to the client computer (Linux folks should already have SSH program pre-installed).http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe (Obtained from PuTTY.org).
  5. Start up PuTTY
  6. *From PuTTY, enter your Raspberry Pi’s IP address that was obtained from step #2 onto the “Host Name” section and “Port” should be 22.
  7. Then press “Open” button and if all goes well, you should be connected to your Raspberry Pi via SSH connection. Obviously, this is a tutorial for VNC connection so from this point, we will be setting up a VNC connection so that we can view the Raspberry Pi’s desktop environment (GUI).

*Default hostname for all Raspberry Pi is “raspberrypi” you can try to enter the hostname instead of IP for step #5 but sometime it takes awhile for network to resolve a hostname to IP.

8. Once connected to Raspberry Pi via SHH, run the following 3 commands within connected SSH session terminal:

sudo apt-get update ←—————–Updates Raspberry Pi
sudo apt-get install tightvncserver ←–Installs tightvncserver on Raspberry Pi
/usr/bin/tightvncserver ←——————Starts tightvncserver on Raspberry Pi   <–STARTS TIGHTVNCSERVER


At this point tightvncserver has been installed and been manually started; you can essentially use the “tightvnc” viewer that was installed on the
client pc (from step #3) to remote to your Raspberry Pi’s desktop environment. Do this by opening up TightVNC client and enter the following in the “Remote Host” box, raspberrypi:1 OR 192.168.xxx.xxx:1 (your PI’s IP address) to connect to and view your Raspberry Pi’s desktop.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The following step (step #9) will get the TightVNC Server automatically start up if you happened to reboot or power off your Raspberry Pi; versus issuing the following command, /usr/bin/tightvncserver each time to start it.

9. For getting TightVNC Server to automatically start-up at system reboot or power up, please go to the following link, http://penguintutor.com/linux/tightvnc and go to the section titled, “Adding TightVNC to startup”. This site owner has created a great program that you will need to cut and paste to a text editor like (Nano). If I recall, I don’t believe Nano is installed on Raspberry Pi; you will have to install by issuing the following command from your Raspberry Pi’s terminal, sudo apt-get install nano otherwise, use your favorite editor to do this.

 
Leave a comment

Posted by on December 4, 2012 in Uncategorized

 

Tags: , , , , , , , , , , , , , , ,

How to Setup Asus USB N10 Wifi Adapter On Raspberry Pi

BEFORE WE BEGIN:

  • With Linux, there are a million ways to skin a cat.  What I’m showing is the one that worked for me.
  • I used Wheezy-Raspian (2012-09-18) image.  This version already has the necessary driver/module pre-installed.  You can confirm by issuing the following command: lsmod | grep r8712u  output should be something like this:  r8712u 165407 0
  • We will be editing 2 files to make it work (interfaces & wpa_supplicant.conf).
  • I used PuTTY to SSH to my Raspberry Pi to do my configurations, so that’s why it does not look like the LXTerminal ( all images below).

Step #1: From the SSH session, issue the following command to edit the network interface file of the Wheezy-Raspian OS:

sudo nano /etc/network/interfaces

Then append the following configuration as seen in image below:

After appending the new configuration, press the following keys in this order to save configuration:

ctrl + x (at above screen)

Then, Y (at above screen)

Finally, enter key (at above screen)

Step #2:

From the SSH session terminal, issue the following command to edit wpa_supplicant.conf file

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Then appended the configuration (as seen on image below):

Repeat the step previously mentioned to save the configuration.  Reboot your Raspberry Pi to complete the step and then test out your newly configured WiFi.  USB WiFi dongle should be continuously blinking, this means configuration was setup successfully.  DONE!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

FYI:

ssid:   your wifi name

scan_ssid:   value of 1 means broadcast and value of 2 means hidden (suggest you enter value of 1)

psk:   your wifi password

proto:   your choice of RSN or WPA. RSN is WP2 and WPA is WPA1. (most config is RSN)

key_mgmt:   your choice of WPA-PSK or WPA-EAP (pre-shared or enterprise respectively)

pairwise:   your choice of CCMP or TKIP ( WPA2 or WPA1 respectively)

auth_alg:   OPEN option is required for WPA and WPA2 (other option, SHARED & LEAP)

 
2 Comments

Posted by on October 5, 2012 in Uncategorized

 

Tags: , , , , , , , , , , , , , , ,

How To Install FileZilla On CentOS-6

~~~~~UPDATED 1/14/13.  CENTOS VERSION 6.4 install by simply running, yum install filezilla.  VERSION 6.3 install by following steps below:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

jmro thank you! I tested it on my virtual and it worked! I’ll have to update this blog when I get the chance. Following is steps for future visitors:

Step 1: Install EPEL repo by going to this site and click on, “epel-release-6-8.noarch” link to open and install package, http://fedora.mirrors.pair.com/epel/6/i386/repoview/epel-release.html

Step 2: yum install filezilla

Filezilla should now be installed.  Go to CentOS menu bar and go to Applications > Internet, to run Filezilla.

Thanks again.

~~~~~~~~~~~~~~~~~~~~BELOW STEP IS THE OLD WAY~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1.  Go to http://nchc.dl.sourceforge.net/project/filezilla/FileZilla_Client and find the latest Filezilla client.  At the time of my entry it was FileZilla_3.5.3.

2. Then run the rest of the steps in Linux Terminal:

3. wget http://nchc.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.5.3/FileZilla_3.5.3_i586-linux-gnu.tar.bz2

(below) Will need to be run from the Terminal, Step 4 will uncompress the tar.bz2 file. Step 5 is to change to directory where uncompressed file is located. and finally, step 6 will compile the file into a workable program.

4.  tar -jxvf FileZilla_3.5.3_i586-linux-gnu.tar.bz2

5.  cd FileZilla3/bin

6.  ./filezilla

 
9 Comments

Posted by on July 22, 2012 in Uncategorized

 

Tags: , , , , , , , ,

 
Follow

Get every new post delivered to your Inbox.