Difference between revisions of "Wordpress Blog Site (Tool)"

From edegan.com
Jump to navigation Jump to search
Line 1: Line 1:
== Requirements ==
+
Log in to:
 +
http://www.mcnaircenter.org/blog/wp-admin/
 +
 
 +
==Install FTP server==
 +
 
 +
Log in and sudo su yourself, then:
 +
 
 +
apt-get install vsftpd
 +
 
 +
Man page for the vsftpd.conf file
  
== Design ==
+
http://vsftpd.beasts.org/vsftpd_conf.html
  
== Styling ==
+
Securing the FTP:
=== Header===
 
=== Sidebar ===
 
=== Image Uploads ===
 
=== Content ===
 
=== Footer ===
 
=== Blog Posts ===
 
====Titles====
 
==== Author Info ====
 
== Usability Features ==
 
===RSS===
 
===Subscription Rules===
 
  
== User Accounts ==
+
https://help.ubuntu.com/lts/serverguide/ftp-server.html
  
== Error Logs ==
+
==Configuration==
  
McNair Center Wordpress blog
+
Edit /etc/vsftpd.conf (note next restart will reflect changes in /etc/init)
  
Setup:
+
#add at tend of file:
Images:
+
listen_port=26
1. Wordpress currently looks for images in a completely different location than the one it is uploading to.
 
2. It also has trouble generating the three standard sizes - thumbnails, etc
 
  
Permissions:
+
'''Generate keys for our website''' with the following command:
  
 +
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/vsftpd.pem -out /etc/vsftpd.pem
  
Styling:
+
Country Name (2 letter code) [AU]:US
Child themes:
+
State or Province Name (full name) [Some-State]:Texas
*Usage of child themes when creating custom design with wordpress is recommended.
+
Locality Name (eg, city) []:Houston
*Steps to create:
+
Organization Name (eg, company) [Internet Widgits Pty Ltd]:McNair Center at Rice University's Baker Institute
**Create a folder in the var/lib/wordpress/wp-content/themes with the title of your choice
+
Organizational Unit Name (eg, section) []:
**Into the newly created folder, add the header.php, style.css and functions.php file from the parent theme's folder to the child theme
+
Common Name (e.g. server FQDN or YOUR name) []:McNair Center
**If the child files are blank, then all the parent theme's corresponding code is preserved.
+
Email Address []:admin@mcnaircenter.org
**Else, if any chunk of code is added to the child theme's file, the code overrides the code in the parent theme's code.
 
**The webkit modules that adjust the display for mobile interfaces are best not changed.
 
*Once the files are created, to the style.css, add the template section enclosed in '/* ' and '*/' from the parent's style.css file.
 
*Go to the Wordpress dashboard, login as admin, and add the theme to wordpress (button should appear on the UI, along with the child theme) in the themes section
 
  
Header
+
Edit /etc/vsftpd.conf again
1. Header functions changed:
 
* The default header that comes with the twentysixteen has the header set within the same margins that govern the body of the blog.
 
* We want for our header to stretch across the UI like a banner.
 
* To do so,
 
** I removed the header from the div classes from the header.php file.
 
** I added some div classes around the header so that we could style
 
  
Sidebar
+
#change the lines as follows:
1. Addition of text widgets
+
rsa_cert_file=/etc/vsftpd.pem
* We need some text + image based widgets added to the sidebar.
+
rsa_private_key_file=/etc/vsftpd.pem
* These can be added with basic html and css (inline) as a text widget to the sidebar.
+
write_enable=YES
* Fonts changed to :
+
chroot_local_user=YES
* border width reduced.
+
chroot_list_enable=YES
 +
chroot_list_file=/etc/vsftpd.chroot_list
 +
ssl_enable=YES
  
Custom menus
+
Edit  /etc/vsftpd.chroot_list to contain a list of usernames (e.g., ravali)
Custom menus can be created and registered. Steps:
+
1.
+
Restart the server
Footer
 
  
Helpful Links:
+
service vsftpd restart
  
 +
The FTP server should be accessible. Beware local packet shaping. Connect through mcnaircenter.org:26. Otherise have a check that the process is running and listening:
 +
ps -aux
 +
netstat -lnt
  
-------------------------------------------
+
Assuming all is good with the FTP server, we now need to update Wordpress.
-- Installing FTPS Server on Web Servers
 
