Categories
Windows

To create a Wamp-like Web Server in Windows7-#2.

同一記事の日本語版
Update information      Edit(Dec.27)    Edit2(2014.Mar.24)

   Continued from my last post.

The installation of ActivePerl.

  1. Download ActivePerl-5.16.3.1603-MSWin32-x86-296746.msi.
  2. Install ActivePerl-5.16.3.1603-MSWin32-x86-296746.msi into Drive_SV (A partition for server wares I made) by the default.
  3. Run a cmd.exe
    >perl -v
    If you get the version information, the directory Perl is already added to the Path.
  4. Customize the printenv.pl file (Location:Apache24cgi-bin).
    #!D:/programs/perl/bin/perl.exe  —>  #!Drive_SV:/Perl/bin/perl.exe

    Move printenv.pl from Apache24cgi-bin to drive_DC:WEBcgi-bin.
    Access http://xxx.xxx.xxx.xxx/cgi-bin/printenv.pl from a web browser.

    If you have the server environment variables list, the installation is complete.

  5. Remove printenv.pl.
  6. (*) To use CGI scripts outside of ScriptAliased directories, you will need directive AddHandler: (You will also need to add “ExecCGI” to the “Options” directive.)

The installation of PHP5.5.

  1. Actually, on Jun 20th PHP5.5 was released, but, this doesn’t support WindowsXP anymore. So, until now, I wasn’t able to use it if I wanted to use it. Now, I have a Windows7 on Xw4200, so I downloaded php-5.5.1-Win32-VC11-x86.zip. This is a thread safe version because my web server software is Apache and OS is Windows. To confirm about this thing, please read the install.txt of PHP by yourself.
    Extract the Zip archive.
    Rename the directory php-5.5.1-Win32-VC11-x86 to PHP.
  2. Copy the file php.ini-production as the file php.ini. Customize the php.ini file (Location:PHP).
      Default Custom
    1 ;default_charset = “UTF-8” default_charset = “UTF-8”
    2 ; extension_dir = “ext” extension_dir = “Drive_SV:PHPext”
    3 allow_url_fopen = On allow_url_fopen = Off
    4 ;extension=php_curl.dll extension=php_curl.dll
    5 ;extension=php_gd2.dll extension=php_gd2.dll
    6 ;extension=php_mbstring.dll extension=php_mbstring.dll
    7 ;extension=php_mysql.dll extension=php_mysql.dll
    8 ;extension=php_mysqli.dll extension=php_mysqli.dll
    9 ;extension=php_openssl.dll extension=php_openssl.dll
    10 ;date.timezone = date.timezone =”Asia/Tokyo”
    11 ;sendmail_from = me@example.com sendmail_from = My email address
    12 ;mbstring.language = Japanese mbstring.language = Japanese
    13 ;mbstring.internal_encoding = UTF-8 mbstring.internal_encoding = UTF-8
    14 ;mbstring.http_input = UTF-8 mbstring.http_input = pass
    15 ;mbstring.http_output = pass mbstring.http_output = pass
    16 ;mbstring.encoding_translation = Off mbstring.encoding_translation = Off
    17 ;mbstring.detect_order = auto mbstring.detect_order = UTF-8,ASCII,SJIS,EUC-JP,JIS
    18 ;mbstring.substitute_character = none mbstring.substitute_character = none

    (*) About the 14-18, it should work by leaving the default. The above 14-18 customization is particularly for my server.

    Three additional settings by the security reason. The 19 and 21 settings might give some troubles on your server. It depends on your server environment. (Edit:Dec.27).

      Default Custom
    19 output_buffering = 4096 output_buffering = Off
    20 expose_php = On expose_php = Off
    21 mysql.allow_persistent = On mysql.allow_persistent = Off
  3. Move the directory PHP to Drive_SV.
  4. Make an extra conf file as php55.conf in Drive_SV:Apache24confextra.
    The text of php55.conf:
    LoadModule php5_module “Drive_SV:/PHP/php5apache2_4.dll”
    AddHandler application/x-httpd-php .php
    PHPIniDir “Drive_SV:/PHP”

    Customize the httpd.conf (Location:Apache24conf).
    DirectoryIndex index.html  —>  DirectoryIndex index.php index.html
    Add the next two lines to at the end of the Supplemental configuration section:
    # PHP settings
    Include conf/extra/php55.conf

  5. Make a php file as test.php in drive_DC:WEBhtdocs
    The text of test.php:
    <?php phpinfo() ?>
  6. Restart Apache.

    Access http://xxx.xxx.xxx.xxx/test.php from a web browser.

    If you have the phpinfo list, the installation is complete.

  7. Remove test.php.
  8. Customize the php.ini (Location:PHP).
    ;disable_functions =  —>  disable_functions =”shell_exec, suexec, passthru, phpinfo”
  9. Restart Apache.

Edit2(2014.Mar.24):
   I enabled the Opcache on 2013 Dec. 27. If you use a lot of PHP scripts on your server, I also recommend the post “Enabled Opcache”.

