Presentation is loading. Please wait.

Presentation is loading. Please wait.

Apache, PHP, MySQL Installation and configuration Web Programming with PHP,TITAS PROJECTIICT,BUET.

Similar presentations


Presentation on theme: "Apache, PHP, MySQL Installation and configuration Web Programming with PHP,TITAS PROJECTIICT,BUET."— Presentation transcript:

1 Apache, PHP, MySQL Installation and configuration Web Programming with PHP,TITAS PROJECTIICT,BUET

2 Operating Systems Author:Sayeef Salahuddin Operating Systems Windows InstallationConfiguration Linux InstallationConfiguration

3 I nstallation The Apache web-server is by default installed in most of the modern day linux systems. Apache web server is available in rpm format from which automatic installation will be performed Apache web-server is also available in both source and binary distribution format. Apache Web Server(Linux)

4 I nstallation For the source distribution we follow the following steps edit the Configuration file ( AddModule ) configure ( EXTRA_CFLAGS, LIBS, LDFLAGS, INCLUDES ) make copying and configuration ( to be discussed ) For the binary distribution only the 4 th step of the previous point is necessary. Apache Web Server(Linux)

5 I nstallation The Apache is available in.msi format The installation is quite straight forward. Apache is best suited for Windows NT and Windows2000-when used as a service Apache is best suited when used from the console window for Windows95/98 Apache Web Server(Windows)

6 I nstallation In most of the today’s linux systems PHP is by default installed. Lots of RPM packages are available which will automatically install PHP. Binary and Source distributions are also available. PHP(Linux)

7 I nstallation For a source distribution a typical configure option for installing with MySQl and apache will look like./configure --with-mysql –with-apxs=/www/bin/apxs make make install PHP(Linux)

8 I nstallation Key things to remember edit the php.ini file for options. The php.ini file is normaly located in /usr/local/lib/php.ini. Add the following lines to the httpd.conf or srm.conf if not already present AddType application/x-httpd-php.php LoadModule php4_module libexec/libphp4.so PHP(Linux)

9 I nstallation There are two ways to install PHP for windows As a CGI As a module To install as a CGI the following things should be present in the httpd.conf  ScriptAlias /php/ "c:/php/"  AddType application/x-httpd-php.php.phtml  Action application/x-httpd-php "/php/php.exe" It is assumed here that the package is for this particular case is in the c:\php directory. PHP(Windows)

10 I nstallation To install as a module the following things should be taken care of php4ts.dll should be copied to windows\system directory replacing any older file The following should be added to the httpd.conf file LoadModule php4_module c:/php/sapi/php4apache.dll AddType application/x-httpd-php.php.phtml It is assumed here that the package is for this particular case is in the c:\php directory. PHP(Windows)

11 I nstallation The recommended way to install MySQL on Linux is by using an RPM file The RPM files you may want to use are:  MySQL-VERSION.i386.rpm The MySQL server.  MySQL-client-VERSION.i386.rpm The standard MySQL client programs.  MySQL-bench-VERSION.i386.rpm Tests and benchmarks.  MySQL-devel-VERSION.i386.rpm Libraries and include files.  MySQL-VERSION.src.rpm This contains the source code for all of the above packages. MySQL(Linux)

12 I nstallation The recommended way to install MySQL on Windows is to use the precompiled binary distributions. The installation procedure is quite straight forward. The MySQL is by default set up to run from c:\mysql If connecting to MySQL from some other programs is necessary MyODBC driver will be required. MySQL(Windows)

13 Configuring Apache The Apache web server has 3 configuration files httpd.conf srm.conf access.conf Linux

14 Configuring Apache httpd.conf This is used to set the general settings such as the port number as well as to load modules. srm.conf This file sets the root documents, rules and other general settings access.conf This file deals with the access control of the server. Linux

15 Configuring Apache The parameters 1.ServerType standalone Inetd 2. Port normally 80 Any free port can be used Linux

16 Configuring Apache The parameters 3.User & Group user nobody group nobody Normally the httpd process is fired by the root but this does not listen for connections. This launches one or more child processes as the user and the group indicated with these configuration directives. Linux

17 Configuring Apache The parameters 4.ServerRoot base directory for the configuration files--- normally /etc/httpd 5. ServerName the name of the Web Server for example www.buet.ac.bd Linux

18 Configuring Apache The parameters 6.ServerAdmin this indicates the e-mail address of the administrator of the site. Linux

19 Configuring Apache Linux

20 Configuring Apache Linux

21 Configuring Apache Linux 7.DocumentRoot this identifies the directory where the root directory is located. 8.DirectoryIndex the index file name which will be accessed by the user.The normal entries for this is index.html,index.htm, index.shtml,index.php

22 Configuring Apache Linux 9.AccessFileName This specifies the file name for the access control of the server. The typical entry is AccessFileName.htaccess

23 Configuring Apache Linux 10.ScriptAlias This specifies the directory name where the scripts will be saved. A typical entry is like ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/

24 Configuring Apache Linux 11. Alias This specifies the directory name which can be accessed by the name specified. Atypical entry will be Alias /icons/ etc/httpd/icons/

25 Configuring Apache Linux 12. AddHandler and Addtype The AddHandler directive allows a file with a specific extension to be mapped to a particular action in the server or an external action. AddType creates a new MIME type for a specific extension. A typical entry is AddType text/html.shtml AddHandler server-parsed.shtml

26 Configuring Apache Linux A typical home directory configuration Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny Allow from all

27 Configuring Apache Linux Directives in brief Allowoveride Order allow Options

28 Configuring Apache Linux Access Control A typical.htaccess file has the follwing entries AuthName Students Only AuthUserFile /home/users AuthGroupFile /home/groups require group students

29 Configuring Apache Linux AuthName this will prompt the specified value. in this case Students Only AuthUserFile path of the user file AuthGroupFile path of the group file Require this is used to restrict access. In this case only students group is allowed. the syntax is require user user1,user2… or require group grou1,group2…

30 Configuring Apache Linux Virtual Hosting There are two types of virtual hosting The name based virtual hosting The IP based vitual hosting A typical name-based virtual hosting could be performed by adding the following lines to httpd.conf Listen 9000 ##the host parameters and rules and directives

31 Refences [1] The Apache User’s Manual (www.apache.org) [2] The MySQL User’s Maunual (ww.mysql.org) [3] The PHP user’s Manual (www.php.net) [4] Mastering Linux By Arman Danesh,Cybex [5] Linux Unleashed By David Pitts & Bill Boll,Tech Media Authored By -Sayeef Salahuddin Student No: 9606039


Download ppt "Apache, PHP, MySQL Installation and configuration Web Programming with PHP,TITAS PROJECTIICT,BUET."

Similar presentations


Ads by Google