Cloud

Install ownCloud on CentOS 7

This installation assumes you are starting from a fresh CentOS 7.x Installation with no other services installed.

Update your OS

yum -y update

Install Apache, SSL, PHP, MariaDB and Nano

yum -y install httpd mod_ssl openssl php php-mysql php-posix mariadb-server mariadb sqlite php-dom php-mbstring php-gd php-pdo nano

*php-posix required for ownCloud’s occ command line configuration software.

Start Apache and MariaDB

systemctl start httpd.service
systemctl start mariadb.service

Set Apache and MariaDB to autostart on boot

systemctl enable httpd.service
systemctl enable mariadb.service

Add http and https to the firewall

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

Download ownCloud

wget https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2

Install bzip2 (Required to extract the ownCloud software)

yum install -y bzip2

Extract the software

tar -jxvf owncloud-7.0.0.tar.bz2 -C /var/www/html/

Set Apache ownership permissions

chown -R apache:apache /var/www/html/owncloud/

Database Configuration

Configure MariaDB
Running the following command and answering the associated prompts will help secure the database.

mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, 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): Enter
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Enter
New Password: RootDatabasePassword
Re-enter new password: RootDatabasePassword
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB 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] Enter
 ... Success!

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] Enter
 ... Success!

By default, MariaDB 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] Enter
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

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

Reload privilege tables now? [Y/n] Enter
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Create the ownCloud database user and database

mysql -u root -p
Enter password: RootDatabasePassword
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is ##
Server version: 5.5.47-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database owncloud;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create user 'owncloud'@'localhost' identified by 'OwnCloudDatabaseUserPassword';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all on owncloud.* to 'owncloud'@'localhost';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit

 

Configure Apache

IP.ADD.RE.SS/owncloud Method

Add the following lines to the Apache owncloud config file

nano /etc/httpd/conf.d/owncloud.conf
Alias /owncloud /var/www/html/owncloud

Options Indexes FollowSymLinks
AllowOverride Allubuntu 16.04 release date
Order allow,deny
allow from all

Save the file

Ctrl+X
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? Y
File Name to Write: /etc/httpd/conf.d/owncloud.conf Enter

 

owncloud.domain.com Method

Use this method if you will be accessing your ownCloud installation through a domain name vs. using an IP address as shown above.

Create the CSR (certificate signing request)

In order to add instant security before purchasing an SSL (Secure Socket Layer) certificate, you’ll need to create a self-signed certificate.

Use the following link to create the CSR.
http://www.howtowebhost.com/how-to-create-a-csr-certificate-signing-request-in-linux-using-openssl/

Create the Self-Signed Certificate

*Make sure you use the same files names you created in the previous steps!

openssl x509 -req -days 365 -in owncloud.domain.com.csr -signkey owncloud.domain.com.key -out owncloud.domain.com.crt

Move the certificate files to a secure location

mkdir /etc/httpd/conf/ssl
mv owncloud.domain.com.csr /etc/httpd/conf/ssl/
mv owncloud.domain.com.key /etc/httpd/conf/ssl/
mv owncloud.domain.com.crt /etc/httpd/conf/ssl/

Configure Apache to use listen on Port 443

Add the following lines to the Apache configuration file:

nano /etc/httpd/conf/httpd.conf
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

<IfModule mod_ssl.c>
    Listen 443
</IfModule>

Save the file

Ctrl+X
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? Y
File Name to Write: /etc/httpd/conf/httpd.conf Enter

Add the following lines to the Apache config file

nano /etc/httpd/conf.d/owncloud.domain.com
<VirtualHost *:80>
    ServerAdmin     red01montecarlo@yahoo.com
    ServerName    owncloud.thomasandsofia.com
    DocumentRoot    /var/www/html/owncloud
    ErrorLog        /var/log/httpd/owncloud-error.log
    TransferLog     /var/log/httpd/owncloud-access.log
    LogLevel warn
</VirtualHost>
<VirtualHost *:443>
    ServerAdmin     red01montecarlo@yahoo.com
    ServerName    owncloud.thomasandsofia.com
    DocumentRoot    /var/www/html/owncloud

    SSLEngine on
    SSLCertificateFile /etc/httpd/conf/ssl/owncloud.thomasandsofia.com.crt
    SSLCertificateKeyFile /etc/httpd/conf/ssl/owncloud.thomasandsofia.com.key

    ErrorLog        /var/log/httpd/owncloud-error.log
    TransferLog     /var/log/httpd/owncloud-access.log
    LogLevel warn
