Setting up Your Environment

Setting up Your Environment

APPENDIX Setting Up Your Environment PHP IS A SERVER-SIDE scripting language and, as such, needs a web server in order to function in the way that this book describes. Your web server needs to under­ stand what a PHP document is and have the software installed to handle the PHP document correctly. The web server we use in this book is Apache. The scripts in this book are connecting to a MySQL database server, and you will also need to have this server installed. In this appendix, we provide you with a one-stop shop for downloading, installing, and setting up the software you need to get your computer up and running as a PHP-enabled web server with a MySQL database. We will first look at how to go about setting up your system in a Windows environment, and then see howyou can da the same under Mac OS X. Finally, we will take a look at how to instali Dreamweaver MX 2004. Setting Up in a Windows System Ta get your Windows system up and running, you need to install Apache. You also need to install and configure PHP and MySQL. Installing and Configuring Apache There are a number of different options available when choosing a web server, but perhaps the most popular web server on the Internet at the moment is Apache. This web server was originally written to run in a Unix environment. However, the growth ofWindows-based servers over the years has prompted the Apache Group to bring their Windows version of the Apache web server to the same level of stability, performance, and security as its Unix counterpart. Downloading Apache Your first step is to download the Apache web server package. Browse to the http://www . apache. arg web si te and follow the links to the httpdproject. When you 461 Appendix are there, dick the Download link (http://httpd.apache.arg/dawnlaad . cgi) and download the latest Win32 version. The version that we downloaded to install is Apache 2.0047. The file for this version is apache_2.004 7 -win32-x86-no_ssl.msi, which is a Windows installer that will step you through the entire installation process. This version doesn't have Secure Sockets Layer (SSL) support built in, which is fine, because we don't need SSL for this book, and without it, the download is smaller. The installer without SSL weighs in at ab out 6MB. Installing Apache Once you've downloaded the Apache installation file, follow these steps to install the web server: 1. Double-dick the file in Windows Explorer to start the installation process. Figure 1 shows the Welcome to the Installation Wizard screen. wek:ome to the Instalation WlZard for Apache lfTJP Server 2.0.47 The Installation Wizard will instaU Apadle HfTP Server 2.0.47 on yoo.x CDOlputer. To oontinue, dick Ne.xt WARNING: This program is protected by copyrightlaw and in tema oonal trea ties. Next> Figure 1. Beginning to install the Apache web server 462 Setting Up Your Environment 2. Click Next, select the radio button to accept the terms of the License Agreement, and dick Next again. 3. The next screen displays information about the Apache HTTP Server. Click Next, and you will be prompted to enter yom basic server infor­ mation, as shown in Figme 2. IWI Apache HTTP Server 2..0 - Installation Wizard 1 Server Information Please enter your server's nfurmation. NetworltQomain (e.g. somenet.com) ~er Name (e.g. www.somenet.com): A'*ninistrator's gnaiI Address {e.g. [email protected]): (nstal Apache HTTPServer 2.0 programs and shortoJts fur: (.' for AB Users, on Port 50, as a Service - Rec.ommended. r onIy fur the G..I'rent User, on Port 8080, when starte<! Manualy. Imrnlsmed------------------------------------------------ <Back Next> Figure 2. The web server installation needs so me information from you. 4. Enter fom pieces of information: Network Domain: This is the network domain in which yom server is installed. Ifyou are setting up a server that is visible on the Internet, yom server probably is part of a domain. The publishers of this book would install their servers in a network domain of apre55. com. If you are running yom server at horne, you can use localhost. Server Name: This is the fully qualified domain name of this machine, and it identifies the individual machine. The server name will always be an address within the domain that you specified in the previous entry. If om network domain is apre55. com, for example, om server 463 Appendix name might be dreamweavermxbook. apre55. com. Horne users who will never be using their machine as a web server live on the Internet can use localhost as the server name as well as the network domain. Administrator's Email Address: This is the email address that will appear in any of the server's default error messages that are displayed to users. How to Install Apache: Your options are to install Apache as a service that will be started automaticallywhen Windows starts, even before anyone has logged on to the machine, using port 80 to listen for requests. This is the default port for web traffic, and you should use this option, unless you already have another web server running on port 80. In that case, choose the option for the Current User on port 8080. Ityou choose the second option, you will need to manually start Apache each time before you can use it, and you will also need to browse using port 8080 when testing your pages, as described in the next seetion. NOTE Each application server that runs on your machine needs to "listen" for incoming connection , and it need to do 0 on it own port number. Port 80 is the default port for a web server to li ten on, and ifyou us it, you wiIJ not need to tell your web brow er to brow e on a special port for the Apache web server. Ifyou need to run two different web erver on your machine-Apache and Microsoft Internet Information erver (11 l. for example-they would need to listen on different port , ince only one prograrn can listen on a specific port at any given time. You would need to change either II or Apache to li ten on a port other than 80. 5. After you have entered the required information, dick Next to move to the Setup Type screen. Your choices are Typicalor Custom. A Typical instal­ lation will have everything that you need to get up and running. The Custom installation allows you to deselect the documentation and he ader files, if you want to compile and link additional Apache modules. 6. Click Next again, and you will be able to change the destination folder where Apache installs. This defaults to C: \ Program Files \Apache Group \, and the rest of this appendix assurnes that you have left this default setting. 464 Setting Up Your Environment 7. Click Next, and then dick the Install button. The installation will begin and you will see a progress bar showing the status of the procedure, as shown in Figure 3. I ~ Apoehe HTIP Server 1.0 - Installation Wtzard !J Installing Apadre HTIP Server 1.0.47 The program features you selected are ~instaDed. PIease wait whde the Instalation Wizard instals Apache HTTP Server 2.0.47. This may take several minutes. Status: Copyng new files I ......................... :rtanShI~d------------------------- , __e:_B_ ack__ ,--_ 'J_eJ_t_;._~II... __cancel __ ...... Figure 3. Apache installation progress 8. During the installation process, a number of Command Prompt windows will pop open on your screen, and then automatically dose. This is the Apache installation program registering and starting the web service. Once the installation process has finished running, you will be informed that the installation is complete, as shown in Figure 4. Click Finish to exit the Installation Wizard. You should not need to reboot your machine after the installation. 465 Appendix Instalation Wuard Completed The Ins taHa lion Wizard ha s successfuly instaIled Apache HT1P Server 2.0.47. Ode Finish to exil the wizard. CanceJ Figure 4. CompletedApache installation Starting and Testing the Web Server When the installation is completed, you will have a new item in yom Start menu for Apache HTTP Server. Hyou chose the default installation of Apache running as a service, the installer will have already started the Apache service for you, and you can test the installation by opening yom web browser and entering the URL http://localhost, as shown in Figme 5. 466 Setting Up Your Environment Jfyou can see tbis, it means that the installation ofthe Apache web server software on tbis system was successful. Yon may DOW add cooleul to tbis directory and replace tbis page. Seeing thi instead of the website you expected? 'Ibis page is here because the site administrmor bas changed th.e configmation oftbis web server. Please CODfaCt file persoD respoDsible for mamtalruDi tllis server witla qD estioDs. Tbe Apache Software Foundation. which wrote the web server software Ibis sile admiDistratar is using, has nothing to da with maintaining this site and cann.ot help resol\"e configuration issues. Tbe Apache docnmentation has been included with this distnbution. You are free to use tbe image beJow on an Apache-powered web server. Thanks far using Apache! _ ".,...... P.A.C t-I E Figure 5. Browsing yaur newly installed site Hyou installed Apache to be started manually, you will need to navigate to the Apache HTTP Server submenu in the Start menu and start the Apache server yourself.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    71 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us