- 19/03/2012 2:00 am -
eZ Publish on Windows server 2008 and Oracle 11g
Hello everybody,
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.
2.1.1 Installation
The IIS 7 installation begins with : Control panel > Get programs, and you can add "Internet Information Server".
This step is really simple and quick.
2.1.2 Configuration
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
2.2.1 Installation
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)
2.2.2 Configuration
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
- IIS
- 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.
As described in the eZ Oracle installation documentation, the Oracle Instant Client must be installed on the webserver.
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
3.1 Installation
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
3.2.1 Files
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.
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <defaultDocument> <!-- Set the default document --> <files> <remove value="index.php" /> <add value="index.php" /> </files> </defaultDocument> <rewrite> <rules> <rule name="Rest API" stopProcessing="true"> <match url="^api/" ignoreCase="false" /> <action type="Rewrite" url="index_rest.php" /> </rule> <rule name="Treemenu" stopProcessing="true"> <match url="^([^/]+/)?content/treemenu.*" ignoreCase="false" /> <action type="Rewrite" url="index_treemenu.php" /> </rule> <rule name="Direct access resources" stopProcessing="true"> <match url=".*" ignoreCase="false" /> <conditions logicalGrouping="MatchAny"> <add input="{URL}" pattern="var/([^/]+/)?storage/images(-versioned)?/" ignoreCase="false" /> <add input="{URL}" pattern="var/([^/]+/)?cache/(texttoimage|public)/" ignoreCase="false" /> <add input="{URL}" pattern="design/[^/]+/(stylesheets|images|javascript)/" ignoreCase="false" /> <add input="{URL}" pattern="share/icons/" ignoreCase="false" /> <add input="{URL}" pattern="extension/[^/]+/design/[^/]+/(stylesheets|flash|images|lib|javascripts?)/" ignoreCase="false" /> <add input="{URL}" pattern="packages/styles/.+/(stylesheets|images|javascript)/[^/]+/" ignoreCase="false" /> <add input="{URL}" pattern="packages/styles/.+/thumbnail/" ignoreCase="false" /> <add input="{URL}" pattern="var/storage/packages/" ignoreCase="false" /> </conditions> <action type="None" /> </rule> <!-- Makes it possible to placed your favicon at the root of your eZ Publish instance. It will then be served directly. --> <rule name="Faviconrewrite" stopProcessing="true"> <match url="^favicon\.ico$" ignoreCase="false" /> <!-- Uncomment the line below if you want you favicon be served from the standard design. You can customize the path to favicon.ico by replacing design/standard/images/favicon.ico by the adequate path. --> <!--<action type="Rewrite" url="design/standard/images/favicon.ico" />--> <action type="None" /> </rule> <rule name="Favicon" stopProcessing="true"> <match url="^design/standard/images/favicon\.ico$" ignoreCase="false" /> <action type="None" /> </rule> <!-- Give direct access to robots.txt for use by crawlers (Google, Bing, Spammers..) --> <rule name="Robots" stopProcessing="true"> <match url="^robots\.txt$" ignoreCase="false" /> <action type="None" /> </rule> <!-- Uncomment the following lines when using popup style debug. --> <!--<rule name="Debug" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAny"> <add input="{URL}" pattern="var/cache/debug\.html" ignoreCase="false" /> <add input="{URL}" pattern="var/[^/]+/cache/debug\.html" ignoreCase="false" /> </conditions> <action type="None" /> </rule>--> <!-- Platform for Privacy Preferences Project ( P3P ) related files for Internet Explorer More info here : http://en.wikipedia.org/wiki/P3p --> <rule name="P3P" stopProcessing="true"> <match url="^w3c/p3p\.xml$" ignoreCase="false" /> <action type="None" /> </rule> <rule name="Everything else"> <match url=".*" ignoreCase="false" /> <action type="Rewrite" url="index.php" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
3.2.3 Database
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 !
Conclusion
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 ;-)
Plop+
- 10/03/2012 4:41 pm -
Plopix Blog, the Plopix strikes back !
Salut à tous,
C'est fait ! Voici mon nouveau blog fraîchement sorti après deux semaines de vacances en Guadeloupe. On peut dire qu'il a été créé dans le Cloud (en avion ou en plein Jet Lag ;))
Alors, évidemment, vous voyez bien que le désign ressemble à un réseau social assez connu ! Mais je me suis dit que copier sur quelque chose qu'on apprécie et toujours un bel hommage. D'autant, que ce n'est pas une copie mais une reproduction ! J'ai découvert de nouvelles techniques Gimp en voulant faire le logo, j'ai un peu joué aussi avec les media queries et le HTML5 mais c'est pas trop mon fort etc..
Du coté serveur on retrouve mon CMS préféré eZ Publish dans sa dernière version communautaire avec un Varnish 3 tout vide pour le moment.
Pour refaire ce blog, j'ai fait un mix up de plein de blogs que j'apprécie que vous retrouverez sur la droite dans la rubrique "My Community". (Merci à vous)
J'avoue que je n'ai quand même pas trop d'idée sur le contenu de la home page du site (pas du blog), aujourd'hui j'ai mis une remontée de flux Twitter cela changera peut être !
Par contre j'apprécie bien ma page d'erreur.
J'ai essayé d'être social aussi, Facebook, Twitter, Google Plus, Foursquare, et Gmaps.
Concernant la langue, je vais essayer d'être international ! Alors il y aura sûrement plein de billets en anglais, soyez indulgent ;-) (il faut que progresse de toute façon, les critiques seront aussi les bienvenues)
Au niveau du contenu, je vais essayer d'être plus régulier, voire utiliser un peu le blog comme pense-bête de choses simples mais importantes.
Donc sur ces belles paroles : See you soon !









