19/03/2012 2:00 am --
Reading this title is very strange for me ! I never thought of writing an article on eZ Publish, Windows and Oracle !
But, the customer is the king and for several reasons, sometimes, we have to install specials architectures.
First, I must say, that it's not a good advice to install eZ Publish on Windows, my advice is to install it on Linux!
The choice of the database implementation is more complicated, personnaly I like MySQL but Postgres is good too. (Oracle? why not, but if you have reals reasons and money)
End of this introduction, let's you enter into a new world.
I'm not a Windows expert, and this article shows the point of view of a Linux user.
1. Windows and Oracle Installation
Windows OS installation is not very funny, so I will skip this part.
And, happy me, I only had to install eZ Publish over an existing Oracle database 11g.
I think an Oracle installation is a real big work, it can't be resumed simply, so I will skip this too. I only want to explain the eZ Publish installation.
2. PHP and Internet Information Server 7.x
2.1 IIS 7
eZ Publish Community 2012.2 can run on IIS 7 and PHP5 (http://doc.ez.no/eZ-Publish/Technical-manual/4.6/Installation/Requirements-4.6).
As you know, eZ Publish needs somes rewrite rules, so you will have to install the Microsoft URL Rewrite Module 1.1.
The IIS 7 installation begins with : Control panel > Get programs, and you can add "Internet Information Server".
This step is really simple and quick.
When it's finished, configure the default site to set the DocumentRoot of your eZ Publish installation.
Create a new file index.html in you DocumentRoot in order to test your webserver : http://localhost. (localhost, I assume that you are working on the Windows web server)
The next step is the installation of the Microsoft URL Rewrite Module 1.1 : double click and proceed this installation.
Don't be impatient, you will add the RewriteRule for eZ Publish later.
Note: I'm not a expert on Windows, but at this time, I searched where to set the IIS user. I didn't find this information.
I had some rights problems during my entire installation, but I think they are related to the security policies of the company.
2.2 PHP 5
When IIS 7 is running, you need to install PHP (5.3.10 for now). Here, you can download the Window Installer (.msi) of the thread safe version.
When you install this msi, choose the IIS Fast CGI mode.
Concerning the extensions, choose as you want.
If, like me, you want to install eZ Publish with Oracle, you have to install oci8 driver but choose the mysqli driver too. (I will explain later why)
Now, you can create a index.php with a phpinfo() to see your PHP installation configuration.
At this time, you would change the php.ini parameters for your server, but, it's not so easy !
I don't know why but my changes in the php.ini had no effect. After some research on my best friend Google, I installed a new module on IIS "PHP Manager". It saved my life !
Through this manager, I could change the php.ini configuration correctly.
Note: It's very strange on Windows, the PHP Manager gave me a path for the php.ini (the same path as in the phpinfo()), but when I modified this file manualy, it didn't change anything.
Double check this configuration with a php.exe -i in the command line.
Note: If some things are strange don't hesitate to restart some services like
- FastCGI settings
- PHP Manager
- The OS (if you want to be sure)
Note: I'm sad to say that but we are on Windows...
2.3 PHP - Oracle
2.3.1 Database driver installation
The Oracle database installation was already done. But on the web server, there was neither the oracle client, nor the good library.
As this time, when I launched the php.exe in a command line I had this error : "OCI8.DLL not found". Later on, I found I have the same in the PHP error log.
Even if your OS is in 64bit mode, you have to download the Instant Client for Microsoft Windows (32-bit), because PHP for Windows works only in 32bit mode.
Follow the installation instructions and don't forget to correctly change your PATH variable environment.
3. eZ Publish with eZ Oracle 2.x
eZ Systems provides an extension eZ Oracle to handle the Oracle database implementation. The documentation is very clean and usefull.
Be careful when you download the package. The documentation shows a link to http://projects.ez.no/ezoracle, but on this project, there is a important note ( at the bottom of the page) to go on Github.
Finally, with eZ Publish Community 2012.2 use eZ Oracle 2.3 and download it directly from Github : https://github.com/ezsystems/ezoracle
My mission was to install an new eZ Publish on this architecture.
3.1.1 Fisrt way, but is not the good one for me
The eZ Oracle setup instructions explains how to install the extension, import the eZ schema and the eZ data.
But after that, you have to continue the eZ Publish installation process manually. You can't use the standard installation process using the browser (Mail, Databases, languages, siteaccess settings etc…)
And you have to install the imported packages manually too. (ezwebin, ezflow etc...)
I first tried this method, but I canceled.
Now, I know the second method works perfectly, I advise you to use it.
3.1.2 Second way
It's more easy when you come from Linux to install a new eZ Publish on your Linux. (5-20 minutes max).
So I do a new installation on Linux, Apache, and MySQL on my Debian virtual machine.
At this time, my task wasn't to install an new eZ Publish but to migrate an existing one to Windows and Oracle. So, I just had to :
- move the eZ Publish files from my Linux installation to the Windows DocumentRoot
- quick install the eZ Oracle on this eZ Publish
- unpack in extension directory
- in override/site.ini.append.php add ActiveExtensions=ezoracle in ExtensionSettings section
- regenerate the autoloads ( php bin/php/ezpgenerateautoloads.php -e)
- migrate the MySQL database to the Oracle database.
The last step can be complicated ! But no, eZ Oracle include a script to do that perfectly !
Note: Naturally, you can do that without installing MySQL on you Windows Server. The MySQL server on your virtual machine will do the job.
3.2 Migrate from your LAMP installation
You just have to copy all files and be careful about the rights.
3.2.2 Rewrite Rules
It's time to install the Rewrite Rule.
To do that, simply add this file : web.config into the DocumentRoot. Like a .htaccess file, IIS will read it.
I assume you have already an Oracle database with the good eZ Oracle requirements.
The eZ Oracle documentation explains how to migrate from MySQL, I will only explain these commands :
Note: Unusually on eZ Publish, you have to run this command in the extension/ezoracle/bin/php directory.
php mysql2oracle-schema.php YOURMYSQLDB:mysqluser/mysqlpassword@YOURLAMPMySQLSERVER --drop > mydump.sql
This command dumps your MySQL schema from your MySQL server (in my case my virtual machine).
You can now understand why we needed to install the mysqli driver at the php installation step. (Your Windows server has to connect to a MySQL server)
You have to load this file into the Oracle database. You can do that using SQLPlus or the client of your choice (like TOAD, or Navicat)
Using SQLPlus :
sqlplus oracleuser/oraclepassword@ORCL < mydump.sql
Note: In my case ORCL was ORACLESERVER_HOST/ORACLEDATABASE_NAME
When the dump is imported into your Oracle database, the last steps are very simple.
Migrate the data :
php mysql2oracle-data.php YOURMYSQLDB:mysqluser/mysqlpassword@YOURLAMPMySQLSERVER oracleuser/oraclepassword@ORACLESERVER_HOST/ORACLEDATABASE_NAME
Update the sequences :
php ora-update-seqs.php oracleuser/oraclepassword@ORACLESERVER_HOST/ORACLEDATABASE_NAME
Final steps :
- Configure the override/settings/site.ini.append.php's DatabaseSettings section
[DatabaseSettings] DatabaseImplementation=ezoracle User=oracleuser Password=oraclepassword Database=ORACLESERVER_HOST/ORACLEDATABASE_NAME
- Clear the cache
php bin/php/ezcache.php --clear-all
Enjoy your eZ Publish !
This tutorial comes from my notes and I think I didn't forget anything.
Even if this installation works, my advice will always be to install eZ Publish on Linux.
I didn't make any benchmark, but I think the performances will always be better on Linux.
But, If one day you have to do this installation I hope this article will help you ;-)
gggeek - A shortcut to ease your pain
19/03/2012 11:27 pmIf you're not at at all into installing/configuring iis, there is a very nice one-click installer that will put on your server iis, rewrite module, php, wincache, mysql and ez all via simple wizards.
You can grab it here: http://share.ez.no/blogs/community-project-board/a-call-for-testers-ez-publish-now-available-in-a-windows-platform-installer-package
Another note: please install wincache for better perfs. It's the free altrentaive to APC from MS