![]() |
Tuesday, December 05, 2023 |
By The Voodooman | what's new | faq | about |
Apache Installation Walkthrough
I. Before you start II. Downloads III. Installation IV. Configuration V. Credits N Stuff Sub-Sections1. Uncompress Files2. Compile MHASH 3. Compile MySQL 4. Compile DBI 5. Compile Msql/Mysql 6. Compile FreeTDS 7. Compile DBD-Sybase 8. Compile Apache/PHP 9. Install Zend Optimizer Reinstalling Features |
Installation InstructionsThese are the installation instructions that you have to follow to install Apache/PHP with database support. Depending on what features you decide to have (such as types of database support), you can skip certain sections.Important: It is necessary to follow the installation instructions in sequence otherwise some of the features may not work correctly. It is assumed that you know how to change directories, unzip files and use an editor under a *nix environment at this stage. It is also assumed that you've downloaded all the files to /usr/local/src. Modify the commands accordingly, if you're using a different directory. Some of the commands that are issued in the instructions below may be unfamiliar to you. If you are not really sure what the output of certain commands look like, then click on these images below for reference. Your screen should look like something similar when you issue the respective commands. 1. Uncompress FilesIt is assumed that you've already changed directories to /usr/local/src. If you've not done so, then type:
cd /usr/local/srcProceed to uncompress all the downloaded files as follows:
TOP 2. Compile MHASH ModuleNote that you need to do this step ONLY if you want to enable MHASH support for the PHP module. If you do not use any of PHP's mhash_xx functions, then you probably don't want this module. If you have already installed Apache completely and find that you need this module at a later time, then follow this step and then from step 8 to the end.
TOP 3. Compile MySQLNote that you need to do this step ONLY if you are using MySQL as your database engine and it is not already installed for you. If you've already installed Apache completely and find that you need this module at a later time, then follow this step, step 5 and then step 8 to the end.
Now, the next steps would be to create a mysql user account/group for the mysqld daemon to use and set the shell so that no one can login with this account. Also, we need to set the proper directory permissions for this account.
The last command should start up MySQL. Now all that remains is for you to secure it. See the Official MySQL Guide for documentation on how to secure your MySQL server. At the very minimum, you must set the password for the root account in MySQL (the default password is blank). To do this:
Instead of executing FLUSH PRIVILEGES, you can alternatively stop and start mysql (using /usr/local/bin/mysql.server) to reread the new password. Either way, after you do this, you should no longer be able to log into MySql using /usr/local/bin/mysql -u root. You should only be allowed to log in using /usr/local/bin/mysql -u root -p and only after you type the correct password. For more MySQL information, the best documentation is found on the official MySQL website. TOP 4. Compile DBIThis is the Database Independent driver for Perl. It is a good idea to install this anyway, because it does not affect the running of Apache.
TOP 5. Compile Msql-Mysql-modulesNote that you need to do this step ONLY if you are using MySQL as your database engine and it is not already installed for you. If you are going to do this step, you should have already completed step 3 first.
TOP 6. Compile FreeTDSNote that you need to do this step ONLY if you are using SQL Server as your database engine. Here's where things get a little different between Linux and FreeBSD. Follow the necessary steps according to your OS.FreeBSD/OpenBSD/NetBSD users ONLY
Some BSD systems do not have GNU make (gmake) installed by default. If this is the case, you'll need to download and install gmake and gettext for FreeTDS to compile correctly. The steps to do this are as follows:
For All Systems
The freetds driver (pre-version 0.60) doesn't quite follow the filesystem hierarchy standards and puts a file called interfaces into /usr/local. In order to comply with the standards, the author suggests moving the file into /usr/local/etc/ and renaming it something more meaningful like freetds.conf. If you are using freetds-0.60 or later, this is already done for you.
If you're using sh, bash or ksh for your shell, then type: If you're using csh, then type:
You may sometimes see the shell complain about ${LD_LIBRARY_PATH} not already being defined. If you see this error, ignore it and proceed forward. TOP 7. Compile DBD-SybaseThis is the Sybase Driver for Perl. It is a good idea to install this anyway, if you are using SQL Server, because it does not affect the running of Apache.
TOP 8. Compile Apache/PHPHere we are.... almost at the end of our journey! For installing apache, the following layout will be adopted by this guide:
You may change the directories to your own needs, as will be explained below.
TOP 9. Installing the Zend OptimizerThis is an optional step that is recommended, because the Zend Optimizer makes the PHP code run so much smoother when it is installed. To install the optimizer, do the following:
Next, create a file called php.ini in the directory /usr/local/lib using your favourite text editor. Add the following lines into it (adjusting your paths as necessary): zend_optimizer.optimization_level = 15 zend_extension = "/usr/local/libexec/ZendOptimizer.so" zend_loader.enable = Off ; Compress output for .gz compliant browsers output_handler = ob_gzhandler ; allow ASP-style <% %> tags asp_tags = Off ; number of significant digits displayed in floating point numbers precision = 14 ; Whether to be year 2000 compliant ;(will cause problems with non y2k compliant browsers) y2k_compliance = Off ; Implicit flush tells PHP to tell the output layer to flush itself implicit_flush = Off ; Decides whether PHP may expose the fact that it is installed on ; in the HTTP header reply expose_php = Off ; Maximum execution time of each script, in seconds max_execution_time = 30 ; Maximum amount of memory a script may consume (8MB) ;memory_limit = 8M sybase.interface_file = "/usr/local/etc/freetds.conf" ;error_reporting = E_ALL ;display_errors = OnYou may wish to adjust some of the parameters such as max_execution_time, precision etc. to your own requirements. Notice that some of the options (memory_limit, error_reporting, display_errors) are commented out. These options may be enabled for debugging and removed when you move the code into production. Feel free to experiment with the settings for your own optimal needs. TOP Reinstalling FeaturesLet's say you've installed apache completely and you wish to add or subtract something (let's say you want to enable the MHASH module and enable Image Mapping on Apache). It's pretty simple -- all you have to do is to repeat the steps from the module downwards (in this case Step 2). Don't forget that if something has already been compiled, then do a make clean before you type make at every stage. In this case, you'll need to do a make clean while recompiling apache in step 8. |
<<Previous: Downloads | ^Up to Mayukh's World^ | Next: Configuration >> |
Apache Installation Walkthrough
Last updated 08/01/2003