Next on our list, we need to get PHP and MySQL set up if we're ever going
to host something like WordPress or Drupal. Let's get everything
installed with apt-get install php5 mysql-server php5-mysql
. During the
setup, you will need to set a password for the root user of the MySQL
server. Make sure to set something long, complicated, and different than
your shell password, you don't want your entire server compromised if
someone figures out your MySQL password.
Now, restart Apache with service apache2 restart
so we can start using
PHP.
Next, navigate to where you put the example file last time, remove your
old example file (it should be index.html
), and make index.php
with
these contents:
<?php
phpinfo();
?>
Now, head over to your site and take a look, you should see something similar to this:
If you see that, you're done here. Next, we'll set up FTP accounts, then get WordPress running.
Other posts in this series:
Aside from all the tech, I can cook occasionally. I get fixated on projects and absolutely must perfect them. I had previously posted this on Google+ and gotten a fair amount of praise for it, but I felt like this needed a more permanent home.
Full Disclosure: If you use the links on this page to buy the ingredients on Amazon, I will (hopefully) make a small bit of cash from it.
1 Whirly-Pop Stovetop Popcorn Maker
¼ Teaspoon Box Flavicol Popcorn Seasoning Salt
1 Squirt Bottle of Yellow-Colored Coconut Oil
Set Whirly pop on the stove (don't turn on heat just yet...)
Fill squirt bottle with coconut oil
It will most likely be solidified at this point, so just spoon it into the bottle
Microwave the squirt bottle for 25 seconds to liquify the oil
Put ½ cup of corn into popper
Add ¼ Teaspoon Flavicol Seasoning Salt to popper
Add 3 tablespoons of oil into the popper from the squirt bottle
Turn stove on medium heat, no more!
Continuously stir!
Do this for about 5-8 minutes until popping reaches a rapid pitch, then slows to about 1-2 pops per second
Remove popper from heat
Pour popcorn into large serving bowl
Using squirt bottle, add extra coconut oil to popcorn in bowl
This is what the movie theaters use for their butter topping, I like to give the corn a nice even coat.
For a more consistent experience, put half of the popcorn into the bowl, add extra oil, then add the rest of the popcorn, then add more oil.
Let the popcorn sit for about 3-4 minutes while oil soaks into the popcorn
Enjoy!
Protip: You don't need to clean out the popper each time you make movie theater popcorn, think of the popper kind of like a fryer, the extra bits add seasoning. You can leave it uncleaned as long as you are making a single recipe (don't mix caramel and movie theater without cleaning, for instance).
1 Whirly-Pop Stovetop Popcorn Maker
½ Cup of Glaze Pop Caramel Corn Popcorn Flavoring
Set Whirly pop on the stove (don't turn on heat just yet...)
Put ½ cup of corn into popper
Put ½ cup of caramel corn flavoring into the popper
Put 6 tablespoons of canola oil into the popper
Turn stove on medium-low heat, no more!
Continuously stir!
Do this for about 5-8 minutes until popping reaches a rapid pitch, then slows to about 1-2 pops per second
Remove popper from heat
Pour popcorn into large serving bowl
You may have to shake and gyrate the serving bowl to keep popcorn from clumping
Enjoy!
Protip: No matter how much to shake the bowl, the caramel corn will always clump somewhat.
As always, you can send suggestions and improvements to me directly or in the comments.
Now that you have a server, a domain name, and automatic security updates, we can finally start to host web pages.
The very first thing we need to do is set our DNS records for our host. Head over to Hover, click on your doamin, then click DNS. Now, head to Rackspace and get the IP address of your server. You'll need three records for your domain on Hover:
Host: @
Record: A
Detail: YOUR RACKSPACE IP HERE
Host: *
Record: A
Detail: YOUR RACKSPACE IP HERE
Host: www
Record: CNAME
Detail: example.com
Check out the screenshots below to look at my setup:
Next, lets get apache installed with apt-get install apache2
. Once this
is installed, we will need to disable the default hosting profile, as it
will mess up our configuration later on. Do this with a2dissite
default
.
Ok, now we'll enable the re-write module with a2enmod rewrite
. We're
doing this because we want our naked domain example.com
to point to
www.example.com
automatically. Believe it or not, example.com
is an
entirely different site than www.example.com
. We'll set up a rewrite
rule now to make that happen.
Use nano /var/www/.htaccess
to get into a text editor. Here's how I've
set up my re-write rule, just copy/paste and modify it to fit your site:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Next, lets make a directory for our website with mkdir /var/www/www.example.com
. After that, go ahead and put in a test file in that directory: nano /var/www/www.example.com/index.html
. Just put any text you want into it, its just a test site for now.
Now, we'll need to make an apache configuration file for our site, so Apache knows what to do with it. Use nano /etc/apache2/sites-available/www.example.com
to start writing it up. Apache config files aren't terribly difficult, but here's a template I use for my sites. You will need to change the siteroot
and sitename.example.com
at the very least.
<VirtualHost *:80>
ServerAdmin webmaster@email.com
ServerName sitename.example.com
DocumentRoot /var/www/siteroot
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/siteroot>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
Next, we have to tell Apache that we want to enable our site. We can do
this with a2ensite www.example.com
. Next, we'll have to either restart
or reload the server configuration, I'm just going to restart it with
service apache2 restart
. Next up, head over to your domain, you should
see your site up and running!
As always, if you feel something could be better or fixed up, let me know.
Other posts in this series:
Just in case you weren't paying attention to the sidebar, I've added some great new content to my blog over the past few weeks.
Hire Me!
page in case anyone wants to get a more in-depth look at what I've been doing with my career.In the mean time, I'll be continuing writing other posts and finding cool tricks and tips to share.
In a typical day at work, I run into a lot of locked user accounts, mostly because of mistyped passwords or misbehaving applications, and using ADUC (Active Directory Users and Computers) was getting to be a hassle. ADUC is a very powerful tool, but often it takes a long time to get started, and if the network conditions are less-than-ideal, you can run into major issues with lag and commands not completing. I needed a better way.
Scripting! The savior of us all. I decided to write two versions of this script, one that operates with PowerShell (and Active Directory module), and one that does not. The PowerShell version is much easier to use, as you only need your own admin account details and the other person's username. If you use the PowerShell-less version, you will need the full User Distinguished Name, which most of us don't have laying around. Use whichever you feel most comfortable with, and if you think they can be improved, please, be my guest.
Here are the two files:
AD Unlocker - No PowerShell Needed
@echo off
REM ABOUT: This file will unlock a user account that you specify the DN of.
REM REQUIREMENTS: Active Directory Account with Unlock permissions; DN of user you would like to unlock.
SET /P ADDomain=Your domain name:
SET /P AdminUser=Your admin username:
SET /P UserDN=Full User DN you would like unlocked:
echo "This file will unlock a user who's DN you specify."
runas /noprofile /user:%ADDomain%\%AdminUser% "dsmod user \"%UserDN%\" -disabled no"
pause
AD Unlocker - Easier to Use
@echo off
REM ABOUT: This file will unlock a user account that you specify on the command line.
REM REQUIREMENTS: Powershell with ActiveDirectory Module; Active Directory Account with Unlock permissions.
echo "This file will unlock a user who's username (sAMAccountName) you specify."
SET /P ADDomain=Your domain name:
SET /P AdminUser=Your admin username:
SET /P UserToUnlock=Username you would like unlocked:
runas /noprofile /user:%ADDomain%\%AdminUser% "%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -command import-module ActiveDirectory; Unlock-ADAccount -Identity %UserToUnlock%"
pause