I know that posting your mistakes on a portfolio is probably not considered a wise thing, but as I stated in my first blog post – I’m not exactly CLI/UNIX savvy. Well, let me tell you a story about what I did the other night.
I was getting sick of PHPMyAdmin kicking me out constantly, so I wanted to go into the config.inc.php file and set the cookie length to something higher. Well, Ubuntu was throwing a fit saying I didn’t have the permissions to save in that directory.
What did I do?
sudo chmod -R 0777 /
Yeah, that’s right. I set the permissions for my entire distro to global access, thinking I was going to recurse through my current working directory. This made Sudo extremely upset with me. I thought there was something I could do to redeem it. I was mostly concerned because I had started adding listener events into my application and I wanted to maintain that progress before I had to do anything drastic.
I couldn’t seem to do anything to repair the damage, so I had to reformat. Thank the open-source genies for including one of the most useful concepts I’ve ever even seen in the operating system world – Ubuntu’s Try It function. With this, I was able to snag my Vinticuffs folder and upload it to Dropbox. Then I reformatted, cloned my repo from GitHub and copied my archived files into it. Got back up and running quite quickly.
I’m quite impressed by the amount of time it took me to redeem such a terrible stupid mistake with UNIX. If this was Windows, I’d have probably still been installing my GFX drivers, updating Windows itself and going through the headache of installing all these different applications. Then again, I guess if I was using the Ubuntu machine as a main PC, I’d still be suffering from having to install my GIMP/IDEs/FTPs/Games, etc. At the same time though, I got my LAMP stack back up and running – apparently found some interesting mistakes as well within my original code (apparently some of my validation rules didn’t like not being in an array this time..?).
So it’s all up and running again. Here’s the shortcut ideology of how I went ahead and got back up and running in about 2 hours.
1.) Installed Ubuntu
2.) Installed LAMP
sudo apt-get install tasksel
sudo tasksel install lamp-server
3.) Installed PhpMyAdmin
sudo apt-get install phpmyadmin
4.) Installed SSH, so I can BASH from my PC
sudo apt-get install openssh-server
5.) Attempted to install MCrypt (required by Laravel, also it seems like it was installed come
this point – but hell I’ll do it anyways, lol)
sudo apt-get install php5-mcrypt
6.) Apache2 Mod_Rewrite
sudo a2enmod rewrite
7.) Recreated my Vinticuffs Apache site
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/vinticuffs
sudo a2dissite default && a2ensite vinticuffs
Mind you, by now – if you go to http://localhost in your web browser, you should be getting the normal LAMP welcome message by now. If not, then I might be able to help you. Give me another day of messing up my Ubuntu installation and I’ll totally master this.
8.) Edit your current site to point towards your directory. In this case, I’m using Laravel 4, Laravel 4 itself focuses on the /public/ directory for it’s content delivery. If you don’t point there, your members will get a generic index page where they’d have to select the public folder — and they also have slight access to your website’s structure.
sudo nano /etc/apache2/sites-available/vinticuffs
In this file, you want to change a couple of things
DocumentRoot should point at your current directory for the website, in my case it’s /home/username/public_html/vinticuffs/public
Change the second bracket of
While you’re at it, change AllowOverride None to AllowOverride All
9.) Install the configuration panel for Sambia and set it up if you’re working on a Windows machine.
Check out Richard Worloma’s tut, Share Files Between Windows 7 and Ubuntu 12.10 (Quantal Quetzal)
10.) We should be done with this, go ahead and reset your Apache server.
sudo /etc/init.d/apache2 restart
After this, I proceeded to install Git and cloned my repo – set up Git as needed and went ahead and overwrote my changes from the Dropbox back up and then pushed those changes.
Seems like I’m back up into working condition – so that’s all good.
Now back to focusing on developing Vinticuffs, currently working on some looping ideas that might help drive desire to be on the site. Hope it’s all successful!
If you stumble across this, and need a little bit of help with setting up LAMP or anything for web development, please ask – I’ll either try to help you, or point you in the right direction.