0

How To Stream MP4 Video Files From My VPS

This is a really good question and was actually the subject of a support ticket. I scratched my own head for a second and realized the solution was much easier than I thought.

What you need:

  • A virtual private server running Windows or Linux
  • A web server such as Apache, IIS, nginx, Lighttpd, etc.
  • Enough disk space for the operating system and video files
  • Enough bandwidth for your video files

Step One:
Install the operating system

This is relatively easy and I have to assume everyone has done this as there is nothing specific or special you need to install on your operating system except make sure it connects online.

Step Two:
Install the web server

For Apache, it’s relatively easy with most Linux operating systems.

Apache download pageApache for Windows
Continue Reading

0

WordPress Wednesdays: Basic WordPress Setup on a VPS Server

For this new addition to “WordPress Wednesdays”, I have created this basic WordPress setup tutorial where you take a basic OpenVZ or Xen virtual private server, setup the minimum requirements of WordPress and start your new blog. In today’s later article, I will explain how to restore a backup.

Requirements:

1. Virtual Private Server:
Your WordPress installation needs a Linux operating system to run a web server, MySQL and PHP. Most Linux distributions come with a web server, such as Apache, by default and through the package managers on the operating system we can install additional requirements that we need.

The minimum requirements, I would recommend, for a VPS to run WordPress is 512mb RAM, 1024mb burstable RAM or swap space, 20gb disk space and 250gb bandwidth minimum. If you plan on using a lot of graphics or a lot of traffic, you may want to use 500gb of network transfer. If you are going to be traffic or resource intensive, with lots of WordPress plugins, please go with a Xen VPS for a few dollars per month.
Continue Reading

0

Ubuntu: Install Webmin on Ubuntu VPS

This is easily accomplished with a few commands!

First step, get the requirements for Webmin

apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python

Without these files, Webmin will not run. Next, we get the Webmin .deb file and install it:

wget http://prdownloads.sourceforge.net/webadmin/webmin_1.600_all.deb
dpkg -i webmin_1.600_all.deb

Note: If you tried to download and install Webmin first, without the requirements, and have errors after you tried the apt-get install command in step one, type in apt-get -f install to force the install of the dependencies to meet Webmin’s dependency requirements.

Get:1 http://archive.ubuntu.com/ubuntu/ precise/main libnet-ssleay-perl i386 1.42-1build1 [184 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ precise/universe libauthen-pam-perl i386 0.16-2build2 [27.9 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ precise/main libio-pty-perl i386 1:1.08-1build2 [36.9 kB]
Get:4 http://archive.ubuntu.com/ubuntu/ precise/main libapt-pkg-perl i386 0.1.25build2 [82.2 kB]
Get:5 http://archive.ubuntu.com/ubuntu/ precise/universe apt-show-versions all 0.17 [32.9 kB]
Fetched 364 kB in 0s (416 kB/s)              
Selecting previously unselected package libnet-ssleay-perl.
(Reading database ... 45568 files and directories currently installed.)
Unpacking libnet-ssleay-perl (from .../libnet-ssleay-perl_1.42-1build1_i386.deb) ...
Selecting previously unselected package libauthen-pam-perl.
Unpacking libauthen-pam-perl (from .../libauthen-pam-perl_0.16-2build2_i386.deb) ...
Selecting previously unselected package libio-pty-perl.
Unpacking libio-pty-perl (from .../libio-pty-perl_1%3a1.08-1build2_i386.deb) ...
Selecting previously unselected package libapt-pkg-perl.
Unpacking libapt-pkg-perl (from .../libapt-pkg-perl_0.1.25build2_i386.deb) ...
Selecting previously unselected package apt-show-versions.
Unpacking apt-show-versions (from .../apt-show-versions_0.17_all.deb) ...
Processing triggers for man-db ...
Setting up libnet-ssleay-perl (1.42-1build1) ...
Setting up libauthen-pam-perl (0.16-2build2) ...
Setting up libio-pty-perl (1:1.08-1build2) ...
Setting up libapt-pkg-perl (0.1.25build2) ...
Setting up apt-show-versions (0.17) ...
** initializing cache. This may take a while **
Setting up webmin (1.600) ...
Webmin install complete. You can now login to https://ubuntu:10000/
as root with your root password, or as any user who can use sudo
to run commands as root.

This tells you that Webmin is up and running!

We open up our web browser with https://vps-ip-address:10000

Please do not forget the https! We replace vps-ip-address and put in your VPS server’s IP address or even your domain/subdomain you have assigned to it.

We login with root and our root password.

I have not used Webmin much but I plan on doing so to learn more about it. It seems very simple to setup and use without purchasing a monthly license from cPanel. I like cPanel a lot and highly recommend it but could see where spending $15 per month on a license and requiring at least 1gb of memory for cPanel could be a problem to an individual with a small budget.

0

How To Generate Random Passwords

This is a common question a lot of people are afraid to ask.

The easiest way I have found is through a utility called apg or automatic password generator. It’s available on most Debian and Ubuntu based operating systems by typing apt-get install apg -y and it will install for you.

If you have CentOS, you need to enable RPM Forge’s repositories.

rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

CentOS 6 – 32 bit, download here.
CentOS 6 – 64 bit, download here.

CentOS 5 – 32 bit, download here.
CentOS 5 – 64 bit, download here.

You install your appropriate package with rpm -i rpmforge-release-*.rpm

Once installed, yum install apg should install apg for you as apg is maintained by RPM Forge.

When you want to create a random password, you type in apg into the Terminal screen of your computer or your SSH client into your server.

# apg

