Installation

Installing Webwork 2.7/Ubuntu 12.04 without a "server"

Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Jim Fischer -
Number of replies: 20
Hello,

Warning: rookie questions to follow. My questions below will illustrate how new I am to all of this :)

I am trying to learn some unix and also practice at installing webwork in a unix system. I am using a laptop that is not intended to be an actual web server. Im not sure how to adjust the installation directions given on the Wiki so that I can use WW locally.

More specifically, what I want to do is practice installing WW 2.7 with ubuntu 12.04 and will use github as described at the wiki. I want to use WebWork on my laptop just to try out the installation. The idea is that if I can become sufficient at doing this, I could then move to doing this on our department server (that I do not currently have root access).

For example, after installing ubuntu I need to modify the info.conf file in apache2. What do I use for replacing the following line?

# Allow from 192.0.2.0/24

There are a few other places where the server name and location are required. I was thinking I just use the url of my computer, just wasnt sure exactly how.

Similary what would the address be that I use in my firefox browser to access Webwork after I have done the installation?




In reply to Jim Fischer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Jim Fischer -
Later... Okay so now the rookie that is me realizes that I can in fact turn my laptop into a server. So that is what I will do and I will search for how to do this for my situation.

I have another question about network manager. In the Wiki installation notes for installing unbuntu 12.04 and WW 2.7 we are instructed to use the line

$sudo apt-get install gnome-network-admin
<wwadmin password>

I did this and got no errors. However, I dont see how to access the network administrator to follow the directions that follow...


In reply to Jim Fischer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Hedley Pinsent -
I typically (and mindlessly) follow the instructions for a particular operating system.
The document referred in the previous post (Alex Jordan) )would be a good place to start.

Also there has been a previous discussion from which you may gather some useful information.

http://webwork.maa.org/moodle/mod/forum/discuss.php?d=2830

regards
hp
In reply to Jim Fischer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Arnold Pizer -
Hi Jim,

Since you are installing this to test things out on you laptop, you can ignore things like "gnome-network-admin".  Your server URL is "localhost" which you will find referred to in a few places in the instructions and in the config files. E.g. in site.conf, you will find the line:
$server_root_url   = '';   # e.g.  'http://webwork.yourschool.edu' or 'http://localhost'

When you get WeBWorK up and running, connect to if from a browser on your laptop with the URL: http://localhost/webwork2

Help this helps. Good luck.

Arnie
In reply to Arnold Pizer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Jim Fischer -
Thanks for the responses, this helps a lot. I went thru your installation instructions. Everything seemed to unpack and run smoothly. However, when I try to view WebWork in a browser there is nothing there http:://localhost/webwork2 does not exist. Here is the result when I install Apache.

wwadmin@FunkeeMonkee:~$ sudo apache2ctl graceful
webwork.apache2-config: WeBWorK server is starting
webwork.apache2-config: WeBWorK root directory set to /opt/webwork/webwork2 in webwork2/conf/webwork.apache2-config
webwork.apache2-config: The following locations and urls are set in webwork2/conf/site.conf
webwork.apache2-config: PG root directory set to /opt/webwork/pg
webwork.apache2-config: WeBWorK server userID is www-data
webwork.apache2-config: WeBWorK server groupID is wwdata
webwork.apache2-config: The webwork url on this site is http://localhost/webwork2
WebworkSOAP::WSDL: webwork_directory set to /opt/webwork/webwork2 via $WeBWorK::Constants::WEBWORK_DIRECTORY set in webwork.apache2-config
WebworkSOAP::WSDL: rpc_url set to http://localhost/webwork2_rpc
WebworkWebservice: webwork_directory set to /opt/webwork/webwork2 via $WeBWorK::Constants::WEBWORK_DIRECTORY set in webwork.apache2-config
webwork.apache2-config: WeBWorK server is starting
webwork.apache2-config: WeBWorK root directory set to /opt/webwork/webwork2 in webwork2/conf/webwork.apache2-config
webwork.apache2-config: The following locations and urls are set in webwork2/conf/site.conf
webwork.apache2-config: PG root directory set to /opt/webwork/pg
webwork.apache2-config: WeBWorK server userID is www-data
webwork.apache2-config: WeBWorK server groupID is wwdata
webwork.apache2-config: The webwork url on this site is http://localhost/webwork2
Localize.pm: Full path for the localization directory set to |/opt/webwork/webwork2/lib/WeBWorK/Localize|
WebworkSOAP::WSDL: webwork_directory set to /opt/webwork/webwork2 via $WeBWorK::Constants::WEBWORK_DIRECTORY set in webwork.apache2-config
WebworkSOAP::WSDL: rpc_url set to http://localhost/webwork2_rpc
WebworkWebservice: webwork_directory set to /opt/webwork/webwork2 via $WeBWorK::Constants::WEBWORK_DIRECTORY set in webwork.apache2-config
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