</VirtualHost>

Save the file

Ctrl+X
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? Y
File Name to Write: /etc/httpd/conf.d/owncloud.conf Enter

Restart MariaDB

#

systemctl restart httpd.service
systemctl restart mariadb.service

 

Install ownCloud and configure the Admin user

Using the Command Line

Create occ alias

Since we’ll be using the ownCloud occ (ownCloud Console), and this command must be ran as the web server user, create an alias to reduce typing.

alias occ="sudo -u apache /var/www/html/owncloud/occ"

Install ownCloud and setup the database

occ maintenance:install --database "mysql" --database-name "owncloud" --database-user "ownCloudDBUser" --database-pass "ownCloudDBPassword" --admin-user "ownCloudAdmin" --admin-pass "ownCloudAdminPassword"
ownCloud is not installed - only a limited number of commands are available
ownCloud was successfully installed

Complete Setup Using Web Interface

IP.ADD.RE.SS/owncloud Method

Type the IP address of your server directly into your browser’s address bar, followed by /owncloud
owncloudBrowser1

owncloud.domain.com Method

Enter https://owncloud.domain.com (replace “domain.com” with your actual domain) directly into your browser’s address bar.
owncloudBrowser2

Enter your Administrator username and password

In the “Create an admin account, enter the username and password you wish to use for your administrator.

It is strongly recommended NOT to use “admin” or “administrator” since these are easily guessed. Using other usernames adds an extra layer of security to your system.

owncloudAdminPass

Configure the Storage location

To access the storage and database configuration settings, click “Storage & database” located directly under the “Create and admin account” window.

The default storage path for this configuration is “/var/www/html/owncloud/data”. Leave this as it is for now. We will manually adjust it in the upcoming steps.

owncloudstorage

Configure the Database

In the “Configure the database” window, click “MySQL/MariaDB”, then enter the username, password and database name you used when you configured the database earlier. Leave “localhost” as it is to ensure remote users cannot access the database.
ownclouddbsetup1

Save the settings

Click the [Finish setup] button at the bottom of the page.

Exit

Close your web browser. We have some more command line work to do!

 

Secure the data folder

By default, ownCloud installs the data folder directly on the website’s document root. This could allow access to the folder if the site’s .htaccess or folder’s index file becomes corrupt. Instead, we’ll move it to an “off-site” folder.

Move the data/ folder

mv /var/www/html/owncloud/data /home/owncloud-data

*It has been noted by other users that using “/home/owncloud/data” or other matching folder naming techniques tend to fail, so we use “/home/owncloud-data” which has proven to work.

Configure ownCloud to use the new location

nano /var/www/html/owncloud/config/config.php

Now change the following line:

'datadirectory' = '/var/www/html/owncloud/data',

To:

'datadirectory' = '/home/owncloud-data',

Save the change

Ctrl+X
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? Y
File Name to Write: /var/www/html/owncloud/config/config.php Enter

Restart Apache

systemctl restart httpd.service
By admin on April 1, 2016 | Applications, Cloud, Linux | A comment?

How to cancel a Codero Cloud instance

Cancelling a Codero Cloud instance and preventing further billings is as easy as destroying the instance. From the moment the instance is deleted, it is considered cancelled and no further billings will occur for that instance.

Log into your Codero Cloud Account

Open Cloud Portal at https://portal.codero.com then click Login

cclogin1

 
Enter your Codero Client Id for the username, then enter your account password and click Login

cclogin2

 

Locate the instance you wish to cancel

From the Main Menu dsiplayed in the left column, click List Cloud Servers

ccmmlcs1

 

Display Options

Locate the instance you wish to delete. If you only have one intance, or the instance you wish to delete is listed first, the options should be displayed by default. If you cannot see the options, click the down arrow located on the right side of the instance display.

ccoptions1

 

Delete the instance

With the available options now being displayed, click Delete

ccoptionsdelete

 

Confirm Deletion

A confirmation window will appear asking you to confirm that you wish to delete the selected cloud instance. Verify you have the correct instance using the displayed hostname. If this is the correct cloud instance, delete it by clicking the green [Yes] button.

Once you delete a cloud instance, it cannot be restored. If a snapshot of the instance had been created, it will also be destroyed and cannot be restored.