Categories
Windows

To create a Wamp-like Web Server in Windows7-#1.

Update information      Edit(Aug.11)

同一記事の日本語版

   Yesterday, I had the PC which was installed Windows7HP+SP1(x86) as I wrote the article. It is good for me to create a new Wamp-like Web Server.

   First I make two partitions. One for server wares(Drive_SV), another for other files(drive_DC).

   By the way, during creation, Windows Firewall gives alerts several times. At the time, confirm and open required ports. Well, let me get started.

The installation of the Apache HTTP Server.

  1. Download httpd-2.4.6-win32-VC11.zip.
    It requires VC11. So, I downloaded and installed vcredist_x86.exe.
    Extract the Zip archive.
  2. Customize the httpd.conf file in extracted files (Location:Apache24conf).
      Default Custom
    1 ServerRoot “c:/Apache24” ServerRoot “Drive_SV:/Apache24”
    2 ServerAdmin admin@example.com ServerAdmin My email address
    3 #ServerName www.example.com:80 ServerName xxx.xxx.xxx.xxx:80
    4 DocumentRoot “c:/Apache24/htdocs” DocumentRoot “drive_DC:/WEB/htdocs”
    5 <Directory “c:/Apache24/htdocs”> <Directory “drive_DC:/WEB/htdocs”>
    6 Options Indexes FollowSymLinks Options FollowSymLinks
    7 ErrorLog “logs/error.log” ErrorLog “|bin/rotatelogs.exe -l -f logs/error.%Y.%m.%d 86400”
    8 CustomLog “logs/access.log” common # CustomLog “logs/access.log” common
    9 #CustomLog “logs/access.log” combined CustomLog “|bin/rotatelogs.exe -l -f logs/access.%Y.%m.%d 86400” combined
    10 ScriptAlias /cgi-bin/ “c:/Apache24/cgi-bin/” ScriptAlias /cgi-bin/ “drive_DC:/WEB/cgi-bin/”
    11 <Directory “c:/Apache24/cgi-bin”> <Directory “drive_DC:/WEB/cgi-bin”>
    12 Require all granted Require ip Lan IP range (Access control to cgi-bin directory)
    13   ServerTokens Prod
  3. Move the directory Apache24 to Drive_SV.
  4. Run a cmd.exe as an Administrator.
    >cd Drive_SV:Apache24bin
    >httpd.exe -t
    If having error messages, you have to fix them before continuing procedures.

    Install as a Service:
    >httpd.exe -k install
    Make an ApacheMonitor.exe shortcut in the Windows Startup folder. Start Apache.

  5. Move index.html from Apache24/htdocs to drive_DC:WEBhtdocs
    Access http://xxx.xxx.xxx.xxx/ from a web browser.
    If you have “It works!”, the installation is complete.
  6. Remove index.html.

Edit(Aug.11):
   These days, I was in trouble because my Apache sometimes made no response. At that time, I think the error log gave me the message “(OS 64)The specified network name is no longer available. : AH00341: winnt_accept: Asynchronous AcceptEx failed.”, so I added the next lines my httpd.conf. (Ref:AcceptFilter Directive)

<IfModule mpm_winnt_module>
AcceptFilter http none
AcceptFilter https none
</IfModule>

Categories
Windows

Upgrading from WinXpPro+SP3(x86) to Win7HP+SP1(x86).

同一記事の日本語版

   On 2014.Apr.8, Extended Support of Windows XP support ends completely, so I planed to change my server OS to CentOS until the day. But, fortunately, one of my friends gave me ‘Microsoft Windows 7 Home Premium, Upgrade Edition for XP or Vista users’ DVD. I think this is no problem for a license. Because the friend doesn’t use this Win 7 anymore. Am I right?

   Immediately, I installed Windows7HP+SP1(x86) on HP xw4200 Workstation. This is a previous server machine. About this PC, I wrote some articles on the Japanese Blog.

   When you use the upgrade DVD, you need a target OS, of course. So, I installed WinXpPro+SP3(x86) first, and upgraded. By the way, when you upgrade from XP to 7, you have to choose Custom (advanced) type of installation.

   During upgrading, the PC gave me the next message several times. Grrr.
     ***Hardware Malfunction
     Call your hardware vendor for support
     NMI:Parity Check / Memory Parity Error
     ***The system has halted***

   I used Memtest86+ and checked it out, but I had no error.

   Fortunately, I found the page “***Hardware Malfunction Call your Hardware Vendor for Support NMI: Parity Check/Memory Parity Error *** The system has halted ***” at last. (PDF file here.)

   I tried and tested this solution, and then, I installed Windows7 completely. I am still afraid of the error above occurring. But, there is as yet no sign of error.

   Well, I got a Windows7 Desktop PC. Now, my weak heart thinks a Windows7 server instead of a CentOS server. Because, I am a Windows person. (^^;)