Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Apache HTTP Server

1. What is the Apache HTTP server?
2. How do I install the Apache HTTP Server?
3. How do I install PHP for the Apache HTTP Server?
4. How do I install MYSQL for the Apache HTTP Server?
5. How do I map URLs to folders outside /var/www/?
6. How do I change the default port number for the Apache HTTP Server?
7. How do I browse the changed port number for the Apache HTTP Server in Mozilla Firefox?
1.

What is the Apache HTTP server?

Apache is the world's most popular web server. It runs on both Unix-like and Windows operating systems, conforms to web standards and can be extended with additional modules. Its claimed the name “Apache” came from the fact that it originally consisted of changes to the NCSA HTTPd v1.3 server and therefore was “a patchy” server.

2.

How do I install the Apache HTTP Server?

  1. Read How do I add Universe and Multiverse?

  2. Install the apache2 package with Synaptic (See How do I use Synaptic to install packages?)

    World Wide Web > apache2

  3. https://localhost

3.

How do I install PHP for the Apache HTTP Server?

  1. Read How do I add Universe and Multiverse?

  2. Read How do I install the Apache HTTP Server?

  3. Install the php4 package with Synaptic (See How do I use Synaptic to install packages?)

    World Wide Web (universe) > php4

  4. sudo gedit /var/www/testphp.php

  5. Insert the following line into the new file

    <?php phpinfo(); ?>
  6. Save the edited file (sample/testphp.php_installphpapache)

  7. https://localhost/testphp.php

4.

How do I install MYSQL for the Apache HTTP Server?

  1. Read How do I add Universe and Multiverse?

  2. Read How do I install the Apache HTTP Server?

  3. Read How do I install a MYSQL Database Server?

  4. Read How do I install PHP for the Apache HTTP Server?

  5. Install the libapache2-mod-auth-mysql and php4-mysql packages with Synaptic (See How do I use Synaptic to install packages?)

    World Wide Web > libapache2-mod-auth-mysql
    World Wide Web (universe) > php4-mysql

  6. sudo /etc/init.d/apache2 restart

5.

How do I map URLs to folders outside /var/www/?

  1. Read How do I install the Apache HTTP Server?

  2. sudo gedit /etc/apache2/conf.d/alias

  3. Insert the following lines into the new file

    Alias /URL-path /location_of_folder/
    
    <Directory /location_of_folder/%gt;
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
  4. Save the edited file (sample/alias_mapURLstofoldersoutsidewww)

  5. sudo /etc/init.d/apache2 restart

  6. https://localhost/URL-path

6.

How do I change the default port number for the Apache HTTP Server?

[Note]

Assuming that the new port number is “79

  1. Read How do I install the Apache HTTP Server?

  2. sudo cp /etc/apache2/ports.conf /etc/apache2/ports.conf_backup
    sudo gedit /etc/apache2/ports.conf

  3. Find this line

    Listen 80
  4. Replace with the following line

     
    Listen 79
  5. Save the edited file (sample/ports.conf_changeportnumberapache)

  6. sudo /etc/init.d/apache2 restart

  7. https://localhost:79

7.

How do I browse the changed port number for the Apache HTTP Server in Mozilla Firefox?

[Note]

Assuming that the new port number is “79

  1. Read How do I change the default port number for the Apache HTTP Server?

  2. sudo cp /usr/lib/mozilla-firefox/greprefs/all.js /usr/lib/mozilla-firefox/greprefs/all.js_backup
    sudo gedit /usr/lib/mozilla-firefox/greprefs/all.js

  3. Find this section

    ...
    // If there is ever a security firedrill that requires
    // us to block certian ports global, this is the pref
    // to use.  Is is a comma delimited list of port numbers
    // for example:
    //   pref("network.security.ports.banned", "1,2,3,4,5");
    // prevents necko connecting to ports 1-5 unless the protocol
    // overrides.
    ...
  4. Add the following line below it

    pref("network.security.ports.banned.override", "79");
                                
  5. Save the edited file (sample/all.js_browsechangedportnumberfirefox)

  6. Restart Mozilla Firefox

 
 
  Published under the terms of the Creative Commons License Design by Interspire