After a few moments, your cloud instance will be destroyed and you will receive no further billings on the instance.

ccdeleteconfirm

 

By admin on December 19, 2014 | Cloud | A comment?

How to Resize a Linux Cloud Disk Size After an Upgrade

Scope

This article was written to outline the steps required to resize the disk space on a Codero Cloud instance that had previously been upgraded to a larger size.

 

Requirements

A Codero Cloud account
A running Codero Cloud instance that had previously been upgraded to a larger size.

 

Procedure

 

Log In

Log into your cloud instance as root using SSH

 

Verify upgraded size

You can verify the size of the drive had been upgraded by running the following command:

# fdisk -l /dev/xvda
Sample Output:

Disk /dev/xvda: 39.7 GB, 39728447488 bytes
255 heads, 63 sectors/track, 4830 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c1698
...

The available disk is 39.7GB

 

Verify current disk size

Check the current size of the disk by running the df (disk free) command

df -h
Sample Output:

Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda3       19G  1.1G   17G   6% /
tmpfs           497M     0  497M   0% /dev/shm
/dev/xvda1      485M   64M  396M  14% /boot

In this example the current usable disk size is 19G

 

Resize the disk

Resize the disk using the resize2fs command

# resize2fs /dev/xvda3
Sample Output

By admin on July 18, 2014 | Cloud, Linux | A comment?

How to Upgrade your Codero Cloud Server

Scope

This article describes the steps required to restore a previously created Codero Cloud snapshot.

 

Requirements

An active Codero Cloud account
A cloud instance with a previously created snapshot

Please note that Codero Cloud servers can only be scaled UP and cannot be scaled down. In order to scale an instance down, you will need to first create the smaller instance, then copy your data to the new instance manually.

 

Procedure

Log In

Log into your Codero Cloud account at https://portal.codero.com

 

List available servers

Lists all available cloud servers by clicking the small cloud icon from the Main Menu.

cloud-list-servers
 

Display Control Options