Please enter some random data (only first 8 are significant)
(eg. your old password):>
Cabnobaj9 (Cab-nob-aj-NINE)
Omodand2 (Om-od-and-TWO)
erlErrorl4 (erl-Err-orl-FOUR)
Tedd8Knil (Tedd-EIGHT-Knil)
nebViObobs1 (neb-Vi-Ob-obs-ONE)
WoossOnyax7 (Wooss-On-yax-SEVEN)

I just type in random keyboard gibberish when they prompt me for random data.

For maximum password security, I would normally combine two passwords together such as Cabnobaj9Omodand2, Omodand2erlErrorl4, or nebViObobs1WoossOnyax7.

0

MySQL: I Forgot My MySQL Root Password

Don’t worry, it’s not the end of the world as we have all done it before! It’s actually quite simple to fix.

First, we shut down our MySQL server:

# /etc/init.d/mysql stop
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql stop

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop mysql
mysql stop/waiting

* This error tells me service mysql stop works also.

Now, we start MySQL and skip the password file with the mysqld_safe –skip-grant-tables & command:

# mysqld_safe --skip-grant-tables &
[1] 1342
121006 17:25:03 mysqld_safe Logging to syslog.
121006 17:25:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

If your output is messed up, hit Enter on your keyboard.

Next we login as root without any password with mysql -u root

# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql>

We issue the following commands:
use mysql;
update user set password=PASSWORD(“NEW-ROOT-PASSWORD”) where User=’root’;
flush privileges;
quit;

# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set password=PASSWORD("Ouwurs1QuiWr") where User='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit;
Bye

Now we stop and restart MySQL:

/etc/init.d/mysql stop
/etc/init.d/mysql start

If you run Ubuntu: service mysql stop and service mysql start.

Now, we try and login with our new MySQL root password:

# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 37
Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql>

If you see this, type exit and you have reset your password!

If not, check your output buffer and see if you misspelled your password.

0

Ubuntu: Setting Up a PPTP On Ubuntu VPS

This is a common request and relatively easy to accomplish. Usually, you will need a Xen or KVM VPS to load the necessary kernel modules. If you don’t want to spend too much money, get a custom Xen VPS with a VPS hosting company.

You need about 256mb of RAM and 512mb of swap, one CPU and whatever bandwidth you need. 5 – 10gb of disk space will do fine for you.

First, we verify the kernel modules:

# lsmod
Module                  Size  Used by
dm_crypt               23125  0

We need various PPP modules so we issue the following commands:

# modprobe ppp_async
# modprobe ppp_deflate
# modprobe ppp_mppe
# lsmod
Module                  Size  Used by
arc4                   12529  0 
ppp_mppe               13077  0 
ppp_deflate            13038  0 
zlib_deflate           27139  1 ppp_deflate
ppp_async              17539  0 
crc_ccitt              12667  1 ppp_async
dm_crypt               23125  0

All our necessary PPP modules are installed, which are required for PPTP so we’re doing very good.

Next, we install pptpd:

apt-get update
apt-get install pptpd

We edit a few files, such as /etc/pptpd.conf and add to the bottom of the file:

localip 10.10.10.1
remoteip 10.10.10.100-150

We edit /etc/ppp/pptpd-options and uncomment ms-dns to add:

ms-dns 8.8.8.8
ms-dns 8.8.4.4

These are Google’s DNS servers. Feel free to add your VPS hosting company’s resolvers, a third party DNS server like OpenDNS or even your own DNS servers.

We add our account now by opening up /etc/ppp/chap-secrets:

# client    server  secret          IP addresses
testacct    pptpd   vpn1234    *

The username “testacct” has the password “vpn1234″. You would want to create something more secure than using this. We have to configure NAT for PPTP with the following line added to /etc/rc.local but right before exit 0 in the file:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

If you do not add this line to /etc/rc.local, your connection will not connect to the Internet.

This is what your /etc/rc.local file should look like:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
exit 0

Next, we have to edit /etc/sysctl.conf and find this line net.ipv4.ip_forward=1 and make sure there is not a # in front of it which disables it. We have to “uncomment” it.

net.ipv4.ip_forward=1

We reload the configuration with sysctl -p and reboot our Xen VPS server from the command like with the reboot command.

To make this work on my Ubuntu laptop, I went to the network icon at the top right hand corner and went to VPN Connections -> Configure VPN.

I clicked Add, then chose Point-to-Point Tunneling Protocol (PPTP) at the next screen.

You need to fill in the following settings:
Gateway = Your VPS IP address
Username = testvpn
Password = 1234vpn (or whatever you changed user/password to)

We click the Advanced box, and enable Use Point-to-Point encryption (MPPE) or you will have errors when trying to use your PPTP VPN. I had this problem for a long time and was glad it was a simple setting to enable to get it working.

PPTP works fine on Android based devices. This PPTP VPN worked flawlessly on my Samsung Replenish cell phone running Android Gingerbread. It allowed my web browsing to go through the VPN and when I verified my IP address, it gave the IP address of the VPN.

Conclusion:
Like I mentioned above, it’s relatively inexpensive and very simple to setup on a Xen VPS server. You can email a hosting provider to see if these kernel modules are available on OpenVZ but this setup works on a Xen VPS 100% of the time. If the price of Xen scares you, get a custom Xen VPS with the following specs:

  • 1 CPU core
  • 256mb RAM
  • 512mb swap
  • 5gb disk

Get whatever bandwidth you need and since bandwidth is cheap, you won’t really need a lot. 500gb – 1TB should be more than enough bandwidth for you, depending on how many people you have on this PPTP VPN.

If you are trying to get your coworkers, friends and family to browse a little bit more securely on the Internet, if you use the Internet a lot on unsecure networks or coffee shop wireless Internet connections this is really recommended as an extra layer of encryption on an otherwise unsecure to the point of anyone with some minor technical knowledge can monitor who goes to what website and can even get information that you think is SSL encrypted.