2014년 11월 3일 월요일

Install and Configure WordPress in CubieTruck


Source URL


What is WordPress


WordPress is web software you can user to create a beautiful website or blog. We like to say that WordPress is both free and priceless at the same time. The core software is built by hundresg of community volunteers, and when you're ready for more there are thousands of pulugins and themes available to transform your site into almost anything you can imagin.

Step 1: Download and Extract WordPress


Replace example with what ever directly name you want
sudo mkdir example
cd ~/SSD/WordPress/
wget http://wordpress.org/latest.tar.gz
sudo tar -xzvf latest.tar.gz

Step 2: Create the Database and User


Login to phpmyadmin interface with your username and password. (This is the same password that you created during the MySQL installation)

1414904493210

Now nagifate to the database section and create a database named "wordpress", Type wordpress in the Create new database filed and user the default collation option and click create.

1414904606478

Now you will have a database created with a name wordpress. Just click the check Users next to the Status. In the next page, click Add a new User as shown below.

1414904779034

Now enter "wordpress" as the username, select local in the host drop down box and enter a strong password. Just select the Grant option under Administration tab checked and click Go.

1414904969511

Step 3: Set up wp-config.php


Return to where you extracted the WordPress package in Step 1, copy the file wp-config-sample.php to wp-config.php, and open it in a text editor.
cd ~/SSD/WordPress/wordpress
sudo cp wp-config-sample.php wp-config.php
sudo vi wp-config.php

Under MySQL settings change the below fields to appropriate ones that you created in step 2.
// *** MySQL settings - You can get this info from your web host ** ///** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wordpress');

/** MySQL database password */
define('DB_PASSWORD', 'YOUR_PASSWORD');

Save and close the file

Step 4: Changing the Access Privileges


Now in order for wordpress to access the files that are in the webserver, we need to provide proper access permissions to the wordpress folder. Be default nginx web server work with www-data user. So we need to provide full access permissions to www-data user for the wordpress folder.
sudo chown -R www-data:www-data ~/SSD/WordPress/wordpress/

Step 5: Changing the nginx Config file


Now we are almost done with installing wordpress. One last thing to do before we move on to the wordpress interface is, changing the nginx server block, to work with wordpress. It is rather easy.
Just copy the same "mysite" file and modify it like the below one else just use the below one and modify it according to your requirement.
cd /etc/nginx/sites-available
sudo cp mysite home
sudo vi home

and put the below contents
server{
listen 80;
server_name home;

access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;

root ~/SSD/WordPress/wordpress;
index index.php;

location / {
try_files $uri $uri/ /index.php?$args;
}

location ~ .php$ {
try_files $uri =404;

fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}

save and close the file.

Now we need to unlink previous mysite file and link home file to the site-enabled folder.
sudo unling /etc/nginx/sites-enabled/mysite
sudo ln -s /etc/nginx/sites-available/home /etc/nginx/sites-enabled/home

Restarting nginx
sudo service nginx restart

Step 6: Logging into WordPress


Now head on to your favorite browser and type your_ip. You can see the page similar to the one below.

1414917531952

 

Enter a title for your webpage in the Site Title Field.
Enter username and password in their corresponding field.
Enter your email id and hit install WordPress.

After this you can login to your WordPress Dashboard with the username and password that you have create now.

1414917621727

Now you have installed full fledged WordPress.

Congraturations!


 

[contact-form-7 id="24" title="Karl"]

댓글 없음:

댓글 쓰기