Showing posts with label Database. Show all posts
Showing posts with label Database. Show all posts

Saturday, April 16, 2011

Install Joomla! 1.6 on IIS 7

In the previous post Joomla! Installing XAMPP on Vista I described installation of the XAMPP package for Windows 7 and Vista. XAMPP package installs Apache web server, MySQL database, phpMyAdmin, FileZilla FTP Server and many more. With XAMPP it is really easy to install and configure Joomla!.

In this post I will show how to install Joomla! 1.6 on IIS7 on Vista or Windows 7.  I will be performing installation on Windows 7 with no IIS installed. We will install PHP support for IIS 7, MySQL database (I will not be covering installation of Joomla! with SQL Server just yet), phpMyAdmin for maintaining databases.

In my first attempts. I tried to install Joomla! using Windows Platform installer from Microsoft/web site, which did not work completely. Installer did not install properly IIS, failed to register PHP with IIS 7, did not configure MySQL and I got mixed up with credentials for Joomla! and MySQL. My decision was to start over and  install all required components manually.

Before we begin

In my explanations of the steps below I will assume that you are familiar with installation of basic windows components. I will only note most important points of the installation. If you require detailed explanation of the some of the installs I will provide reference section with links to sites with more detailed steps.

Install IIS 7

In this step we will perform basic installation of IIS 7. Open Control Panel>Programs>Program and Features>Turn Windows Features on or off.


Navigate to Internet Information Services and make sure you tick it first. It will select all required modules to run IIS7. Then expand tree to navigate to Application Development Features and tick CGI. I will be also doing ASP.NET development so I ticked ASP.NET Development and this also selected .Net Extensibility and other required modules. If you do not need any of the .Net features, don’t tick it. CGI component is needed to use FastCGI module of the PHP package, which we will be installing in the step below. Click OK.


When installation is complete open http://localhost to see if it installed OK. You should see similar screen to one below.


Installing PHP support for IIS7

Now we are going to install PHP support for IIS 7. Download latest PHP windows package from site.


Now follow installation Wizard steps.


In the Web Server Setup select IIS FastCGI module. Click Next.


I selected to install all items including Register *.php to open automatically with PHP.


Click Finish.

I would also suggest installing PHP Manager for IIS package. It will add PHP configuration module into IIS Console.


This is an example PHP configuration screen. I find it is handy when you need to do some tweaks to PHP configuration.


Copy Joomla! CMS files to ISS 7

In this step we are going to copy Joomla! package files into C:\inetpub\wwwroot folder and create JoomlaDev Web Application to see if we can run PHP web sites. Configuration of Joomla! site will be done after completing of the MySQL database server installation. Download Joomla! CMS package from the site. Unzip it and copy folder to ISS7 directory C:\inetpub\wwwroot. I named folder as JoomlaDev. Open IIS Management Console. Right click Default Web Site and select Add Application.


Enter fields as shown above if you are using the same names. Click OK.


JoomlaDev Application is created. Use Browse to open the site. If everything OK you should see the screen below.


Install MySQL on Windows 7 or Vista

Congratulations if you got that far, but don’t get too excited as we got a little be more work to do. Now we are going to install MySQL server. I am not going to cover using Joomla! with SQL Server here. This can be a topic for future posts. We need to  download, install and configure MySQL database and phpMyAdmin package for managing databases. Get MySQL Community Server from site. PhpMyAdmin can be downloaded from site.


Run MySQL Installation Wizard.


Run through wizard steps and click Install at the end.


Leave Launch the MySQL Instance Configuration Wizard tick box on and click Finish.


This will open MySQL Server Instance Configuration Wizard.


We will go through the Detailed Configuration steps. Click Next.


This is a Development Machine, so this option is what we need.


Leave as it is on Multifunctional Database and click next.


Installation Path as a location for database files will be fine.


I do not expect a lot of connection during development work, but I like to have more options at hand so I selected Online Transaction Processing Option. You can select what is more suitable in your case.


All looking good. Tick Add firewall exception for this port to enable access for phpMyAdmin. phpMyAdmin uses TCP/IP connection by default. If you are worried about security you can setup phpMyAdmin to use socket connection. It is possible in our case to use socket as we are installing MySQL server on the same machine as IIS 7 web server.


I am developing website in English and Russian Languages so the second option is the best one for me. Click Next.


We will set our Database Instance Name as MySQL. I like to perform some commands in the command prompt so I also ticked Include Bin Directory in the Windows PATH.


Enter a password for root. This is a development database and will not be accessed outside development machine. So I did not ticked Enable root access from remote machine or Create An Anonymous Account. For build and testing servers I will use a different installation of MySQL and IIS 7. Click Next.


Excellent! Click Execute when you are ready.


We are done! Click Finish.

Install and Configure phpMyAdmin

Installation of MySQL Server is done. Now we are going to configure phpMyAdmin package, which will help us to manage MySQL Databases. If you haven’t downloaded phpMyAdmin from previous step download it from site. Unzip package and copy it to C:\inetpub\wwwroot directory. Open IIS 7 Management Console and create new web application in a similar way how we created web application for our Joomla! install.


I named folder and Web Application as phpMyAdmin. After clicking OK use browse to open http://localhost/phpMyAdmin/. You will get the screen below.


Enter root as username and your root password, Click Go.