In reply to Jim Fischer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Hedley Pinsent -
I would not worry about the error message about fqdn.
I get it also.
Another message to follow....
Attachment fqdn.png
In reply to Hedley Pinsent

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Hedley Pinsent -
There are two tests
a) localhost - to see if apache is working
b) localhost/webwork2 - to check the webwork

Another message to follow
Attachment TwoStage.png
In reply to Hedley Pinsent

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Hedley Pinsent -

I constantly run into issues about ownership and permissions; this could be due to a number of things (root copying the files, or the history of the file, etc).

You might possibly review the permissions section of the documentation; kind of like a doctor telling you to get lots of rest - how can it hurt.

The command line/ terminal is the best/only (?) way to do this; you can use the GUI to check your results.


Part of the documentation file follows...

Setting Permissions

The PG installation directory and files should be owned by wwadmin and not writable by other users:

$ cd /opt/webwork/pg $ chmod -R u+rwX,go+rX . 

Most WeBWorK directories and files should also be owned by wwadmin and not writable by other users:

$ cd /opt/webwork/webwork2 $ chmod -R u+rwX,go+rX . 

Certain data directories need to be writable by the web server. These are DATA, courses, htdocs/tmp, logs, and tmp. It is convenient to give WeBWorK administrators access to these directories as well, so they can perform administrative tasks such as removing temporary files, creating and editing courses from the command line, managing logs, and so on. We will create a new group called wwdata, containing both the WeBWorK administrators and the web server. Run the commands

$ sudo addgroup wwdata <wwadmin password> $ sudo adduser wwadmin wwdata 

If there are other users who will also be administering WeBWorK files, now is a good time to add them. To do this

  1. Open Dash Home, type User and open User Accounts
  2. Click the "Unlock" icon and enter the <wwadmin password>
  3. Click the "+" icon and create the new account
  4. And remember to add the new account to the wwdata group as above.

Now add the Apache2 webserver (which runs as www-data) to the wwdata group:

$ sudo adduser www-data wwdata 

You can check that this succeeded in a terminal window by entering

$ id wwadmin 

and then you should see wwdata listed under groups. Also

$ id www-data 

should show wwdata listed under groups. Now we make the WeBWorK directories that need to be writable by the web server have wwdata as their group. The following are rather long commands; you might want to copy them and paste them into your terminal window rather than typing them.

$ su Password: <root password> # cd /opt/webwork/webwork2/ # chgrp -R wwdata DATA ../courses htdocs/tmp logs tmp # chmod -R g+w DATA ../courses htdocs/tmp logs tmp # find DATA/ ../courses/ htdocs/tmp logs/ tmp/ -type d -a -exec chmod g+s {} \; # exit $ 

In reply to Hedley Pinsent

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Jim Fischer -
Yes, the localhost exists and I get the message " It works!"

However, the webwork2 directory does not seem to exist.

I went thru the permissions directions again, and reran apache install. Same result.



In reply to Jim Fischer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Arnold Pizer -
Hi Jim 

Did you
$ cd /opt/webwork/webwork2/conf
$ cp webwork.apache2-config.dist webwork.apache2-config

