Categories
Windows

Upgrading from MariaDB 5.5 to 10 on Windows.

同一記事の日本語版
Update information      Edit(Jun.30)

   Now we have the first stable version of MariaDB 10.0 Series which was released on Mar 31. Today, I’ve upgraded from MariaDB 5.5 to 10 on Windows7HP+SP1(x86). Though this is not an update but an upgrade, the procedures are nothing different from the last update.

   First, I backed up all the sever data. Especially, MariaDB and MyDB.

   Next, I upgraded to MariaDB 10.0.10.

  1. Downloaded mariadb-10.0.10-win32.zip.
  2. Extracted the Zip archive.
  3. Control Panel >> Administrative tools >> Services
    Select the MyDB service name and stop.
  4. Delete all contents in the MariaDB folder. Install the four folders named bin, include, lib and share and license files to the folder.
  5. Control Panel >> Administrative tools >> Services
    Select the MyDB service name and start.

   That’s it.

Edit(Jun.30):
   I forgot to write. After upgrading, you have the error message “Please use mysql_upgrade to fix this error.” on the error log, so you need “mysql_upgrade“.

Categories
Uncategorized

Updating Apache because of CVE-2014-0160.

同一記事の日本語版
Update information      Edit(May.13)

   I updated my Apache 2.4.9 to 2014 Apr 8 version because of CVE-2014-0160.

   It is built with ‘IPv6 Crypto apr-1.5.0 apr-util-1.5.3 apr-iconv-1.2.1 openssl-1.0.1g zlib-1.2.8 pcre-8.34 libxml2-2.9.1 lua-5.1.5 expat-2.1.0′. Its Changelog.

   I really appreciate Steffen’s hard and quick work. Thanks again, Steffen.

Edit(May.13):
   This vulnerability also has effects on everyday life as I’ve worried about. Some OS of smartphones might have the vulnerability. I’ve found the list out. ⇒ The list of Android phones vulnerable to Heartbleed bug

   And you can check your smartphone OS about the vulnerability by the Heartbleed Detector App.

   I add three sites about Heartbleed detector you can access by a PC.
     Heartbleed test
     heartbleed test
     Trend Micro Heartbleed Detector (does not exist anymore.)

Categories
Windows

Updating to PHP5.5.11.

同一記事の日本語版

   They released PHP5.5.11 on Apr-03 06:21:19UTC.

   According to ChangeLog, this includes the fix for CVE-2013-7345.

   The php.ini-production has nothing changed. As the official PHP binary includes php5apache2_4.dll, I extract the zip archive and replace all PHP5.5.10 files with all PHP5.5.11 files except my php.ini. Then, I restart my Apache. That’s it.

   If you need how to configure PHP5.5, please see the post. It is for a mbstrings user, but the information gives some help for you.

Categories
Uncategorized

Updating to Apache 2.4.9.

同一記事の日本語版

   Apache HTTP Server 2.4.9 was released, and they did not release 2.4.8 because of an issue about OpenSSL area. So we’d better think 2.4.9 includes the changes with 2.4.8.

   I downloaded httpd-2.4.9-win32-VC11.zip (16 Mar) from the ApacheLounge for my Windows7 server. If you need the information about Apache 2.4.x configuration on Windows, see my post ‘To create a Wamp-like Web Server in Windows7-#1.‘.

Categories
Windows

Updating to MariaDB 5.5.36.

同一記事の日本語版

   Today, I updated to MariaDB 5.5.36 on Windows7HP+SP1(x86). Here is its Changelog.

   First, I backed up all the sever data. Especially, MariaDB and MyDB.

   Next, I updated to MariaDB 5.5.36.

  1. Downloaded mariadb-5.5.36-win32.zip.
  2. Extracted the Zip archive.
  3. Control Panel >> Administrative tools >> Services
    Select the MyDB service name and stop.
  4. Replace old four folders with new ones. The folders exist in MariaDB and their names are bin, include, lib and share.
  5. Control Panel >> Administrative tools >> Services
    Select the MyDB service name and start.

   That’s it.

Categories
Windows

Updating to PHP5.5.10.

同一記事の日本語版

   Though I forgot to write because of hooked on WOFF, I updated to PHP5.5.10 on Mar. 10.

   According to ChangeLog, this includes the fixes for CVE-2014-1943, CVE-2014-2270 and CVE-2013-7327.

   The php.ini-production loses the next 31 lines. My server had nothing affected by them, though.
