Apache Web Server

only for RuBoard - do not distribute or recompile

Apache Web Server

The Apache Web server is the heart of the installation. The server runs the PHP scripts that access the user 's mail. I will show you how to ensure your Apache server is properly installed.

Verifying Apache Installation

Next, you need to see which version of Apache Web server you are running. Run rpm in the query mode for all packages, and grep for Apache:

[root@wmaxlaptop root]# rpm -qa grep apache

Output

 apache-1.3.9-4 apache-devel-1.3.9-4 

If you don't get a printout similar to this, you do not have the Apache Web server installed. If you don't have both the Apache Web server and the Apache development package currently installed, you must make a choice. You must find the development rpm for your version of Apache on the Internet and install it, or remove the current version of Apache and its modules.

NOTE

If you will be putting this server on the Internet, it is very important that you use the latest stable Apache Web server. It is updated to fix security issues as well as minor bugs .


If you decide to remove your installed version of Apache, shut down the service. To do this, enter the following in a terminal window:

[root@maxlaptop root]#/etc/rc.d/init.d/httpd stop

Next, remove the current Apache server:

[root@wmaxlaptop root]# rpm -e apache apache-devel

Note that I included the apache-devel package on the same line as the apache package. The rpm utility allows you to install or remove multiple packages with one command.

Now change to the imp directory and run rpm with the install option for each of the Apache packages you have decided to install.

[root@wmaxlaptop impcd]# rpm -i apache-1.3.9-4.i386.rpm apache-devel-1.3.9-4.i386.rpm

You should specify the entire package name without using the wildcard character (the asterisk * ) when installing an rpm file. This prevents costly mistakes.

After the server is installed, you must start it. This process is similar to stopping the server, only you enter the word start:

[root@winbook root]#/etc/rc.d/init.d/httpd start

To verify the server has started, run the ps command, and grep for the httpd daemon:

[root@winbook root]# ps ax grep httpd

Output

 514 ?        S      0:00 httpd   518 ?        SW     0:00 [httpd]   519 ?        SW     0:00 [httpd]   520 ?        SW     0:00 [httpd]   521 ?        SW     0:00 [httpd]   522 ?        SW     0:00 [httpd]   523 ?        SW     0:00 [httpd]   524 ?        SW     0:00 [httpd]   525 ?        SW     0:00 [httpd]   526 ?        SW     0:00 [httpd]   527 ?        SW     0:00 [httpd]   975 pts/1    S      0:00 grep httpd 

You should get a listing similar to this. If you don't, try removing and re-installing the Apache packages. You must have both the Apache and Apache-devel packages installed for this project to work. Both of the Apache packages must be of the same version.

Testing the Web Server Locally

If you are running the X Window System, execute the Netscape program. It will display its default Web page. Enter the following:

http://127.0.0.1

You should see the "It Worked!" Web page that the default Apache server configuration displays. If you don't, you need to use rpm to remove the Apache Web server ( rpm -e ) and try installing it again. You can also try a reinstall of Red Hat Linux.

If you are not running the X Window System on your Linux server, log on to a console and enter the following command:

lynx http://127.0.0.1

This brings up a text version of the "It Worked!" Web page if your Apache Web server is functioning properly. If not, remove Apache and reinstall.

Testing the Web Server from Another Computer

Testing from the network is much like testing from the X Window System. Run Internet Explorer (IE) or Netscape on your Windows machine. Enter the URL as follows :

http://lin

The browser will contact the server and display the default page. The top line of the page will declare "It Worked!"

If you don't get this page, you can get an HTTP/1.1 404 Not Found error. You can also get an "Unable to locate the server" type of message.

The 404 error message indicated that you were able to communicate with the server, but it did not have the page you were asking for. This indicates your Web server is working, but has configuration problems.

The unable to locate the server message indicates that you have not entered a name the Web browser was able to turn into an IP address. Check the following things:

  • Your c:\windows\ hosts file can have errors in it, or not exist.

  • Check the spelling of the machine name in the browser URL line.

  • Check the spelling of the machine name in the hosts file.

  • Check the IP address on your Linux machine to make sure it matches the address in the hosts file.

only for RuBoard - do not distribute or recompile


MySQL and PHP From Scratch
MySQL & PHP From Scratch
ISBN: 0789724405
EAN: 2147483647
Year: 1999
Pages: 93
Authors: Wade Maxfield

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net