Configuration

Scott Harrison, freeware volunteer, sharrison@sourceforge.net

Configuring the Apache Web Server

The configuring of the Apache Web Server and the input of LON-CAPA configuration values is handled automatically by the ./UPDATE command. In this document, the details of what the ./UPDATE command facilitates are described.

/etc/httpd/conf/httpd.conf is adjusted to include the LON-CAPA web server configuration. This happens by appending the following line to httpd.conf:

Include conf/loncapa_apache.conf

The /etc/httpd/conf/loncapa_apache.conf file customizes the Apache Web Server to have the needed configuration to deliver LON-CAPA on the world-wide web. The loncapa_apache.conf file does not contain any information specified by the system administrator. The loncapa_apache.conf file does, however, cause loncapa.conf to be included. /etc/httpd/conf/loncapa.conf contains only information specified by the system administrator. Generally speaking, the information inside /etc/httpd/conf/loncapa.conf is machine-specific (each LON-CAPA server has its own specific values inside loncapa.conf).

/etc/httpd/conf/loncapa_apache.conf performs the following customizations of the Apache Web Server:

/etc/httpd/conf/loncapa.conf specifies machine-specific values that are accessible to the perl web handler modules. Ordinarily, these values are not to be entered manually. These values are interactively solicited from the system administrator by the loncapa/doc/loncapafiles/updatequery.piml file. The following values comprise the loncapa.conf file:

Configuring the LON-CAPA Network

In order for LON-CAPA to connect to other servers that provide educational resources or to balance the load of high-volume web-requests, there needs to be a way to access information that describes the other LON-CAPA servers present on the internet.

/home/httpd/lonTabs/hosts.tab defines all of the other machines that a given LON-CAPA server can interact with. (In a sense, this is a mechanism of security so that connections cannot be attempted from spurious entities.)

The format of hosts.tab is to define each LON-CAPA server on separate lines. Each line is field-separated by colons ':'.

An example entry in hosts.tab is:

vulon1:msuvu:library:loncapa3.vu.msu.edu:35.9.80.250

The first field is the LON Host ID (see the above description of loncapa.conf). The second field is the Domain Name. The third field is the server type (see the section "Different Types of LON-CAPA Servers"). The fourth field is a DNS-registered full IP name. The fifth field is the numeric IP address.

/home/httpd/lonTabs/spare.tab is a list of LON Host IDs corresponding to Access Servers (or Library Servers). spare.tab should not be the same on every LON-CAPA server machine. The purpose of this list is to specify other servers toward which user web requests can be re-directed. Current experience is that the servers on spare.tab are particularly active (and much needed) shortly before homework assignments are due....

An example of spare.tab relates to the Library Server vulon1 which load-balances the requests onto two other Access Servers as shown in the example spare.tab below:

vulona1
vulona2

Configuring MySQL

The following commands describe how to configure the MySQL database on your LON-CAPA server.
Note:

The following instructions assume you are logged in as 'root'.

Entering the mysql shell

 mysql -u root -p mysql OR mysql -u root mysql (depending on whether you have set a root password) 

Creating the mysql 'www' user (after entering mysql shell)

 mysql> CREATE DATABASE loncapa;  mysql> INSERT INTO user (Host, User, Password) mysql> VALUES ('localhost','www',password('localhostkey'));  mysql> GRANT ALL PRIVILEGES ON loncapa.* TO www@localhost;  mysql> FLUSH PRIVILEGES; 

SECURITY: set a password for the mysql 'root' user

 shell> mysql -u root mysql mysql> SET PASSWORD FOR root@localhost=PASSWORD('ROOTPASSWORD'); 

SECURITY: only allow access from localhost

 shell> mysql -u root -p mysql mysql> DELETE FROM user WHERE host<>'localhost';