———————————————
; session.bug_compat_42
; Default Value: On
; Development Value: On
; Production Value: Off
———————————————
; session.bug_compat_warn
; Default Value: On
; Development Value: On
; Production Value: Off
———————————————
; PHP 4.2 and less have an undocumented feature/bug that allows you to
; to initialize a session variable in the global scope.
; PHP 4.3 and later will warn you, if this feature is used.
; You can disable the feature and the warning separately. At this time,
; the warning is only displayed, if bug_compat_42 is enabled. This feature
; introduces some serious security problems if not handled correctly. It’s
; recommended that you do not use this feature on production servers. But you
; should enable this on development servers and enable the warning as well. If you
; do not enable the feature on development servers, you won’t be warned when it’s
; used and debugging errors caused by this can be difficult to track down.
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/session.bug-compat-42
session.bug_compat_42 = Off
———————————————
; This setting controls whether or not you are warned by PHP when initializing a
; session value into the global space. session.bug_compat_42 must be enabled before
; these warnings can be issued by PHP. See the directive above for more information.
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/session.bug-compat-warn
session.bug_compat_warn = Off
———————————————

   As the official PHP binary includes php5apache2_4.dll, I extract the zip archive and replace all PHP5.5.9 files with all PHP5.5.10 files except my php.ini. Then, I restart my Apache. That’s it.

   If you need how to configure PHP5.5, please see the post. It is for a mbstrings user, but the information gives some help for you.

   I use this opportunity to update to phpMyAdmin 4.1.9. If you need its configuration, see “phpMyAdmin 4.1.0 is released”.

Categories
Windows

Updating to PHP5.5.9.

同一記事の日本語版

   At Feb-06 00:36:12UTC, they released PHP5.5.9.

   According to ChangeLog, this release fixes several bugs against PHP 5.5.8, and some of bugs are related with OPCache. So I updated my PHP immediately.

   I downloaded a Thread Safe version php-5.5.9-Win32-VC11-x86.zip for my server (Windows7HP + SP1 (x86)). It requires VC11. If you don’t have VC11 on your Windows, you must install vcredist_x__.exe before the PHP configuration.

   The php.ini-production has nothing changed.

   As the official PHP binary includes php5apache2_4.dll, I extract the zip archive and replace all PHP5.5.8 files with all PHP5.5.9 files except my php.ini. Then, I restart my Apache. That’s it.

   If you need how to configure PHP5.5, please see the post. It is for a mbstrings user, but the information gives some help for you.

Categories
Windows

Updating to PHP5.5.8.

同一記事の日本語版

   At Jan-09 18:16:03UTC, they released PHP5.5.8. My physical strength was slightly back. So, I updated my PHP.

   According to ( ChangeLog ), it fixes some bugs against PHP 5.5.7, and An addition. The addition is related to the old voluntary CVE-2011-3379 (See H. Tokumaru’s tumblr “Added validation of class names in the autoload process“. This is only in Japanese.).

   I downloaded a Thread Safe version php-5.5.8-Win32-VC11-x86.zip for my server (Windows7HP + SP1 (x86)). It requires VC11. If you don’t have VC11 on your Windows, you must install vcredist_x__.exe before the PHP configuration.

   The php.ini-production has nothing changed.

   As the official PHP binary includes php5apache2_4.dll, I extract the zip archive and replace all PHP5.5.7 files with all PHP5.5.8 files except my php.ini. Then, I restart my Apache. That’s it.

   If you need how to configure PHP5.5, please see the post. It is for a mbstrings user, but the information gives some help for you.

Categories
WordPress

Enabled Opcache.

同一記事の日本語版

   On Dec. 24th, I enabled Opcache on my server (Windows7HP + SP1 (x86)).

   Since installing “BulletProof Security“, it gave me a few trouble. On the other hand, it also brought me some useful information about PHP. For example, I saw its System Information page and changed values in my php.ini like the below. It’s for the security reason.

Default Custom
output_buffering = 4096 output_buffering = Off
expose_php = On expose_php = Off
mysql.allow_persistent = On mysql.allow_persistent = Off

   The other day, I found the words “Opcode Cache” on the page. It reminded me of OPcache bundled with PHP5.5. Then I tried to enable it on my server.

   I changed some settings in my php.ini.

   First, I added the line “zend_extension=php_opcache.dll” to the end of Windows Extensions and changed the next six lines by following this page instructions. I can find better values for my server someday, but now, to follow the page instructions is better for me who is a very newbie of Opcache.

