Manual Web 1

download Manual Web 1

of 12

Transcript of Manual Web 1

  • 7/31/2019 Manual Web 1

    1/12

    INSTALLING GUIDE FOR A WEB

    SERVER

    Installation and configuration of Apache 2.2, PHP5 enviroinment,MySQL 5.5 and phpMyAdmin 3.4

    By:Josu Gayn BsconesFor: Web Application Deployment, 2ndASIX

    Josu Gayn Bscones Web Application Deployment 1

  • 7/31/2019 Manual Web 1

    2/12

    INSTALLING GUIDE FOR A WEB

    SERVER

    Content

    1.Introduction.............................................................................................................3

    2.Download................................................................................................................. 3

    Apache 2.2.................................................................................................................3

    PHP5 Enviroinment..................................................................................................3

    MySQL 5.5.................................................................................................................3 phpMyAdmin 3.2.......................................................................................................3

    3.Installation of Apache.............................................................................................4

    4.Installation of PHP5................................................................................................5

    4.1.Installation of the application...............................................................................5

    4.2 Configuring PHP as a module of Apache............................................................6

    4.2.1 Apache Security.................................................................................................................7

    4.2.3 Install a PHP editor............................................................................................................7

    5.Installation of MySQL............................................................................................86.Installation of phpMyAdmin................................................................................10

    7.Problems.................................................................................................................11

    Josu Gayn Bscones Web Application Deployment 2

  • 7/31/2019 Manual Web 1

    3/12

    INSTALLING GUIDE FOR A WEB

    SERVER1.Introduction

    This guide refers to an installation into Windows Vista. I will explain any problem during

    the creation of this guide, as a reference for common errors.

    Remember to download all the files for first and follow this guide only with the file versionsexplained here. Otherwise your web server could not work.

    Good installation!

    2.DownloadYou should first download this pakages:

    Apache 2.2

    PHP5 Enviroinment

    MySQL 5.5

    phpMyAdmin 3.2

    Josu Gayn Bscones Web Application Deployment 3

    http://apache.rediris.es/httpd/binaries/win32/httpd-2.2.21-win32-x86-openssl-0.9.8r.msihttp://apache.rediris.es/httpd/binaries/win32/httpd-2.2.21-win32-x86-openssl-0.9.8r.msihttp://windows.php.net/downloads/releases/php-5.2.17-Win32-VC6-x86.msihttp://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-5.5.15.0.msi/from/http:/mirror.leaseweb.com/mysql/http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.5/phpMyAdmin-3.4.5-all-languages.zip?r=http://www.phpmyadmin.net/home_page/downloads.php&ts=1317539520&use_mirror=heanethttp://windows.php.net/downloads/releases/php-5.2.17-Win32-VC6-x86.msihttp://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-5.5.15.0.msi/from/http:/mirror.leaseweb.com/mysql/http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.5/phpMyAdmin-3.4.5-all-languages.zip?r=http://www.phpmyadmin.net/home_page/downloads.php&ts=1317539520&use_mirror=heanethttp://apache.rediris.es/httpd/binaries/win32/httpd-2.2.21-win32-x86-openssl-0.9.8r.msi
  • 7/31/2019 Manual Web 1

    4/12

    INSTALLING GUIDE FOR A WEB

    SERVER3.Installation of Apache

    Open the file. A windows will open guiding you to the installation. You have to accept the

    conditions and configure the installation as this example:

    Once finished the installation you'll see an icon like this: This means that Apache is

    correctly running. Going to http://localhost (or http://localhost:8080 in case of port 8080

    installation) should appear a text written It works! Otherwise, control the section Problems in

    this tutorial

    Josu Gayn Bscones Web Application Deployment 4

    http://localhost/http://localhost:8080/http://localhost/http://localhost:8080/
  • 7/31/2019 Manual Web 1

    5/12

    INSTALLING GUIDE FOR A WEB

    SERVER4.Installation of PHP5

    4.1.Installation of the applicationOpen the installer. Click next acepting the conditions. Select the C:/php path to install.

    Otherwise your installation won't work.You will asked to select the type of module. You have to

    select Apache 2.2.x Module

    Then, you have to put C:\Program Files\Apache Software Foundation\Apache2.2\conf asApache configuration directory.

    In the next screen, select the option Entire feature will be installed on local drive in all the tree

    Josu Gayn Bscones Web Application Deployment 5

  • 7/31/2019 Manual Web 1

    6/12

    INSTALLING GUIDE FOR A WEB

    SERVER4.2 Configuring PHP as a module of Apache

    Sometimes, the PHP installation don't allow you to restart the service again. So we will

    configure the file manually.

    Open as Administrator C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf

    At the end of the file, delete the last paragraph that PHP installer created (if not indicated that PHP

    installer do it that, don't delete anything) and write:

    LoadModule php5_module c:/php/php5apache2_2.dllAddHandler application/x-httpd-php .php

    You should uncomment (delete the # symbol in the line) the option ShortTags = On if its not,

    otherwise the tags wont be read

    Go to Apache monitor and restart the service clicking RestartNow, create a file into the directory C:/Program Files/Apache Software

    Foundation/Apache2.2/htdocs called info.php with the notepad:

    Save the file and go to the URL http://localhost/info.php (orhttp://localhost:8080/info.php in case

    of port 8080 installation)

    You should have a page like this:

    If you dont see this, control the Problems section, at the end of this document.

    Josu Gayn Bscones Web Application Deployment 6

    http://c/c:/php/php5apache2_2.dllhttp://localhost/http://localhost:8080/http://localhost:8080/http://c/c:/php/php5apache2_2.dllhttp://localhost/http://localhost:8080/
  • 7/31/2019 Manual Web 1

    7/12

    INSTALLING GUIDE FOR A WEB

    SERVER4.2.1 Apache SecuritySearch the line like this:

    Options Includes Indexes FollowSymLinks MultiViewsThen remove word Indexes and save the file. The line should look like this one:

    Options Includes FollowSymLinks MultiViews

    This won't allow users to navigate into Apache directory. You should also hide your Apache

    information. Search for this lines and uncomment it, or create it:

    ServerSignature Off

    ServerTokens Prod

    This for assure that Apache is using a user:

    User apacheGroup apache

    Ensure that files outside the web root are not served:

    Order Deny,Allow

    Deny from allOptions None

    AllowOverride None

    Order Allow,DenyAllow from all

    Turn off directory browsing:

    Options -Indexes

    Turn off server side includes:

    Options -Includes

    If your server is linux there are more security options. But this is a guide for windows.

    There are a lot of security options that we don't include because depends on the use of our server.

    4.2.3 Install a PHP editorWe reccomend to install a PHP editor to create your PHP documents.

    You can use Dreamweaver, from Adobe. As this is not a guide for this editor, follow THIS LINKto

    know how to install it

    Josu Gayn Bscones Web Application Deployment 7

    http://taringa.bligoo.com/content/view/911972/DESCARGAR-DREAMWEAVER-CS4-2010-FULL.htmlhttp://taringa.bligoo.com/content/view/911972/DESCARGAR-DREAMWEAVER-CS4-2010-FULL.html
  • 7/31/2019 Manual Web 1

    8/12

    INSTALLING GUIDE FOR A WEB

    SERVER5.Installation of MySQL

    This step is simple, because consist only in the use of an installer application, but we have to

    follow the instructions to have a correct installation.

    Open the installer. Accept conditions and click next.

    You are pleased to select an option. You have to select Developer Default that will install all the

    necessary programs and components.

    The program will control if you are ready for the installation. Probably the second option is

    not ready, you have to click Execute and the program will install the necessary programs. For

    Windows 2008 please visit the Problems section, 6th problem.

    Now start the installation. You will see something like this:

    Josu Gayn Bscones Web Application Deployment 8

  • 7/31/2019 Manual Web 1

    9/12

    INSTALLING GUIDE FOR A WEB

    SERVEROnce finished, you will be asked about the type of machine. Select a Server Machine

    Then, you will configure MySQL with a password. The other options are good in that way.

    Josu Gayn Bscones Web Application Deployment 9

  • 7/31/2019 Manual Web 1

    10/12

    INSTALLING GUIDE FOR A WEB

    SERVERAnd you will finish the installation. This is the server console. You can create a database

    also with Workbench, also installed.

    6.Installation of phpMyAdminDownload the ZIP file and open it.

    Unzip all the elements (not the folder) and leave it into a folder called phpmyadmin on the htdocs

    directory on Apache.

    Now well open the file into phpmyadmin/libraries/config.default.php and we will search this line:

    $cfg['PmaAbsoluteUri'] = '';

    And we will write the absolute path of phpMyAdmin:

    $cfg['PmaAbsoluteUri'] = 'http://localhost/phpmyadmin/';

    Now we will search:

    $cfg['blowfish_secret'] = '';

    And we will write whatever. This is for encrypting the files.

    $cfg['blowfish_secret'] = 'to be or not to be';

    You now need to indicate the type of authentification for entering phpMyAdmin. Set this on

    Cookie:

    $cfg['Servers'][$i]['auth_type'] = 'cookie';

    Copy libmysql.dll fromMySQL/MySQL Server 5.5/lib tophpmyadmin/bin

    Uncoment the line in C:/php/php.ini

    extension=php_mysqli.dllThis should be enough to install phpMyAdmin.

    Now, you should be able to enterhttp://localhost/phpmyadmin

    Josu Gayn Bscones Web Application Deployment 10

    http://localhost/phpmyadminhttp://localhost/phpmyadmin
  • 7/31/2019 Manual Web 1

    11/12

    INSTALLING GUIDE FOR A WEB

    SERVER

    7.Problems

    1.Apache: make_sock: could not bind to adress 0.0.0.0:80 Thats because a program in your

    computer is already using port 80 and Apache cannot listen to port 80. Install Apache in port 8080

    (or if you know what program has a conflict, change its port)2.Apache: Syntax error. The program tells you the number of line. So search for it (its always

    something that you write, otherwise you have to reinstall) and correct it.

    3.PHP: If you see the code you have to control the option ShortTags, as descripted before, that

    should be ON. Maybe is also a problem with the httpd.conf file. Control that you have written the

    correct paths.

    4.PHP: If you dont see anything or get an error, maybe you hadnt save the file info.php in the

    correct directory. Remember that entering http://localhost is the same that enter into the directori of

    Apache called htdocs.

    5.MySQL: In the installation, I dont see all those things installing. Control that you have selectedthe right option.

    6.MySQL: The program Microsoft Visual runtime doesnt install it for itself. Try to do it manually

    Josu Gayn Bscones Web Application Deployment 11

  • 7/31/2019 Manual Web 1

    12/12

    INSTALLING GUIDE FOR A WEB

    SERVERsearching in google. If you cant (Ive encountered problems in Windows Server 2008) install the

    Server option in the first question of the installation. You will install only a thing but should be

    enough.

    7.phpMyAdmin: You got the error: No se encontr la extensin mysqli. Por favor revisa laconfiguracin PHP. Try to do all the steps in this guide in the installation of phpMyAdmin as descripted. If your

    problem continues, you can install EasyPHP that will install all automatically.

    Remember that, if you followed this tutorial, you should uninstall before all programs (Apache,

    MySql and PHP)

    You can install EasyPHP clicking in the image below, orHERE. After, create an user

    Josu Gayn Bscones Web Application Deployment 12

    http://localhost/phpmyadmin/url.php?url=http%3A%2F%2Fphp.net%2Fmanual%2Fes%2Fbook.mysqli.php&token=0ca674df6a39593d8a657745517bf623http://downloads.uptodown.net/dm/easyphp-3.0.exehttp://downloads.uptodown.net/dm/easyphp-3.0.exehttp://downloads.uptodown.net/dm/easyphp-3.0.exehttp://localhost/phpmyadmin/url.php?url=http%3A%2F%2Fphp.net%2Fmanual%2Fes%2Fbook.mysqli.php&token=0ca674df6a39593d8a657745517bf623http://downloads.uptodown.net/dm/easyphp-3.0.exe