-------------------------------------------
 
  
Objective: Install FTPS server on the web servers on port 26 - test server followed by the production server.
+
==Update Wordpress==
  
Steps Followed:
+
First make a copy of the wordpress folder and dbase
*
 
  
Helpful links:
+
  cp -R /var/lib/wordpress/ /var/lib/wordpress_bak
*
+
  mysqldump -u mcnair_wp -p wordpress > backup_12Aug2016.sql
 +
  (enter password for dbase found in wp-config.php)
  
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/vsftpd.pem -out /etc/vsftpd.pem
+
Change the permissions on every in the wordpress folder and make www-data its owner:
 +
chown -R www-data /var/lib/wordpress
 +
chmod -R 755 /var/lib/wordpress
  
rsa_cert_file=/etc/vsftpd.pem
+
Browse to 128.42.44.180/blog/wp-admin
rsa_private_key_file=/etc/vsftpd.pem
+
Click update now. Enter:
  
username: webadmin
+
Hostname 128.42.44.180:26
password: 9Million!
+
FTP Username ravali (or some other account)
 +
FTP Password
 +
Connection Type FTPS (SSL)
  
 +
Leave the Akismet plugin
 +
Go to appearance, themes -> add new
 +
Choose Accesspress Lite 2.46.7
 +
Activate
 +
Install all of the recommended pluggins that come with the theme
  
------- Aug 2nd -------------
+
Check the media library works by uploading a file (e.g., GreenRoundLogo.png)
  
''' Man page for the vsftpd.conf file '''
+
Create a child theme
http://vsftpd.beasts.org/vsftpd_conf.html
+
cd /var/lib/wordpress/wp-content/themes
 +
mkdir accesspress-lite-child
 +
vi accesspress-lite-child/style.css
 +
Add in the template from the parent folder's style.css (just the top of the file)
 +
Update the theme name and text domain to accesspress-lite-child.
 +
vi accesspress-lite-child/functions.php
 +
Add in the section that never changes
 +
 +
<?php
 +
function my_theme_enqueue_styles() {
 +
 +
    $parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
 +
 +
    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
 +
    wp_enqueue_style( 'child-style',
 +
        get_stylesheet_directory_uri() . '/style.css',
 +
        array( $parent_style ),
 +
        wp_get_theme()->get('Version')
 +
    );
 +
}
 +
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
 +
?>
  
Securing the FTP:
+
Check the permissions on the new files:
  https://help.ubuntu.com/lts/serverguide/ftp-server.html
+
  chown -R www-data /var/lib/wordpress
 +
chmod -R 755 /var/lib/wordpress
  
'''Customization:'''
+
Active the child theme!
''''Change the port:''''
+
Check out what it looks like: www.mcnaircenter.org/blog
Add line to /etc/vsftpd.conf:
 
listen_port=26
 
  
Restart the server with the command:
+
==Customize our theme==
sudo vsftpd restart
 
  
Check the installation by checking via a browser, the following address:
+
== Requirements ==
http://128.42.44.22:26
 
  
''''Add users''''
+
== Design ==
  
 +
== Styling ==
 +
=== Header===
 +
=== Sidebar ===
 +
=== Image Uploads ===
 +
=== Content ===
 +
=== Footer ===
 +
=== Blog Posts ===
 +
====Titles====
 +
==== Author Info ====
 +
== Usability Features ==
 +
===RSS===
 +
===Subscription Rules===
  
''''Generate keys for ou website''''
+
== User Accounts ==
Generate the key with the following command:
 
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/vsftpd.pem -out /etc/vsftpd.pem
 
  
Add\Update the following lines in the /etc/vsftpd.conf:
+
==Useful resources if there are errors==
rsa_cert_file=/etc/vsftpd.pem
 
rsa_private_key_file=/etc/vsftpd.pem
 
 
 
'''' Adding Users''''
 
 
 
FTP : Files not accessible:
 
Add the following to wp-config.php
 
if(is_admin()) {
 
add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
 
define( 'FS_CHMOD_DIR', 0751 );
 
}
 
 
--- Back Up:
 
 
Folders:
 
Copy created
 
Database:
 
mysqldump -u mcnair_wp -p wordpress > backup_3Aug2016.sql
 
 
-- Update:
 
 
https://codex.wordpress.org/Upgrading_WordPress_Extended#Step_9:_Run_the_WordPress_upgrade_program
 
 
Error Resolution:
 