(see http://webwork.maa.org/wiki/Installation_Manual_for_2.7_on_Ubuntu_12.04#Configuring_Apache)

Arnie
In reply to Arnold Pizer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Jim Fischer -
Yes. I did all of the commands up to "Test your configuration" . I was careful and went line by line using copy/paste

The only things I skipped were the stuff related to gnome-network-admin

(however, I did run the command $sudo apt-get install gnome-network-admin)

Im using a 32 bit machine in case that makes a difference.

Ive explored the folder /opt/webwork/webwork2 and all seems to be there.

I can see the pages http://localhost/webwork2_files and http://localhost using firefox but when I try http://localhost/webwork2 the browser cant find a page

I know you said I dont need to mess with the network administrator program that I installed using $sudo apt-get install gnome-network-admin. but I am curious why I cant "see" that program?


In reply to Jim Fischer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Hedley Pinsent -
The gnome-network-admin is the part which I find the most confusing; therefore I don't know what I am talking about.

However, perhaps you have over-achieved in this area and what remains are additional items that are confusing the system.

Attached is a composite screenshot showing the different tabs in the network admin gui; yours may be adjusted to match.

In the background is the install document for 2.5 as this was in addition to the release notes what I worked from.

In my next post I will attach a copy of my site.conf.

I contemplated attaching my directory structure but it is not "clean"
Attachment gnomeComposite.png
In reply to Hedley Pinsent

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Hedley Pinsent -
In reply to Hedley Pinsent

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Jim Fischer -
Thanks for those files and info. I have the same site.conf file

In ubuntu software center I see that gnome-network-admin has been installed. Okay, now I found it. I will try to set it as you have illustrated and also use the installation guide.



In reply to Jim Fischer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Arnold Pizer -
Hi Jim,

Can you please post the results from

diff site.conf site.conf.dist
(after changing the database_password) and also
 diff webwork.apache2-config webwork.apache2-config

Thanks,

Arnie
In reply to Arnold Pizer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Jim Fischer -
Below is result when comparing site.conf and site.conf.dist in the
opt/webwork/webwork2/conf folder

when I ran $ diff webwork.apache2-config webwork.apache2-config.dist

there was no difference.





49c49
< $server_root_url = 'http://localhost'; # e.g. 'http://webwork.yourschool.edu' or 'http://localhost'
---
> $server_root_url = ''; # e.g. 'http://webwork.yourschool.edu' or 'http://localhost'
151c151
< $database_password ="milo1sc00l";
---
> $database_password ="passwordRW";
211c211
< $siteDefaults{timezone} = "America/Los_Angeles";
---
> $siteDefaults{timezone} = "America/New_York";



In reply to Jim Fischer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Arnold Pizer -
Thanks Jim,

This looks correct and actually the output you get when restarting apache2 " webwork.apache2-config: The webwork url on this site is http://localhost/webwork2" shows webwork.apache2-config is being read has the correct info.

When you try "http://localhost/webwork2" I assume you are just getting the standard error message "The requested URL /webwork2 was not found on this server."

At this point I really don't have an idea as to what's wrong.  Hopefully somebody else has an idea as to what to check.

Arnie
In reply to Arnold Pizer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Jim Fischer -
Actually I think you are on to something. I never bothered to see if the error message would be different when trying to use a known made-up address.

When trying to access loalhost/webwork2 using firefox I get the error message

! The connection was reset
The connection to the server was reset while the page was loading

When using chromium:

No data received
Unable to load the webpage because the server sent no data

However, if I try to access localhost/manifold I get the common error message

Not Found

The requested url /manifold was not found on this server
-------------------------------------------------------------------------------
Apache/2.2.22 (Ubuntu) Sever at localhost Port 80

Also, I discovered why I got no difference when applying diff to the webwork.apache2-config files. I had accidently ran the copy command twice when I was redoing some of the commands.

Anyway, at the risk of wasting some time I have decided to reinstall ubuntu and start over with a clean slate.

I will post results later.

Jim
In reply to Jim Fischer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Arnold Pizer -
Hi Jim,

I think reinstalling is a good idea.  I'd follow the directions http://webwork.maa.org/wiki/Installation_Manual_for_2.7_on_Ubuntu_12.04
with a lot of copy and pasting of commands.

Actually webwork.apache2-config should be identical to webwork.apache2-config.dist in your case, but the file webwork.apache2-config needs to be there.

Good luck and let everyone know how this turns out since others may have similar problems (although I don't think anyone has reported this particular problem).

Arnie 
In reply to Jim Fischer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Arnold Pizer -
Hi Jim,

It occurs to me that we never answered your original question because it was not relevant to the problem you were having.  However, others may be interested in how to open the network manager. I have updated http://webwork.maa.org/wiki/Installation_Manual_for_2.7_on_Ubuntu_12.04#Apache_2_and_mod_perl
but haven't tested out the procedure with 12.04 but it should be the same. Copying from there:

After this is installed
To open the network manager select Dash Home and type Network.
Click on Network (not the one with the folder icon)
Click unlock
Enter <wwadmin password> and click Authenticate

In reply to Arnold Pizer

Re: Installing Webwork 2.7/Ubuntu 12.04 without a "server"

by Jim Fischer -
Success!! 2nd time worked fine.
I cant believe I made a mistake the first time wink

Thanks so much for patiently working with me. It is great to see the new version!

I noticed that you folks are working fast as the MLT tagging changes we made in Virginia last week are already available.

FYI
This isnt the best place to bring it up, but I noticed that the section lists are alphabetical. When we were tagging problems last week, we were using a local browser in VA where Jeff was able to list the sections in a more course/logical order.

Next Im going to install the CAPA library, Ive always wanted to see whats in there...