During the all day sucker of trying to get Piwigo up and running today I discovered that there appears to be a void when it comes to any kind of step by step guides for…
1. Installing Piwigo on Windows 2008 Server R2 with php and MySQL
2. Getting Piwigo to successfully use remote storage space (shared UNC paths, etc.)
In fact, I found more posts that ended with the OP saying that they would try and install piwigo on some flavor of Linux after getting some very discouraging responses.
Even more so I found numerous folks saying that you simply cannot use remote storage with Piwigo on Windows. Though I think that remains true for any flavor prior to Vista on the desktop and 2008 on the server side.
Anyway, here are the steps, more or less, that I followed after I discarded all of the wrong turns, trial and errors, etc. that won’t get you anywhere but frustrated if I had you go through all I went through.
How to install Piwigo on IIS 7.5 with NAS Storage
1. Get Windows 2008/IIS 7.5 installed and healthy (check event viewer and remediate any/all errors.
2. Use Web Platform Installer to install PHP (I installed v5.6.0)
3. Use Web Platform Installer to install phpMyAdmin. Follow directions here (http://www.1stwebdesigner.com/how-to-se … -packages/ ) for the “phpMyAdmin installation and configuration. Again, eliminate all errors before proceeding.
4. Test php (“Google how to test php on Windows”). Get it working right. You can select index.php as the default document on a per directory basis if you intent to also use ASPX, etc. Eliminate all errors before proceeding.
5. Use Web Platform Installer to install MySQL (I used MySQL Windows 5.5).
6. Create the required piwigo database in mySQL – I found a page somewhere that showed me how, but I cannot find it now. Sorry about that. However, I created a piwigo user account and allowed phpMyAdmin to create a database for the user. Not that creating a database does NOT mean you are creating data tables, the Piwigo install.php page will take care of that.
7. Test MySQL with php page outlined on this page (http://crybit.com/check-mysql-database-connection/ ). I would suggest that you test the piwigo database connection with this step as doing so will eliminate doubts further on. Eliminate all errors before proceeding.
8. Download latest version of Piwigo ZIP file (mine is v2.7.3). Browse to it with Windows Explorer, right click and extract all to “C:\” which will create the folder C:\piwigo and all sub-folders, etc.
9. Right click on the C:\piwigo folder, select properties, and assign full rights to the folder for the user you intend to use (typically IUSR). Not sure if this is required, I got errors before I did this, but those may have been caused by another problem that is also had to eliminate.
10. Using IIS Manager, create a virtual directory (I called mine “gallery”) in the root of the Default Web Site and point it to the folder C:\Piwigo. Be sure to set credentials, and then test them using the GUI Wizard to create the virtual directory, for the directory and the user you gave full rights to that folder in step (8) above.
11. At this point you should be able to successfully open a browser on the IIS Server host to http://localhost/gallery/install.php – DO NOT do anything yet on this page. If you can do that, then open the same page on your workstation by going to http://<yourhostname>/gallery/install.php . If you can, go ahead and fill out the page with the appropriate information and when done you will hopefully see a nice green informational blurb telling you that all was done successfully.
12. Now take the time to go through the offered up “Take a Tour” tour. In doing this you will have uploaded a photo or two. Suggest that you create an Album called “test” and drop the photos in there. Having a few photos set up will be important later on if you intend to use NAS storage.
13. Take some time play around with Piwigo but don’t get too comfy making too many changes right yet. We will want to keep it as vanilla as possible to avoid wondering what changes are causing what problems later. Become familiar with where and how your uploaded images appear and remember how piwigo behaves when it is working right – if you don’t do this, you won’t recognize when something is not working right and that means that some images might appear but others don’t, thumbnails will appear but clicking on them does not result in the full image appearing, oddball things like that can happen so know what it is supposed to do when it is working right.
14. If you are not going to use NAS or other remote storage, you are done here. Otherwise, continue on. The steps I followed should work for most any kind of storage you can access from Windows explorer on the IIS Server as long as you can read/write to the storage space. In my case I have a WD ShareSpace NAS device which leaves a little to be desired when it comes to allowing me to assign user rights to the file system. Thus, I created a new user on the NAS device called IIS and allowed it to create a user file space for that user as well. Whatever user account you will be using on the IIS server for the Virtual Directory credentials will need to have read/write privileges to this storage space. Thus, I created a user account and then logged into that account on the Windows 2008 server hosting the IIS Server and made sure that I could create directories, files, etc. as well as delete them. If you cannot do this, there is no sense in moving forward.
15. Once you have a Windows Server 2008 account that has full read/write access to your remote storage, you are ready to proceed.
16. On the remote storage, create a directory called ‘piwigo’, under that folder, create two more – ‘_data’ and ‘upload’ and then under ‘_data’ create a directory called simply ‘I’.
17. On the IIS Server, open gpedit.msc and browse to: Computer Configuration | Administrative Template | System | Filesystem and double click on the policy for “Selectively allow the evaluation of a symbolic link”
18. You will want to ‘Enable’ this policy and then check the first two of four boxes which are ‘Local Link to Local Target’ and ‘Local Link to a Remote Target’. Click on OK and then close gpedit.msc.
19. Just for grins, test what you just did by opening a command prompt (using ‘Run as Administrator’) and entering the following command:
C:\Fsutil behavior query symlinkevaluation
…and if all is well, you will see that the two items above are enabled and the remaining two are disabled. If not, troubleshoot this first before proceeding.
20. Now you need to CUT and MOVE everything under ‘C:\piwigo\_data\i’ to the ‘I’ folder on your storage space you created in step (16) above.
21. Do the same for everything in ‘C:\piwigo\upload’ and move it to the ‘upload’ folder on your storage space you created in step (16) above.
22. Double check the above two steps and make sure that everything was moved from these two folders on the C:\ drive to your storage location.
23. Delete ‘C:\piwigo\_data\i’
24. Delete ‘C:\piwigo\upload’
25. Go to your command prompt (I did not tell you to close it before did I?) and enter the following commands (substituting your path on your storage space):
Mklink /D C:\piwigo\_data\I \\NAS\iis\piwigo\_data\I
Mklink /D C:\piwigo\upload \\NAS\iis\piwigo\upload
26. If all is well, you should be able to go back to your browser and view those images you uploaded before, as well as their thumbnails, etc.
27. If you are satisfied that you still have a fully working piwigo (or you think you do so far anyway) then you should go ahead and upload two more photos to the same Album you previously used.
28. Close your browser (to be sure we have a fresh look going back to it).
29. Stop and Restart IIS. Again, this makes sure that all set up processes happen as they should. In fact, if you really wanna go for the gusto, reboot the server (which is something I have yet to do even now – hmmmm….).
30. Now browse back to Piwigo with your browser. You should find both the images you uploaded during the tour and the ones you uploaded in step (27) above all in the same album and fully functional. If you do not, something is broken and you are probably going to be on your own at this point except for me to say that you probably have a rights issue somewhere.
Piwigo version: 2.7.3
PHP version: 5.6.0
MySQL version: 5.5
Piwigo URL: http://www.mika-sys.com:8080/gallery/