Default Custom
;opcache.enable=0 opcache.enable=1
;opcache.memory_consumption=64 opcache.memory_consumption=128
;opcache.interned_strings_buffer=4 opcache.interned_strings_buffer=8
;opcache.max_accelerated_files=2000 opcache.max_accelerated_files=4000
;opcache.revalidate_freq=2 opcache.revalidate_freq=60
;opcache.fast_shutdown=0 opcache.fast_shutdown=1
Details
Details
Files
Files

   I don’t use the CLI version of PHP, so I left “;opcache.enable_cli=0”.

   On Apache benchmarks of before and after. ApacheBench
   This benches show some improvements. But, with my feelings I realized more than the benches on the home network. I think Opcache brought major effects to my sites because most of them depend on PHP scripts, i.e. WordPress.

   I had heard about APC Control Panel, so I looked for a Control Panel of Opcache and found. You can control Opcache from a Web browser by Opcache Control Panel, ocp.php. It requires the php function ‘phpinfo’, so you had better make an access control for this file.

Categories
Windows

Moving to MariaDB5.5.

同一記事の日本語版
Update information      Edit(Dec.21)    Edit2(Dec.25)    Edit3(2014.Jun.22)

MaintenanceNotice   Yesterday, I worked very hard. For what? Well, moving to MariaDB5.5 from MySQL on Windows7HP+SP1(x86). Haha.

   First, I backed up all the sever data.
   Next, I made a maintenance.html like the right, and for maintenance I added the next lines to the head of my .htaccess at the Document Root. The text in it is like the below. (refer to: mod_rewrite, <IfModule>)

     ErrorDocument 503 /maintenance.html

     RewriteEngine On
     RewriteCond %{REQUEST_URI} !=/maintenance.html
     RewriteCond %{REMOTE_ADDR} !=IP address for Admin
     RewriteRule ^.*$ – [R=503,L]

     Header set Retry-After “Wed, 18 Dec 2013 01:00:00 GMT”

   On the page, I found “This section should only be used if you need to have one configuration file that works whether or not a specific module is available. In normal operation, directives need not be placed in <IfModule> sections.”. So, I thought I did not need <IfModule> sections.

   Then, I announced the server maintenance on my sites and began moving to MariaDB5.5.

   I had a clean installation of MariaDB because I wanted to change my sql engine from MyISAM to InnoDB. When I started using MySQL, I made the tables by MyISAM. Recently, I heard about InnoDB merits several times. So I always wanted to move to InnoDB, but I also found someone was in troubles on moving to it on the Internet. Hence I have hesitated to make a move because I can NOT handle them if something wrong happens despite my poor knowledge about the sql.

   MariaDB has InnoDB as its default. So I was going to recreate all my tables on this occasion if necessary.

Step1 The uninstallation of MySQL.

  1. Deactivated all WordPress plugins on my sites.
  2. Backed all databases up separately from the sever data backup.
  3. Also exported all contents of my WordPress from the site Dashboard. Because I was going to import all contents by the WordPress Importer if possible. I gave it up as described below, though.
  4. Stop the service.
    Control Panel >> Administrative tools >> Services
    Select the MySQL service name and stop.
  5. Delete the service.
    Run a cmd.exe as an Administrator.
    > sc delete MySql
  6. Removed the folders, MySQL and MyDATA (<--- These are MySQL scripts and data on my server).

Step2 The installation of MariaDB.

  1. Downloaded mariadb-5.5.34-win32.zip from MariaDB.
  2. Running my eyes overInstalling MariaDB Windows ZIP packages, I went to the page about mysql_install_db.exe.
  3. Extracted the Zip archive. Made two folders named MariaDB and MyDB on my server ware partition named Drive_SV. Installed all things made by extract to the folder MariaDB.

    Run a cmd.exe as an Administrator.
    > cd Drive_SV:MariaDBbin
    > mysql_install_db.exe –datadir=Drive_SV:MyDB –service=MyDB –password=secret

    By this, I was able to set the password for the root user and had a new my.ini in the MyDB.

  4. Control Panel >> Administrative tools >> Services
    Select the MyDB service name and start
    If its ‘Startup Type’ is not ‘Automatic’, you should change it to ‘Automatic’.