If you do not see the Cloud control options (Start, Restart, ect., click the the downward pointing arrow located at the right of the cloud description.

 

Stop Server

The server must be stopped before you are able to upgrade it. To stop the instance, click the “Stop Server” icon.

cloud-control-options-stop

 

Upgrade Server

After the instance has stopped, click the “Upgrade Server” icon. This will display the sizes available.

cloud-options-upgrade-icon

 

Choose Server Size

A new window will appear with the available upgrade options. Click the size you wish to upgrade to, then click Upgrade.

cloud-upgrade-choose-size

 

Verify New Size

After a few moments, your server upgrade will complete and will automatically restart. You will see the upgrade change in the cloud description.

cloud-upgrade-restart

 

*** Resize your drive ***
While your instance is ready to accept the new drive size, you will need to manually resize it. The steps to resize your drive are quite different between Linux and Windows systems, so these steps are outlined in different articles.

 
 

By admin on July 12, 2014 | Cloud | A comment?

How to Delete a Codero Cloud Snapshot

Scope

This article describes the steps required to delete a previously created Codero Cloud snapshot.

Codero cloud instances are only allowed 1 snapshot each. In order to create a new snapshot, you will need to delete any existing snapshots first.

 

Requirements

An active Codero Cloud account
A cloud instance with a previously created snapshot

 

Procedure

Log In

Log into your Codero Cloud account at https://portal.codero.com

 

List available servers

Lists all available cloud servers by clicking the small cloud icon from the Main Menu.

cloud-list-servers
 

Display Control Options

If you do not see the Cloud control options (Start, Restart, ect., click the the downward pointing arrow located at the right of the cloud description.

 

Delete Snapshot

Click the “Delete Snapshot” icon. This will display the “Delete a snapshot” confirmation form.

cloud-control-options-delete-snapshot

 

Confirm Deletion

Confirm you are deleting the correct snapshot based on the details displayed in the “Delete a snapshot” confirmation form. If the information displayed is correct, click the name of the snapshot, then click Confirm Delete

cloud-confirm-delete-form

 

After deleting a snapshot, it is strongly recommended to immediately create a new one. Failure to do so may result in an irretrievable loss of data.

 

By admin on July 11, 2014 | Cloud | A comment?

How to create a Codero Cloud snapshot

Scope

This article describes the steps required to create a snapshot of a Codero Cloud instance.

Snapshots are used to restore a cloud instance back to the exact state the instance was in at the time the snapshot was created. This means a snapshot can be used as a rudimentary form of backup. When a snapshot is applied, all files on the instance are in restored.

Cloud instances are only allowed 1 snapshot each. If you have previously created a snapshot, you will need to delete the existing snapshot before you can create a new one.

 

Requirements

An active Codero Cloud account
A previously created cloud instance.

 

Procedure

Log In

Log into your Codero Cloud account at https://portal.codero.com

 

List available servers

Lists all available cloud servers by clicking the small cloud icon from the Main Menu.

cloud-list-servers
 

Display Control Options

If you do not see the Cloud control options (Start, Restart, ect., click the the downward pointing arrow located at the right of the cloud description.

 

Create Snapshot

Click the “Create Snapshot” icon. This will display the “Create a snapshot” form.

ccoptionssnapshot

 

Title

Enter a title for the snapshot. The title should provide a very brief description of the current state of the cloud instance. After you’ve entered a title, click Create Snapshot

For this example, we’ve titled our snapshot “Fresh OS”

cccreatesnapshotconfirm

 

Snapshot complete

Once the snapshot has completed, you will see the “Restore Snapshot” icon in the Cloud Control Options.

cloud-control-options-restore-snapshot

By admin on | Cloud | A comment?

How to create a Codero Cloud Instance

This article is designed to walk you through the steps required to create a new Cloud Instance through Codero Cloud Portal https://portal.codero.com

Requirements:

* A current Codero Cloud Account.
 

Procedure

Log In

Log into your Codero Cloud portal using your login ID or Codero Client ID and your Password. https://portal.codero.com

 

Create Cloud

To begin creating a new cloud instances, click the cloud-portal-create-cloud symbol from the Main Menu in the left column. This will open the Create Cloud Server screen.

 

Name

Select a unique name identifier for this server. The name may only contain characters A-Z, 0-9 and hyphens (-). You are limited to a total of 60 characters for the name and it cannot start with a hyphen.

add-cloud-name

 

Size

Codero Cloud instances are available in a variety of sizes. Each size has predetermined RAM, Bandwidth, cores and disk space. Click the option that supports your requirements. The monthly pricing for each size option is displayed on the right.

If you intend to create a Windows instance, you will need to select a server with 1024 MB RAM minimum. Lower options will not support the Windows operating system.

add-cloud-size

 

Operating System

Select the desired Operating System (OS) by clicking on the OS Icon, then select the required version. Any additional license fees for the selected OS will be displayed on the right.

At the time of writing, the OS versions available are:

Ubuntu 10.04
Ubuntu 12.04
Ubuntu 14.04
Debian 6.0
CentOS 5.10
CentOS 6.5
Fedora 18
ArchLinux 2013.07.01
Windows Server 2008
Windows Server 2008 w/MSSQL Standard*
Windows Server 2012
Windows Server 2012 w/MSSQL Standard*
Docker 1.0 on Ubuntu 14.04

If you require MSSQL, but do not need the advanced options provided with MSSQL Standard, you should create an instance without MSSQL, then install your own version of MSSQL with the license provided to you by Microsoft.

create-cloud-select-os

 

Bandwidth

There are no options to select since Codero Cloud Bandwidth pricing does not change based on the cloud’s configurations. Currently, all incoming bandwidth is free and so is any private communication between the instance and any other Codero servers on the account provided they are connected with a Hybrid connection.

create-cloud-bandwidth

 

Billing Period

Select your desired billing period. Select between Hourly or Monthly. Hourly instances are best for development or for offloading processing spikes. If you are using your instance for hosting or other continuous services, select the Monthly option for the best pricing.

Note that when you change between Hourly and Monthly billing cycles, the prices listed for each Size and OS license fees are updated automatically.
Hourly instances are billed from the creation time until they are deleted. Simply stopping an hourly instance does not stop the billing for the instance. To stop all billing on a cloud instance, it must be deleted.

Hourly billing example
create-cloud-hourly

Monthly billing example
create-cloud-monthly

 

Create Server

The last step is to create your server! Click the blue Create Server button at the bottom of the page.

create-cloud-create-server

Depending on the size and operating system selected, it may take between a few minutes to as much as 1/2 hour for your instance to be created.

 

Note your Password and IP address!

create-cloud-instance-created

By admin on July 10, 2014 | Cloud, ServerPortal | A comment?