Thursday, May 10, 2007
Styles Demo for Current phpBB3 Styles
read more | digg story
Monday, May 07, 2007
MAMP and MAMP Pro 1.6 released! - Mac OS X 10.4
living-e AG released a new version of their Mac OS X Apache bundle on April 27th.
This release marks only the second release of the MAMP Pro bundle, and the first with both MAMP and MAMP pro combined.
The MAMP is a free, open source utility that enables Mac OS X users to install Apache server, MySQL, PHP, eAccelerator and PHPMyAdmin with ease. Mac OS X users can download the MAMP, and with just a few clicks, install the software bundle in a folder, making it easier than ever (in typical Mac fashion) for users to host applications on their local server with MAMP, or remote server using MAMP Pro. The process takes about a minute to complete.
Requirements:
- Mac OS X 10.4 or higher (Universal binary)
- Mac OS X 10.4 PPC
- Mac OS X 10.4 Intel
- Mac OS X 10.5 PPC
- Mac OS X 10.5 Intel
Earlier versions of Mac OS X can still download older versions of MAMP from the Sourceforge file releases.
The new version carries some new upgrades including: Apache 2.0.59, PHP 5.2.1 (and PHP4), MySQL 5.0.37, support now for
the new XCache from lighttpd as an alternative to eAccelerator, which is still included in the default MAMP package, and APC support.
MAMP Pro is ideal for running on a OS X based server, as upgrading is simply drag-and-drop into the applications folder.
Since the databases are contained in the /Library/Application\ Support/MAMP\ Pro/db/ directory. And the preferences within MAMP Pro allow you to choose a localhost directory outside of the default /htdocs/ location within the MAMP package, making upgrades only seconds long.
You can download the latest distribution of MAMP from the official website: living-e.com or from Sourceforge
I’ll post some tutorials and tips for setting up the httpd.conf and php.ini configuration files for both localhost testing of your PHP applications, and secure use on a remote server later.
Enjoy!!
Sunday, May 06, 2007
How to Setup and use a GUI Database Administration Tool quickly and securely
If you have to manage MySQL or PostgreSQL databases you already know this can be fairly time consuming.
Especially if you have multiple database, multiple servers, and if you have thousands, tens of thousands, or even hundreds of thousands of records in some tables.
Not to mention how slow things applications such as phpMyAdmin and other web-based database administration tools are.
Plus, they have their own security problems, which we won’t go into now.
One of the best and most efficient ways to manage your database is through a Database GUI interface that you can run on your own computer, these are generally much faster and more secure than a web-based solution.
The following tutorial will lead you step-by-step on how to setup a remote tunnel to your server and secure it from breach attempts.
You’ll have it setup faster than it took to write this tutorial.
In this tutorial, we will directly refer to one of the most popular, and in my opinion the best multi-platform GUI database tools: navicat
What is Navicat
Navicat is an ideal solution for MySQL administration and development. It’s an all-inclusive mysql front end provides a powerful graphical interface for databases management, development and maintenance. Easy installation and intuitive interface make it an irreplaceable tool for mysql on the web or your local desktop. Navicat supports all verions of MySQL and let you converts Access to MySQL, MS SQL to MySQL, Excel to MySQL, synchronizes and backups database in a snap through import and export wizards. Major features include Visual Query Builder, Import/ Export, Report Builder, Backup/ Restore, SSH, SSL, and HTTP Tunneling, Structure and Data syncronization, Data Transfer. Navicat also supports to import data from ODBC, batch job scheduling (create schedule for Import/Export, Data Transfer and saved queries), printing of table structure. It also includes a full featured graphical manager for setting the users and access privileges. Navicat supports HTTP connection in its latest version. The program is available for Windows, Mac OS X and Linux and supports multiple languages.
You can also check out SQL Maestro
There are many, many other tools available for Windows, Mac OS X, Linux and other platforms as well.
Do a search on google for GUI Database Admin Tool
-- Note that MySQLi is not a database, it’s simply MySQL enhanced with the MySQLi PHP extension.
This tutorial will work with any Graphical database management tool that support HTTP tunneling.
There are also other methods of tunnel access, such as SSL or SSH tunnels.
Basic Instructions:
In the Navicat MySQL package, it contains a PHP file called
ntunnel_mysql.php. Upload the provided file to a password and/or IP protected directory on your webserver.
Open a new connection in Navicat, fill out the required fields in the connection properties.
Go to the HTTP tab and enter the URL of the path to the
ntunnel_mysql.php file.Turn your Server MySQL port (default 3306 off, or ask your host how)
Detailed instructions
You can rename
ntunnel_mysql.php to something you only you would know... some obscure name.But for the sake of consistancy, we will still refer to it as "ntunnel_mysql.php".
Upload the tunnel file to an obscure directory on your server, we’ll call it
/secure_stuff/ in our example.This, by default, is all you need to get Navicat to connect.
Go to Navicat Create new connection.
Enter
localhost as your hostname (if you were not using a tunnel, you would specify the hostname or IP address of your server), the MySQL port that it will connect to through the tunnel, and the database username and password that can connect to all of your databases on your server.You don’t need to specify a Setting Save Path initually unless you want the setting saved to a specific location.
If your MySQL database supports it, enable MySQL Character Set and Default encoding of UTF-8, which is required for use with phpBB3.
Once complete, go to the HTTP (tab)
[√] Use HTTP Tunnel
Tunnel URL:
http://your_website.tld/secure_stuff/ntunnel_mysql.php--> Test connection
If it works, great! you don’t have to do anything else, but as a security recommendation, follow the below advanced options.
Advanced Options
Password protect your directory. -- This is the #1 best security option.
If your host control panel (for your website) has the ability to quickly and easily password protect your "secure_stuff" directory, use that. (a default feature with most/all CPs, such as cPanel, Plesk, WebAdmin, VHCS and vDeck)
Then in Navicat > Your Server > Connection Properties > HTTP (tab)
[√] Use Authentication
Enter your username and password.
Save password if you don’t want it to prompt you for the password every time you connect to your server. (usually once or twice a day for me)
If your host does not easily give you the ability to password protect a directory, follow these instructions:
(These instructions are modified from JavascriptKit
The first thing you will need to do is create a file called
.htpasswd -- similar to the .htaccess file. The "." hides the file. In the htpasswd file, you place the username and password (which is encrypted) for those whom you want to have access.For example, a username and password of my_username (and I do not recommend having the username being the same as the password), the htpasswd file would look like this:
my_username:y4E7Ep8e7EYV
Notice that it is username first, followed by the Password.
There is a handy
For security, you should not upload the htpasswd file to a directory that is web accessible
(i.e. DO NOT put it in a location like:
http://yourwebsite.tld/.htpasswd; Instead, it should be placed above your web root directory. (i.e. /usr/var/.htpasswd)You'll be specifying the location to it later on, so be sure you know where you put it. Also, this file, as with htaccess, should be uploaded as ASCII and not BINARY.Create a new htaccess file and place the following code in it:
AuthUserFile /usr/local/you/safedir/.htpasswd
AuthGroupFile /dev/null
AuthName EnterPassword
AuthType Basic
require user my_username
The first line is the full server path to your htpasswd file. If you have installed scripts on your server, you should be familiar with this. Please note that this is not a URL, this is a server path.
Save and upload your .htaccess file to the
/secure_stuff/ directory (as an example) Also note that if you place this .htaccess file in your web root directory, it will password protect your entire site, which probably isn't a good idea.So just make sure it’s in the same directory as the Navicat Tunnel file.
The second to last line require user is where you enter the username of those who you want to have access to that portion of your site. Note that using this will allow only that specific user to be able to access that directory. This applies if you had an htpasswd file that had multiple users setup in it and you wanted each one to have access to an individual directory. If you wanted the entire list of users to have access to that directory, you would replace Require user xxx with require valid-user.
The AuthName is the name of the area you want to access. It could anything, such as "EnterPassword". You can change the name of this 'realm' to whatever you want, within reason.
We are using AuthType Basic because we are using basic HTTP authentication.
If you also want to restrict IP access, see the following instructions.
If you have already password protected your directory, there is no real need to do IP restricting, especially since it limits the locations you can access your database from (i.e. only home and/or work, but not while traveling -- not easily, anyways).
-- of course, if you’re like me, you restrict IP access anyways, as you can always grant yourself permission by editing the .htaccess file and adding (usually temporarily) the IP address of your location, such as hotel or conference center.
To IP restrict access to the
/secure_stuff/ directory.Save a new
.htaccess file in the same directory as your tunnel file.
order deny,allow
deny from all
allow from 12.34.567.890
allow from 12.345.67.890
You can specify as many IP addresses as you wish, each one on a newline, such as where you work, your home, internet café or wherever else you might access your Database from.
Finally, don’t forget to deactivate or change your default MySQL port, and delete or deactivate your web-based SQL database access tools such as phpMyAdmin.
Or you can restrict the MySQL port to only allow internal use (127.0.0.1 and/or localhost) instead of turning it off completely. -- or if you are like me, just activate the firewall and prevent 3306 from being accessed outside of the server completely.
And finally, let me know if this tutorial helped you.