Basic Red Hat Linux Server Guide
Posted :: Jun 15, 2004 by Impact




Since this computer will eventually be used for a server, I need to install some programs. The first of which will be a web-server running Apache2 and PHP. The only way to get a copy of PHP is to download it from php.net and install it, same with apache2 from apache.org. This involves opening Mozilla (the web browser) and downloading from php.net and apache.org respectively.

If you have ever used a web browser, you should be able to navigate Mozilla without a problem; therefore, downloading PHP was easy.

Mozilla, the built-in Web Browser is very easy to use and navigate.

After decompressing the download (tar.gz) found in my /root folder (where I chose to download it), I ran into a slight problem. In Linux there are no "Install" Icons. In Windows (my main operating system till recently) there have always been "Install" icons. You would click these, and the program would install itself on your computer, make a nice icon on the desktop for you, and add entries to your Start menu. In Linux this is not the case. Almost everything in the PHP folder is a script. This left me a slight bit baffled at first. I didn't know what language they were in, or more importantly, how to run them.

To install a program that is in all source files (I will be using PHP and Apache2 in my examples) it requires the use of Linux's "Terminal". The Terminal is somewhat like a DOS (text-based) prompt. It is a command line used for issuing commands to the system. You can find it by going to RedHat --> System Tools --> Terminal. When the Terminal loads you will see a prompt. The idea is to navigate to the folder that contains the install files. The command 'ls' (LS in lowercase) can be used to list the files and folders in a directory, 'cd xxxxx' to change directories, and 'cd ..' to go up a directory.

The first step is to install Apache2. To get into the Apache2 directory you need to type 'cd httpd-2.0.49' assuming you unzipped the Apache2 folder into your root directory. Once in the directory you normally use the command './configure'. This will configure the installation, you can set flags to the end of the line to change options. In our case we need to install Apache2 with support for DSO modules (makes it easier to implement PHP). To do this, we need to use the command './configure --enable-so'. You should see the Terminal start running the configure script. When its complete you will be back at the prompt, and be ready to run your next command. The next command on the list is 'make'. By typing 'make' you will tell Linux to compile all of the source documents. When it's complete, all you will need to do is type 'make install' and it will finish installing Apache2.

Once Apache2 is finished installing, you will need to install PHP as a module of Apache2 (so they work together). To do this, just follow the same steps as above (but with different flags on './configure'). In my case I wanted to navigate to '/root/php-4.3.7/'. I did this by first going up a directory (from /root/httpd-2.0.49 to /root/). To go up a directory type 'cd ..'. Once in the /root directory I moved to the PHP folder: 'cd php-4.3.7'. You could have done this in one step by typing 'cd /root/php-4.3.7' from the Apache directory. After reaching the PHP folder the next thing was to build the source code and install the program. To install, we use the same method as before (same 3 steps), but with different flags on './configure'. In this case, run:
'./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql'
To explain this command:
./configure = Run the configure script in the current directory
--with-apxs2=/usr/local/apache2/bin/apxs = Configure with Apxs2 (Apache2) and let PHP know where apxs is. (This is the default directory for Apache2, we didn't change any variables for where it was installed to, so we pass ./configure the default path).
--with-mysql = This tells PHP to compile with support for MySQL (our database server) which will be installed later.

After running the configure script, the command 'make' compiled the source documents in the folder. The last of the three commands, 'make install', installs the program to the default program directory (the default directory is normally '/usr/bin').

After installing apache and php, copy the php.ini-dist file into the following directory: /usr/local/lib/php.ini
If you are still at the command prompt, you can easily do this by typing:
'cp php.ini-dist /usr/local/lib/php.ini'

Note: If you have any questions or problems, your best bet is to check http://us4.php.net/install.apache2. (If you are still having problems, please check my note on the next page about httpd.conf scripts).

You have now installed your first two applications in Linux (and they are built on each other as well). To see what options were available for each command during the installation process, type '(command) -h'. The '-h' stands for help, and will show a list of available flags that can be used for a given command.


Back a Page   The Linux Desktop Comments :: 4
View Comments
Apache   Next Page
ATI Catalyst 4.8 & 4.9, Omega,...
Latest ATI Catalyst, Omega, and DN...
PSP Homebrew Roundup
Basic Red Hat Linux Server Guide
Band Review :: Dispatch
  Hottest Threads:
Ask Naniipo

  Most Posts Today:
  Most Posts Ever: Anonymous

Copyright 2004-2005 Absolute Insight