Ubuntu 16.04 Fixing no copy and paste into Remmina RDP Client

On my Ubuntu 16.04 machine, I had an annoying problem with my Remmina RDP client in that I was not able to paste inside the RDP session from the local host. After a little searching I was able to find the solution on the HERE

The solution that worked for me was to install the newest version of Remmina using the following command:

# sudo apt-add-repository ppa:remmina-ppa-team/remmina-next ; sudo apt-get update ; sudo apt-get install remmina remmina-plugin-rdp

Once I had closed and opened Remmina I was able to paste into the RDP client.

For more Ubuntu articles as how too’s click on our Ubuntu Category.

How To Troubleshoot and Fix WordPress 404 Errors (Plus an Essential Tip on Redirects)

Had a problem on a client´s Ubuntu 14.04 wordpress server. I used THIS site to fix the problem:

How To Troubleshoot and Fix WordPress 404 Errors (Plus an Essential Tip on Redirects)

A 404 error is generated by your server when a requested URL is not found.
This post will help you decide if action needs to be taken and what action you should take.

When to redirect

Most people’s first instinct upon seeing a 404 error is to consider a redirect. Hold on!
Redirecting any and all 404 errors can actually be bad for your search engine results. Via Google Webmaster Tools:
Returning a code other than 404 or 410 for a non-existent page (or redirecting users to another page, such as the homepage, instead of returning a 404) can be problematic. Firstly, a page like this (called a “soft” 404) tells search engines that there’s a real page at that URL. As a result, that URL may be crawled and its content indexed. Because of the time Googlebot spends on non-existent pages, your unique URLs may not be discovered as quickly or visited as frequently and your site’s crawl coverage may be impacted (also, you probably don’t want your site to rank well for the search query [File not found]).
The first thing to ask yourself is: did this content ever exist?
If it did, and you have changed your domain or URL structure, you will want to implement redirect(s) to send users and search engines to the right place.
If it never existed, don’t sweat it. As mentioned above “Redirecting any and all 404 errors can actually be bad for your search engine results.”

Troubleshooting

WordPress sites can complicate the 404 troubleshooting process. Why? WordPress is a content management system that processes its own internal rewrite array as a part of its permalinks feature.
The first step to troubleshooting 404s is to figure out whether the 404 is being caused by the web server or by WordPress.

Static file

If your file is static (e.g. a jpg image) open your FTP client and verify that the file exists.
As an example, let’s say that the URL http://mydomain.com/wp-content/uploads/picture.jpg is producing a 404 error. You will want to:
  • Open FTP Client and connect to your server (if you don’t know how to do so,read this.)
  • Navigate to the file’s location
  • Verify that the file exists
  • If it is does not exist, you have found the source of your 404.
However, it it does exist, yet pulling the URL up in a browser results in a 404 error, continue on to find out whether the issue is web server-based or WordPress-based.
In FTP create two files at the root  [/var/www/yourdomain.com/] for testing purposes.
First: Create an html file named test.html that has the words “It worked” in it. (Download this file here.)
After uploading it, head over to: http://yourdomain.com/test.html
If you see “It worked,” the server is processing static files correctly, so your issue is likely in WordPress.
Second: Create a PHP file named test.php (or download here) that includes the following:
<?php echo 'It works in PHP'; ?>
After uploading, head over to http://yourdomain.com/test.php. If it says “It works in PHP,” then PHP is functioning properly as well, so again your problem is likely in WordPress.
(Quick side note: make your mama proud by removing these files when you are done testing!)

Fixing 404s in WordPress

WordPress creates a rewrite array that is responsible for managing permalinks, or “pretty URLs.”
Improperly coded plugins, custom post types, and taxonomy alterations can break or corrupt the permalink array, thus causing 404s.

Quick fix: re-save permalinks

You can reset the permalink array by going to the permalinks tab in wp-admin and simply re-saving the permalink structure.
  • Navigate to: WordPress Dashboard → Settings → Permalinks: Click “Save Changes”
Test your URL. If the 404 goes away, something caused an issue with your permalink structure and this fixed it.
Often the quick fix is enough to correct your 404 issues. However, should they come back, go on to the next troubleshooting step.

Find the cause

If the quick fix did not work or you are seeing 404s again, try disabling plugins that handle redirection or create customized permalinks. Did that solve it?
Next, use a debugger to view the rewrite array and confirm that the rewrite rule responsible for processing your URL is not in place. To do this, install the pluginDebug This, which makes it easy to view what is actually in the WordPress rewrite array.
Once this plugin is installed and activated, go to your site. Then navigate to:
  • Homepage → Admin Bar → Debug This → Query → Rewrites.