Step3 Access MariaDB via phpMyAdmin.

  1. Accessed MyDB as the root user from phpMyAdmin.
    Imported one of my backup database, phpmyadmin.
  2. Made a WordPress User and gave it all WordPress database privileges except Grant and no Global privileges. Of course set a password for it. Made a database for the WordPress. Their collation is utf8_general_ci.
    Logout.

   Import by WordPress Importer and I gave it up. The reason is the below.

   After a new WordPress installation, I imported all contents by WordPress Importer. But unfortunately, I found the fact that the plugin neglected some tags like <object>, it was inconvenient for me. I don’t know it neglects what kind tags and to examine them by myself is too much trouble. Therefore, I gave up this method.

Step4 Restored all WordPress database via phpMyAdmin.

  1. I wanted to use the InnoDB, so I replaced all ‘ENGINE=MyISAM’ by ‘ENGINE=InnoDB’ in the backup sql file.
  2. Login as the WordPress User.
    Exported the current WordPress database.
    Dropped all tables on the WordPress table because my backup sql file contained all data.
  3. Imported the backup. I had an error like this.
         #1214 – The used table type doesn’t support FULLTEXT indexes

    The backup file was originally MyISAM, so it includes FULLTEXT indexes. Actually it uses by YARPP as keys of post_title and post_content. Hummm. But on the forum the plugin author says we can use YARPP on the InnoDB though its performance slows down.

    I removed all lines about FULLTEXT indexes in the file. (I remember I heard we can use FULLTEXT with InnoDB on MySQL5.6.–Dec.25Edit)

  4. Dropped all tables again.

    Imported the customized file. I had another error.
         #1064 – You have an error in your SQL syntax;

    This error was my fault. When I removed FULLTEXT indexes I forgot to remove a “,” like this.
         KEY `post_author` (`post_author`),   <<--------This is the ',' I forgot to remove.      ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=xxxx ; I removed all such ','s.

  5. Dropped all tables again.

    Imported the customized file. Complete.

Step5 Back to normal condition.

  1. Login the WordPess.
    Activated all plugins.
    Checked all script behaviors.

    Change .htaccess text to end the maintenance.

  2. Actually, I still have an error about Jetpack on my parent site. Like this.

         Your website needs to be publicly accessible to use Jetpack: site_inaccessible
         Error Details: The Jetpack server was unable to communicate with your site https://MySITE
         [IXR -32300: transport error: http_request_failed SSL certificate problem: self signed
         certificate in certificate chain]

    But I think this is not the maintenance faults. Now I am waiting for a reply on the Jetpack forum.

   Now I use MariaDB5.5. Clap, clap.

Edit(Dec.21):
   After I changed SQL Storage Engine from MyISAM to InnoDB, the plugin YARPP performance slowed down very much. It was more than my expecting. So, I decided to rollback the Engine about the table wp_posts by YARPP instruction message.

  1. Login phpMyAdmin.
  2. Select the database for WordPress.
  3. Select the table wp_posts.
  4. Select ‘Operations’ from the top navigation bar.
  5. Change Storage Engine from Innodb to MyISAM at Table options.
  6. Click Go button of Tabble options.
  7. Logout phpMyAdmin.

   But YARPP didn’t recognize this change, though the author have a specialized feature for this. I went to the YARPP support forum to find a solution. I found MyISAM Override check doesn’t work. I followed hussong‘s instructions.

  1. Deactivate the plugin.
  2. Login phpMyAdmin.
  3. Select the database for WordPress.
  4. Select the table wp_options.
  5. Select ‘SQL’ from the top navigation bar.
  6. Use SELECT * FROM `wp_options` WHERE option_name LIKE "yarpp%"
  7. Delete all I found.You can see yarpp_fulltext_disabled = 1. Change it to yarpp_fulltext_disabled = 0
  8. Logout phpMyAdmin.
  9. Activate the plugin.
  10. Setting the plugin again because all old settings gone.

Now, I can use Titles and Bodies consider options. Happy!

Edit2(Dec.25):
   I wrote “About Jetpack trouble“.

Edit3(2014.Jun.22):
   I wrote an article The solution of “SSL3_READ_BYTES:sslv3 alert handshake failure” on WordPress.