https://wordpress.org/support/topic/wordpress-45-error-after-update
 
  
''''' in case of errors, try: '''''
+
Wordpress:
https://help.webcontrolcenter.com/kb/a992/vsftpd-ftp-server.aspx
+
*https://codex.wordpress.org/Upgrading_WordPress_Extended#Step_9:_Run_the_WordPress_upgrade_program
 +
*https://wordpress.org/support/topic/wordpress-45-error-after-update
 +
*https://help.webcontrolcenter.com/kb/a992/vsftpd-ftp-server.aspx
  
 
FTP Issues:
 
FTP Issues:
https://help.ubuntu.com/lts/serverguide/ftp-server.html
+
*https://help.ubuntu.com/lts/serverguide/ftp-server.html
 
+
*http://askubuntu.com/questions/666858/vsftpd-service-will-not-start-for-14-04
http://askubuntu.com/questions/666858/vsftpd-service-will-not-start-for-14-04
 

Revision as of 15:51, 12 August 2016

Log in to: http://www.mcnaircenter.org/blog/wp-admin/

Install FTP server

Log in and sudo su yourself, then:

apt-get install vsftpd

Man page for the vsftpd.conf file

http://vsftpd.beasts.org/vsftpd_conf.html

Securing the FTP:

https://help.ubuntu.com/lts/serverguide/ftp-server.html

Configuration

Edit /etc/vsftpd.conf (note next restart will reflect changes in /etc/init)

#add at tend of file:
listen_port=26

Generate keys for our website with the following command:

openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/vsftpd.pem -out /etc/vsftpd.pem
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:Texas
Locality Name (eg, city) []:Houston
Organization Name (eg, company) [Internet Widgits Pty Ltd]:McNair Center at Rice University's Baker Institute
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:McNair Center
Email Address []:admin@mcnaircenter.org

Edit /etc/vsftpd.conf again

#change the lines as follows:
rsa_cert_file=/etc/vsftpd.pem
rsa_private_key_file=/etc/vsftpd.pem
write_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
ssl_enable=YES

Edit /etc/vsftpd.chroot_list to contain a list of usernames (e.g., ravali)

Restart the server

service vsftpd restart

The FTP server should be accessible. Beware local packet shaping. Connect through mcnaircenter.org:26. Otherise have a check that the process is running and listening:

ps -aux
netstat -lnt

Assuming all is good with the FTP server, we now need to update Wordpress.

Update Wordpress

First make a copy of the wordpress folder and dbase

 cp -R /var/lib/wordpress/ /var/lib/wordpress_bak
 mysqldump -u mcnair_wp -p wordpress > backup_12Aug2016.sql
 (enter password for dbase found in wp-config.php)

Change the permissions on every in the wordpress folder and make www-data its owner:

chown -R www-data /var/lib/wordpress
chmod -R 755 /var/lib/wordpress

Browse to 128.42.44.180/blog/wp-admin Click update now. Enter:

Hostname 128.42.44.180:26
FTP Username ravali (or some other account)
FTP Password 
Connection Type FTPS (SSL)

Leave the Akismet plugin Go to appearance, themes -> add new

Choose Accesspress Lite 2.46.7
Activate

Install all of the recommended pluggins that come with the theme

Check the media library works by uploading a file (e.g., GreenRoundLogo.png)

Create a child theme

cd /var/lib/wordpress/wp-content/themes
mkdir accesspress-lite-child
vi accesspress-lite-child/style.css 
	Add in the template from the parent folder's style.css (just the top of the file)
	Update the theme name and text domain to accesspress-lite-child.
vi accesspress-lite-child/functions.php
	Add in the section that never changes
	
<?php
function my_theme_enqueue_styles() {

    $parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style ),
        wp_get_theme()->get('Version')
    );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
?>

Check the permissions on the new files:

chown -R www-data /var/lib/wordpress
chmod -R 755 /var/lib/wordpress

Active the child theme! Check out what it looks like: www.mcnaircenter.org/blog

Customize our theme

Requirements

Design

Styling

Header

Sidebar

Image Uploads

Content

Footer

Blog Posts

Titles

Author Info

Usability Features

RSS

Subscription Rules

User Accounts

Useful resources if there are errors

Wordpress:

FTP Issues: