• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

Archives for December 2013

Install PhpMyAdmin on Mac

December 27, 2013

This article covers how to install PhpMyAdmin on Mac OS X. PhpMyAdmin is a software tool written in PHP to manage and administer MySQL databases. It supports not only MySQL, but also MariaDB and Drizzle databases. PhpMyAdmin supports a variety of database operations such as managing databases, tables, columns, relations, indexes, users, and permissions.

This article is part of a series of articles on how to manually install Apache, PHP, MySQL on the Mac OS. Installing the popular MAMP application is as simple as installing any other application on the Mac, but it will not give you any valuable learning experience, nor will you have complete control of your development environment. I recommend manually installing the individual applications to maximize your learning experience.

How to Install PhpMyAdmin on Mac OS X

To install PhpMyAdmin, download the latest version.

Unzip the file and rename the folder to ‘phpmyadmin.’

Move the ‘phpmyadmin’ folder to ‘/usr/local/phpmyadmin.’

$ sudo mv phpmyadmin /usr/local/phpmyadmin

$ sudo mv phpmyadmin /usr/local/phpmyadmin

Copy the config.sample.inc.php to config.inc.php.

$ cd /usr/local/phpmyadmin
$ sudo cp config.sample.inc.php config.inc.php

$ cd /usr/local/phpmyadmin $ sudo cp config.sample.inc.php config.inc.php

Create a config file in ‘/etc/apache2/other.’

$ sudo touch /etc/apache2/other/phpmyadmin.conf

$ sudo touch /etc/apache2/other/phpmyadmin.conf

Edit the config file.

$ sudo nano /etc/apache2/other/phpmyadmin.conf

$ sudo nano /etc/apache2/other/phpmyadmin.conf

Add the following:

Alias /phpmyadmin /usr/local/phpmyadmin
<Directory /usr/local/phpmyadmin>
    Options Indexes
    Order allow,deny
    Allow from all
</Directory>

Alias /phpmyadmin /usr/local/phpmyadmin <Directory /usr/local/phpmyadmin> Options Indexes Order allow,deny Allow from all </Directory>

Restart Apache

$ sudo apachectl restart

$ sudo apachectl restart

Finally, access PhpMyAdmin from your browser. Example: http://localhost/phpmyadmin

Filed Under: Mac Tagged With: phpmyadmin

Install MySQL on Mac

December 27, 2013

This article shows you how to install MySQL on the Mac OS X. MySQL is an open-source relational database management system used in majority of websites on the Internet. MySQL works on many platforms including Windows, Mac and many flavors of the Linux OS.

This article is part of a series of articles on how to manually install Apache, PHP, MySQL on the Mac OS. Installing the popular MAMP application is as simple as installing any other application on the Mac, but it will not give you any valuable learning experience, nor will you have complete control of your development environment. I recommend manually installing the individual applications to maximize your learning experience.

How to Install MySQL on Mac OS X

First, download the MySQL dmg archive for the Mac OS.

Install the following 3 items:

  1. MySQL package
  2. MySQL Startup Item package
  3. MySQL Preferences Pane

Add the MySQL path to your existing path so you can invoke MySQL commands from anywhere.

$ export PATH=/usr/local/mysql/bin:$PATH

$ export PATH=/usr/local/mysql/bin:$PATH

Secure the database. You’ll be prompted to provide a new MySQL password.

$ sudo mysql_secure_installation

$ sudo mysql_secure_installation

Make sure MySQL is connected to Apache and PHP.

cd /var 
sudo mkdir mysql 
cd mysql 
sudo ln -s /tmp/mysql.sock mysql.sock

cd /var sudo mkdir mysql cd mysql sudo ln -s /tmp/mysql.sock mysql.sock

Access MySQL from the Terminal. Provide your password when prompted.

$ mysql -u root -p

$ mysql -u root -p

Once logged in, you can check the databases just to be sure you’re connected.

mysql> show databases;
exit;

mysql> show databases; exit;

Filed Under: Mac Tagged With: mysql

Install PHP on Mac

December 27, 2013

This article will show you how to install PHP on the Mac. By default, Apache and PHP are already installed on the Mac, although both are not activated. We must first enable Apache. Once you’ve Apache is enabled, you can then proceed in activating PHP.

This article is part of a series of articles on how to manually install Apache, PHP, MySQL on the Mac OS. Installing the popular MAMP application is as simple as installing any other application on the Mac, but it will not give you any valuable learning experience, nor will you have complete control of your development environment. I recommend manually installing the individual applications to maximize your learning experience.

How to Install PHP on Mac OS X

PHP is already installed. We just have to enable it. Edit the ‘/etc/apache2/httpd.conf‘ file.

$ sudo nano /etc/apache2/httpd.conf

$ sudo nano /etc/apache2/httpd.conf

Uncomment or delete the ‘#’ sign for the line that contains the text below.

LoadModule php5_module libexec/apache2/libphp5.so

LoadModule php5_module libexec/apache2/libphp5.so

Restart Apache

$ sudo apachectl restart

$ sudo apachectl restart

Place a index.php file that contains the following in your web server root.

<?php phpinfo(); ?>

<?php phpinfo(); ?>

If you see PHP info and stats, that means PHP is working! If you see the code, it means PHP is not working.

Filed Under: Mac Tagged With: php

Apache Virtual Host on Mac

December 26, 2013

Creating an Apache virtual host on your Mac is quite easy. Assuming you already have Apache installed and running on your Mac, you will now have to decide whether to serve your pages from the default web root, or create your own virtual host, and serve your pages from an alternate location.

This article is part of a series of articles on how to manually install MAMP or Apache, PHP, MySQL on the Mac OS. Installing the popular MAMP application is as simple as installing any other application on the Mac, but it will not give you any valuable learning experience, nor will you have complete control of your development environment. I recommend manually installing the individual applications to maximize your learning experience.

Create an Apache Virtual Host on Mac OS X

Edit the /etc/apache2/httpd.conf file using the nano editor.

$ sudo nano /etc/apache2/httpd.conf

$ sudo nano /etc/apache2/httpd.conf

Look for the text ‘# Virtual hosts’ located at the end of the file. Uncomment by removing # from the line that says:

Include /private/etc/apache2/extra/httpd-vhosts.conf

Include /private/etc/apache2/extra/httpd-vhosts.conf

Save file and exit. If your not familiar with nano, it’s Ctrl-O for save, and Ctrl-X for exit.

Now edit the https-vhosts.conf file.

$ sudo nano /private/etc/apache2/extra/httpd-vhosts.conf

$ sudo nano /private/etc/apache2/extra/httpd-vhosts.conf

Append the following at the end of the file:

<VirtualHost *:80>
	DocumentRoot "/Users/Ulysses/Sites/"
	ServerName ulysses.dev
	ErrorLog "/private/var/log/apache2/ulysses.dev.local-error_log"
	CustomLog "/private/var/log/apache2/ulysses.dev.local-access_log" common
	<Directory "/Users/Ulysses/Sites/">
		AllowOverride All
		Order allow,deny
		Allow from all
	</Directory>
</VirtualHost>

<VirtualHost *:80> DocumentRoot "/Users/Ulysses/Sites/" ServerName ulysses.dev ErrorLog "/private/var/log/apache2/ulysses.dev.local-error_log" CustomLog "/private/var/log/apache2/ulysses.dev.local-access_log" common <Directory "/Users/Ulysses/Sites/"> AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>

In this example, I am using an alternate web root located at ‘/Users/Ulysses/Sites/.’ In addition, I’m also using a made-up domain called ‘ulysses.dev.’ I used .dev because it’s not a real top level domain or TLD. There won’t be a conflict with a real existing domain on the Internet. You can use any domain or TLD that you like.

The final step. Edit your hosts file to add your domain. This step is very important since we are using a made-up domain that doesn’t exist. By editing our hosts file, we are spoofing our system that a host does exist.

$ nano /private/etc/hosts

$ nano /private/etc/hosts

Add the following domain at the end of the line. 127.0.0.1 is the loopback address of your system.

127.0.0.1  ulysses.dev

127.0.0.1 ulysses.dev

Save file and exit.

Restart Apache

$ sudo apachectl restart

$ sudo apachectl restart

From the terminal ping your domain.

$ ping ulysses.dev

$ ping ulysses.dev

Write permissions

The Apache user on the Mac is _www and is part of the staff group. To make the Sites folder writeable to the Apache _www user, perform the following commands from the Terminal.

cd /Users/Ulysses
$ sudo chown -R _www:staff Sites
$ sudo chmod -R 755 Sites

cd /Users/Ulysses $ sudo chown -R _www:staff Sites $ sudo chmod -R 755 Sites

Finally, open up your browser and access your domain. In this example, http://ulysses.dev.

Filed Under: Mac Tagged With: apache, virtual host

Install Apache on Mac

December 26, 2013