You should end up on a screen that contains rewrite rules on the left hand side and the actual PHP string being rewritten on the right hand side. So what do you do with this information?
Let’s say we have a broken author feed (example: https://www.copyblogger.com/author/jerodmorris/feed/). To troubleshoot the broken feed, look for the word “author.” Eventually this rule is found: author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$
If you don’t find the rule, this is the source of your issue. WordPress will not process the request unless it knows what it is doing.
The actual PHP URL string that WordPress uses for this author feed is: http://copyblogger.com/index.php?author_name=jerodmorris&feed=rss. If this long PHP URL does not work, you have another problem with your site.
You will now want to start by deactivating plugins one by one to see if you can find the conflicting PHP responsible for the issue.
***
And, of course, if you go through all of these steps are still unable to fix the issue, submit a Help Desk ticket.
If you have to submit a ticket, take note: it is very important that you let us know the exact URLs that are giving unwanted or unexpected 404 errors, and that you walk us through the troubleshooting steps you have already completed. Then we can add some next-level troubleshooting and insight to get your problem solved.

How to Solve WordPress Could Not Create Directory

Had a problem with a clients wordpress ubuntu 14.04 server and fixed the problem using THIS site:

How to Solve WordPress Could Not Create Directory

/08 Useful Tips /How to Solve WordPress Could Not Create Directory
If you’re trying to upgrade WordPress or install a plugin and getting the “could not create directory” error, there are two levels required to solving it.
Here’s an example of the error sequence:
Downloading update from http://downloads.wordpress.org/plugin/your-plugin.0.9.3.1.zip…
Unpacking the update…
Could not create directory. /wp-content/upgrade/yourplugin.tmp
Return to Plugins page
1. Web Server Ownership
The first level is actually to make sure that your web server has ownership over the directories:
chown -R www-data:www-data your-wordpress-directory
2. Directory Permissions
The second level is also required – you must make sure that the directory permissions are properly set:
sudo find /var/www/wordpress/ -type d -exec chmod 755 {} ;
sudo find /var/www/wordpress/ -type f -exec chmod 644 {} ;
I’ve found that most solutions posted on the web show part two but skip the first part.



Source: http://publishingwithwordpress.com/how-to-solve-wordpress-could-not-create-directory/#ixzz3sPmvucJQ 
Follow us: @pubwp on Twitter

Installing osTicket on Ubuntu 14.04

I had to install osTicket on a clients Ubuntu server this moring. The install was really simple and I was up an running within 10 minutes. I used THIS site for instalation instructions.

Install osTicket on Ubuntu 14.04 64 VPS

 Posted to: InstructionsVideosUbuntu by HostingInstructions
Support Your clients by Web or Email with osTicket.
If your business has a need to automate support or customer interaction and track service levels, osTicket is a free, open source tool, that meets and exceeds expectations.
Businesses at every level of growth can benefit from osTicket’s system. Best of all, it’s the client that benefits the most from service imporovements.


For the instructions to work, you will need to have LAMP (Linux, Apache, MySQL or MariaDB and PHP) already installed on your VPS. Our instructions for installing LAMP on Ubunutu 14.04 can be found here.
The instructions are tried and true, and were verified on InterServer`s OpenVZ VPS Hostingservice, utilizing Ubuntu 14.04 64 minimal.
You should be able to copy and paste into SSH as you go along.
Requirements:
  • LAMP installed. See our instructions.
  • Setup was conducted on InterServer’s OpenVZ VPS Hostingwith Ubuntu 14.4 64-bit (instructions are for minimal distribution, but should work for regular distribution as well).
  • Putty or similar SSH client
  • root login and password or an account capable of sudo
Installation
Start by updating package sources:
  • sudo apt-get update
Now will install unzip, since our file is in zip format:
  • sudo apt-get install zip unzip
Create a database for osTicket in mySQL:
  • sudo mysql -u root -p
You will need to copy and paste each line. Change the highlightedvalues to values you want (most important are user and password).
  • CREATE DATABASEostdb;
  • CREATE USERosticket_user@localhost IDENTIFIED BY 'password';
  • GRANT ALL PRIVILEGES ONostdb.* TOosticket_user@localhost;
  • FLUSH PRIVILEGES;
  • exit
Write down the values you entered, because we will need to use the to configure osTicket later.
First will go to our home directory:
  • cd ~
Make a directory and move to it:
  • sudo mkdir osticket
  • cd osticket
Now, download osTicket:
  • sudo wget http://osticket.com/sites/default/files/download/osTicket-v1.9.11.zip
Unzip it:
  • sudo unzip osTicket-v1.9.11.zip -d ~/osticket
The zip file will extract two directories. Scripts and Upload. Make a directory on /var/www/html where our installation will reside:
  • sudo mkdir /var/www/html/support/
Move the upload to our newly created web directory:
  • sudo cp -rv ~/osticket/upload/* /var/www/html/support/
Copy the configuration file:
  • cp /var/www/html/support/include/ost-sampleconfig.php /var/www/html/support/include/ost-config.php
Give Apache ownership of this new directory:
  • sudo chown -R www-data:www-data /var/www/html/support/
PHP
(Optional) osTicket has the ability to fetch emails and turn them into tickets. If this is not one of your requirements, you may skip this step. Otherwise, in order to use the email feature, we need to install a PHP module, php5-imap:
  • sudo apt-get install php5-imap
Now link the module:
  • sudo php5enmod imap
Restart Apache:
  • sudo service apache2 restart
Side Note: The three commands above are the way to correct the “IMAP doesn’t exist. PHP must be compiled with IMAP enabled.” error on the osTicket installer, after you have installed php5-imap.
Install and Configure from Browser
Open your browser and visit (replace with domain name or ip):
  • yourdomain.com/support/
Remember to populate the database fields with the variables you used when you created the database. Leave the table prefix and the server name with the defaults, unless you know you want to specify something else.
Your osTicket system is now available on:
Support Center:
yourdomain.com/support/
Staff control panel:
yourdomain.com/support/scp
Clean up
Change permissions on ost-config.php:
  • chmod 0644 /var/www/html/support/include/ost-config.php
Delete the setup directory:
  • rm -rf /var/www/html/support/setup
Remove our installation files:
  • rm -rf ~/osticket
Customizing osTicket
osTicket can be configured to suit just about any support center need. Please visit the wiki for documentation.

Installing WordPress on Ubuntu 14.04 server

I had to install a wordpress server for a client today. I used the instructions from THIS site.

How To Install WordPress on Ubuntu 14.04

Apr 24, 2014 WordPress Ubuntu

Introduction

At this time, WordPress is the most popular CMS (content management system) on the internet. It allows you to easily set up flexible blogs and websites on top of a MySQL backend with PHP processing. WordPress has seen incredible adoption and is a great choice for getting a website up and running quickly.
In this guide, we’ll focus on getting a WordPress instance set up with an Apache web server on Ubuntu 14.04.

Prerequisites

Before you begin this guide, there are some important steps that you need to complete on your server.
We will be proceeding through these steps as a non-root user with sudo privileges, so you will need to have one available. You can find out how to create a user with sudo privileges by following steps 1-4 in our Ubuntu 14.04 initial server setup guide.
Additionally, you’ll need to have a LAMP (Linux, Apache, MySQL, and PHP) stack installed on your VPS instance. If you don’t have these components already installed and configured, you can use this guide to learn how to install LAMP on Ubuntu 14.04.
When you are finished with these steps, you can continue with this guide.

Step One — Create a MySQL Database and User for WordPress

The first step that we will take is a preparatory one. WordPress uses a relational database to manage and store site and user information.
We have MySQL installed, which can provide this functionality, but we need to make a database and a user for WordPress to work with.
To get started, log into the MySQL root (administrative) account by issuing this command:

mysql -u root -p

You will be prompted for the password you set for the MySQL root account when you installed the software. You will then be given a MySQL command prompt.
First, we can create a separate database that WordPress can control. You can call this whatever you would like, but I will be calling it wordpress because it is descriptive and simple. Enter this command to create the database:

CREATE DATABASE wordpress;

Every MySQL statement must end in a semi-colon (;), so check to make sure this is present if you are running into any issues.
Next, we are going to create a separate MySQL user account that we will use exclusively to operate on our new database. Creating one-function databases and accounts is a good idea from a management and security standpoint.
I am going to call the new account that I’m making wordpressuser and will assign it a password of password. You should definitely change the password for your installation and can name the user whatever you’d like. This is the command you need to create the user:

CREATE USER wordpressuser@localhost IDENTIFIED BY 'password';

At this point, you have a database and a user account, each made specifically for WordPress. However, these two components have no relationship yet. The user has no access to the database.
Let’s fix that by granting our user account access to our database with this command:

GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost;

Now the user has access to the database. We need to flush the privileges so that the current instance of MySQL knows about the recent privilege changes we’ve made:

FLUSH PRIVILEGES;

We’re all set now. We can exit out of the MySQL prompt by typing:

exit

You should now be back to your regular command prompt.

Step Two — Download WordPress

Next, we will download the actual WordPress files from the project’s website.
Luckily, the WordPress team always links the most recent stable version of their software to the same URL, so we can get the most up-to-date version of WordPress by typing this:

cd ~
wget http://wordpress.org/latest.tar.gz

This will download a compressed file that contains the archived directory contents of the WordPress files to our home directory.
We can extract the files to rebuild the WordPress directory we need by typing:

tar xzvf latest.tar.gz

This will create a directory called wordpress in your home directory.
While we are downloading things, we should also get a few more packages that we need. We can get these directly from Ubuntu’s default repositories after we update our local package index:

sudo apt-get update
sudo apt-get install php5-gd libssh2-php

This will allow you to work with images and will also allow you to install plugins and update portions of your site using your SSH login credentials.

Step Three — Configure WordPress

Most of the configuration that we will be doing will be through a web interface later on. However, we do need to do some work from the command line before we can get this up and running.
Begin by moving into the WordPress directory that you just unpacked:

cd ~/wordpress

A sample configuration file that mostly matches the configuration we need is included by default. However, we need to copy it to the default configuration file location to get WordPress to recognize the file. Do that now by typing:

cp wp-config-sample.php wp-config.php

Now that we have a configuration file to work with, let’s open it in a text editor:

nano wp-config.php

As I said before, this file is almost entirely suitable for our needs already. The only modifications we need to make are to the parameters that hold our database information.
We will need to find the settings for DB_NAME, DB_USER, and DB_PASSWORD in order for WordPress to correctly connect and authenticate to the database we created.
Fill in the values of these parameters with the information for the database you created. It should look like this:

// ** 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', 'wordpressuser');

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

These are the only values that you need to change.
When you are finished, save and close the file.

Step Four — Copy Files to the Document Root

Now that we have our application configured, we need to copy it into Apache’s document root, where it can be served to visitors of our website.
One of the easiest and most reliable way of transferring files from directory to directory is with the rsync command. This preserves permissions and has good data integrity features.
The location of the document root in the Ubuntu 14.04 LAMP guide is /var/www/html/. We can transfer our WordPress files there by typing:

sudo rsync -avP ~/wordpress/ /var/www/html/

This will safely copy all of the contents from the directory you unpacked to the document root.
We should now move into the document root to make some final permissions changes

cd /var/www/html

You will need to change the ownership of our files for increased security.
We want to give user ownership to the regular, non-root user (with sudo privileges) that you plan on using to interact with your site. This can be your regular user if you wish, but some may suggest that you create an additional user for this process. It is up to you which you choose.
For this guide, we will use the same account that we set up during the initial server setup guide, which we called demo. This is the account I am performing all of the actions of this guide as.
The group ownership we will give to our web server process, which is www-data. This will allow Apache to interact with the content as necessary.
We can quickly assign these ownership values by typing:

sudo chown -R demo:www-data *

This will set up the ownership properties that we are looking for.
While we are dealing with ownership and permissions, we should also look into assigning correct ownership on our uploads directory. This will allow us to upload images and other content to our site. Currently, the permissions are too restrictive.
First, let’s manually create the uploads directory beneath the wp-content directory at our document root. This will be the parent directory of our content:

mkdir /var/www/html/wp-content/uploads

We have a directory now to house uploaded files, however the permissions are still too restrictive. We need to allow the web server itself to write to this directory. We can do this by assigning group ownership of this directory to our web server, like this:

sudo chown -R :www-data /var/www/html/wp-content/uploads

This will allow the web server to create files and directories under this directory, which will permit us to upload content to the server.

Step Five — Complete Installation through the Web Interface

Now that you have your files in place and your software is configured, you can complete the installation through the web interface.
In your web browser, navigate to your server’s domain name or public IP address:

http://server_domain_name_or_IP

You will see the WordPress initial configuration page, where you will create an initial administrator account:
Wordpress initial config
Fill out the information for the site and the administrative account you wish to make. When you are finished, click on the install button at the bottom.
WordPress will confirm the installation, and then ask you to log in with the account you just created:
WordPress confirm install
Hit the button at the bottom and then fill out your account information:
WordPress login
You will be presented with the WordPress interface:
WordPress admin interface

Step Six (Optional) — Configure Pretty Permalinks for WordPress

By default, WordPress creates URLs dynamically that look something like this:

http://server_domain_name_or_IP/?p=1

This isn’t exactly the most useful interface for visitors or search engines, so most users want to modify this. WordPress has the ability to create “pretty” permalinks which will clean up the URL into a more human-friendly format.
There are a few things we need to do to get this to work with Apache on Ubuntu 14.04.

Modifying Apache to Allow URL Rewrites

First, we need to modify the Apache virtual host file for WordPress to allow for .htaccess overrides. You can do this by editing the virtual host file.
By default, this is 000-default.conf, but your file might be different if you created another configuration file:

sudo nano /etc/apache2/sites-available/000-default.conf

Inside of this file, we want to set up a few things. We should set the ServerName and create a directory section where we allow overrides. This should look something like this:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ServerName server_domain_name_or_IP
    <Directory /var/www/html/>
        AllowOverride All
    </Directory>
    . . .

When you are finished, save and close the file.
Next, we need to enable the rewrite module, which allows you to modify URLs. You can do this by typing:

sudo a2enmod rewrite

After you have made these changes, restart Apache:

sudo service apache2 restart

Create an .htaccess File

Now that Apache is configured to allow rewrites through .htaccess files, we need to create an actual file.
You need to place this file in your document root. Type this to create an empty file:

touch /var/www/html/.htaccess

This will be created with your username and user group. We need the web server to be the group owner though, so we should adjust the ownership by typing:

sudo chown :www-data /var/www/html/.htaccess

We now have the correct ownership of this file.
We may need to adjust the permissions however. This depends on how you prefer to work. WordPress will generate the necessary rewrite rules for you. If it has write permissions to this file, it can implement the rules automatically. If it does not, you will have to manually edit this file to add the correct rules.
Which configuration you choose depends on how much you value convenience over security. Allowing the web server write access to this file will definitely be more convenient, but some say that it is an unnecessary security risk.
If you want WordPress to automatically update this file with rewrite rules, you can ensure that it has the correct permissions to do so by typing:

chmod 664 /var/www/html/.htaccess

If you want to update this file manually for the sake of a small security gain, you can allow the web server only read privileges by typing:

chmod 644 /var/www/html/.htaccess

Change the Permalink Settings in WordPress

When you are finished doing the server-side changes, you can easily adjust the permalink settings through the WordPress administration interface.
On the left-hand side, under the Settings menu, you can select Permalinks:
WordPress permalinks
You can choose any of the preconfigured settings to organize URLs, or you can create your own.
WordPress perma options
When you have made your selection, click “Save Changes” to generate the rewrite rules.
If you allowed the web server write access to your .htaccess file, you should see a message like this:
WordPress perma update
If you did not allow the web server write access to your .htaccess file, you will be provided with the rewrite rules you need to add to the file manually.
Copy the lines that WordPress gives you and then edit file on your server:

nano /var/www/html/.htaccess

This should give you the same functionality.

Conclusion

You should now have a WordPress instance up and running on your Ubuntu 14.04 VPS. There are many avenues you can take from here. Below we’ve listed some options:

Ubuntu – Removing old Network Cards

I a server hardware fail today and had to swap the hard drive into another server. When I booted up the server it did not have an ip address as eth0 wasnt found.

This was a simple fix all I did was delete /etc/udev/rules.d/70-persistent-net.rules

I then rebooted the server and it greated a new file with the installed network card configured as eth0. This got the networking working as it should be.

Ubuntu Installing Java 7 from apt-get

The Oracle JDK is the official JDK; however, it is no longer provided by Oracle as a default installation for Ubuntu.
You can still install it using apt-get. To install any version, first execute the following commands:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update


Oracle JDK 7

sudo apt-get install oracle-java7-installer

Ubuntu 14.04: Adding a second hard drive/additional storage

Adding a second hard drive/additional storage
Note: This is for an OS drive “sda” and a Data drive “sdb”

  • ls /dev/sd*
    • Because sdb has no partitions there should be no sdb1 or sdb2 (paritions)
  • fdisk /dev/sdb
  • n
  • p
  • Enter
  • Enter
  • w
  • mkfs.ext4 -L /images /dev/sdb1
  • nano /etc/fstab
    • Add the following line at the botton of this file
      • /dev/sdb1 /images ext4 defaults 1 2
    • Ctrl + O
    • Enter
    • Ctrl + x
  • mkdir /images
  • mount -a
    • If there are no errors, then everythig is ok…
    • If there are errors
      • nano /etc/fstab