I got in! I was really impressed that without any additional configuration phpMyAdmin detected local MySQL Server and the setup is done!


Congratulations ones more time on the going through this rather lengthy post. Don’t get disappointed that you do not see Joomla! configuration steps here. There are very easy and straightforward. I am planning to post Joomla! configuration steps in the future post. This and the other posts will be part of the Creating Joomla! Development Environment series. Don’t forget to check out some references for more information.



Tuesday, September 1, 2009

Joomla! Installing XAMPP on Vista

Currently I am working on installing Joomla! content management system and as a first step it requires to install XAMPP package. After some time of tweaking I finally managed to install and run XAMPP package on Vista. XAMPP installation completed fine and basic configuration steps made no problems. All services except Apache started.


Turned out that service was unable to start, because Apache process had no access to “C:\Program Files\xampp” directory. I decided to give SYSTEM account access to it and run Apache, MySql and FileZilla as windows services. To give access to SYSTEM account open properties of the directory and Security Tab.


Check that it has full access rights assigned. If not, use Edit button to assign access rights.

After trying to start Apache service again it still was failing to start. Apache log in C:\Program Files\xampp\apache\logs\error.log showed the following error.

“(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions.  : make_sock: could not bind to address [::]:80”

This error happens when some process already uses port 80. My solution was to change “C:\Program Files\xampp\apache\conf\httpd.conf” file and set port to something else like 8080 or any other number. Edit lines “Listen 80” and “ServerName localhost:80” to be  “Listen 8080” and “ServerName localhost:8080”. Start Apache service. Success!

The next step will be to install Joomla! I will publish another post if there will be problems that required solution during install.


Tuesday, June 2, 2009

Free Windows Software Development Tools

Here is a list of free development tools I found useful and also popular in Software Development.
Large Text File Viewer - this program was designed for viewing large (>1GB) text files.

KompoZer - is a complete web authoring system that combines web file management and easy-to-use WYSIWYG web page editing.

UMLet - is an open-source UML tool with a simple user interface.

OpenProj - is a free, open source desktop alternative to Microsoft Project. It's available on Linux, Unix, Mac or Windows.

WinSCP - free SFTP and FTP client for Windows.

VMWare Server – run other operating systems on the same computer.

Microsoft SQL Server Management Studio Express - is a free, easy-to-use graphical management tool for managing SQL Server 2005 Express Edition and SQL Server 2005 Express Edition with Advanced Services.

Liquid XML Studio Free - XML Developers Toolkit and IDE.

ToDoList - A simple but effective way to keep on top of your tasks.

Microsoft Visual Studio

Visual Studio 2005 Express Edition - Easy way to start development with Microsoft tools.

Visual Studio 2008 Express Edition - Easy way to start development with Microsoft tools.

Subversion Tools

TortoiseSVN - A Subversion client, implemented as a windows shell extension.

Commit Monitor - is a small tool to monitor Subversion repositories for new commits.

SVN (Subversion) - version control system that is a compelling replacement for CVS in the open source community.

SVN Notifier - is a simple and useful tool to monitor your Subversion project repository for changes.


Tuesday, April 7, 2009

How to clone DataRow and get its auto-incremented ID number after inserting into Access Database

In my work with Access Database I needed to duplicate an existing row in the table and get an ID of newly inserted row. Below are short snippets of code showing how.

Duplicating a DataRow

// load the data into Data Table
DataTable dataTable = tableAdapter.GetData();

// clone a Data Table
DataTable duplicatedDataTable = dataTable.Clone();

// get row to duplicate
DataRow row = dataTable.Rows[0];

// import row into cloned Data Table

This way we get a deep copy of the existing row and later use table adapter to insert it into database.

Getting auto-incremented ID number after inserting a row into Access Database

The actual idea of getting an auto-incremented ID of the new row in Access Database is very simple. Right after insert of the row we need to execute similar query to this one:


In order to avoid loading wrong ID in multi-user environment it is good to add some WHERE selection criteria which will limit selection only to duplicated rows. MAX function will pick the ID of the last inserted row.


Tuesday, January 27, 2009

ASP.NET Access DB write problem

Recently I was working on simple ASP.NET website that had to update Access Database. Everything was fine during development when I was using ASP.NET Development Server created by Visual Studio. Later when I connected with Internet browser to http://localhost/mywebsite/Default.aspx I started getting two kind of unhandled exceptions on Database insert and update.

Microsoft JET Database Engine error '80004005'

The Microsoft Jet database engine cannot open the file 'C:\DB\YourDatabase.mdb'. It is already opened exclusively by another user, or you need permission to view its data.

or this one

Microsoft JET Database Engine error '80004005'

Operation must use an updateable query.

After looking on the internet I found a couple of links that shed some light on this problem.

How Do I Fix ASP 80004005 errors? - Imar.Spaanjaars.Com

An unhandled exception may occur when you try to connect to an Access database from an ASP.NET worker process.

I tried to fix a problem by following instructions on these pages, unfortunately adding permission for IUSR_MyComputerName system user to access DB folder did not make a difference. The quick and easy (and NOT RECOMMENDED for production installation) solution is to add Everyone to access to DB folder and write to database. I want to repeat that this is not a good solution for security reasons, my preference is to try to change an account under which IIS service is running. I will post my solution later once I get it working.


How to configure file sharing in Windows XP