This article will show you how to install Apache on the Mac OS. This is ideal if you want to use your Mac desktop or laptop as your development environment, a place where you can test code, scripts, themes, plugins without affecting your production environment.

This article is part of a series of articles on how to manually install MAMP or Apache, PHP, MySQL on the Mac OS. Installing the popular MAMP application is as simple as installing any other application on the Mac, but it will not give you any valuable learning experience, nor will you have complete control of your development environment. I recommend manually installing the individual applications to maximize your learning experience.

Apache is the widely popular web server that runs on multiple platforms including Linux, Mac OS and Windows. Some people might be surprised to know that Apache is already installed and included on the latest Mac OS X Mavericks. All you need to do is turn it on. You can do so by accessing the Terminal and typing the following:

How to Install Apache on Mac OS X

Start Apache

$ sudo apachectl start

$ sudo apachectl start

You should be able to see ‘It works!‘ if you access ‘http://localhost‘ from your Safari, Chrome or Firefox browser.

In addition, you can also stop and restart Apache using the commands below.

Stop Apache

$ sudo apachectl stop

$ sudo apachectl stop

Restart Apache

$ sudo apachectl restart

$ sudo apachectl restart

By default, the web root for the Apache web server is located at ‘/Library/WebServer/Documents/.’ In the directory, you’ll find a document called ‘index.html.en‘ which contains the code that displays ‘It works!‘

<html><body><h1>It works!</h1></body></html>

<html><body><h1>It works!</h1></body></html>

It works!

Finally, you can now move your HTML pages to the ‘/Library/WebServer/Documents/‘ folder to serve pages. The other option is to create a virtual host within Apache which I will cover in my next article.

Filed Under: Mac Tagged With: apache

Linode Manager On Android

December 26, 2013

Linode Manager is the official Android mobile application for Linode. With this application, you’ll be able to manage and administer your Linodes from anywhere in the world. Here’s a list of things that you can do with this smart phone application:

  • Create, remove, boot, and reboot Linodes
  • Access Linodes via SSH and Lish
  • Resize Linodes on the fly
  • Keep tabs on your Linodes performance with CPU, network, and IO utilization graphs
  • Create and manage NodeBalancers and domain zones
  • Access the complete Linode Library
  • Manage your Linode account and make payments

Linode Shell or Lish for short, works primarily with a web browser console in this app. I prefer Chrome with Lish. SSH seems to look for an app called Connectbot. Unfortunately, I couldn’t get SSH to work because it defaults to port 22. I use a different port for SSH, an added security to my Linode.

Having access to the shell terminal from a smartphone is a nice feature to have. Perhaps, you can do perform a couple of updates or simple maintenance functions. However, I prefer to use my desktop if I were to do anything drastic to my Linode.

Filed Under: Linux Tagged With: android, linode

Nano History Error

December 20, 2013

I experienced a “nano” editor error this morning. It displayed this:

Error reading /home/ulysses/.nano_history: Permission denied
Press Enter to continue starting nano.

Error reading /home/ulysses/.nano_history: Permission denied Press Enter to continue starting nano.

The error doesn’t prevent you from using the nano editor, but it displays an annoying message. You have to press the Enter key each time you want to use the editor. I’m not sure how I manage to make the nano editor behave this way. I probably edited a file in my home directory while I was root. It’s a common mistake.

So, when accessed as a regular user, I simply didn’t have permissions to the nano history. A simple fix for this is to delete the .nano_history file while logged in as root. Switch back as a regular user and run nano again. Nano will re-create the history file the next time you use it.

$ sudo rm /home/ulysses/.nano_history

$ sudo rm /home/ulysses/.nano_history

That should take care of it.

Filed Under: Linux Tagged With: nano

Mac Pro

December 18, 2013

Apple Mac Pro will go on sale tomorrow. The cylindrical high-end desktop is made and assembled in the USA and priced somewhere between $3000 to $4000. The lower end unit features a 3.7 Ghz quad-core Intel Xeon E5 processor, 12 GB of RAM, two FirePro D500 graphics processing units and 256 GB of flash storage.

The high-end unit will have upgrade to faster processors, more memory and 1 TB of SSD flash storage. The Mac Pro is geared towards movie editors that need lots of processing power. The Mac Pro is available at Apple.com, Apple stores and select resellers.

The Mac Pro can support up to three 4K Ultra HD video displays at once. It also has six thunderbolt ports which support up to six displays as well.

Filed Under: Mac Tagged With: apple, mac pro

  • Go to page 1
  • Go to page 2
  • Go to Next Page »
  • Home
  • About
  • Archives

Copyright © 2023