个人工具

“UbuntuHelp:MoodleZope”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的2个中间版本)
第7行: 第7行:
 
mysql-admin as well.
 
mysql-admin as well.
 
== Setting up the server ==
 
== Setting up the server ==
0. install ubuntu 5.04 server
+
<ol><li>install ubuntu 5.04 server
0. edit <code><nowiki>/etc/network/interfaces</nowiki></code> for static ip address by changing the primary interface to:
+
</li><li>edit <code><nowiki>/etc/network/interfaces</nowiki></code> for static ip address by changing the primary interface to:</li></ol>
 +
 
 
<pre><nowiki>
 
<pre><nowiki>
# The primary network interface
+
    # The primary network interface
iface eth0 inet static
+
    iface eth0 inet static
address 158.59.195.113
+
        address 158.59.195.113
netmask 255.255.252.0
+
        netmask 255.255.252.0
gateway 158.59.192.1
+
        gateway 158.59.192.1
</nowiki></pre>
+
    </nowiki></pre>
0. edit <code><nowiki>/etc/apt/sources.list</nowiki></code> removing cdrom source at top and uncommenting universe sources
+
<ol><li>edit <code><nowiki>/etc/apt/sources.list</nowiki></code> removing cdrom source at top and uncommenting universe sources
0. do the apt-get dance (<code><nowiki>apt-get update</nowiki></code> and <code><nowiki>apt-get upgrade</nowiki></code>)
+
</li><li>do the apt-get dance (<code><nowiki>apt-get update</nowiki></code> and <code><nowiki>apt-get upgrade</nowiki></code>)
0. install the following using apt-get:
+
</li><li>install the following using apt-get:</li></ol>
 +
 
 
* ssh
 
* ssh
 
* zip and unzip
 
* zip and unzip
第25行: 第27行:
 
* phpmyadmin
 
* phpmyadmin
 
== Configuring mysql ==
 
== Configuring mysql ==
0. Point a web brower at <code><nowiki>http://158.59.195.113/phpmyadmin/</nowiki></code>
+
<ol><li>Point a web brower at <code><nowiki>http://158.59.195.113/phpmyadmin/</nowiki></code>
0. By default, username <code><nowiki>root</nowiki></code> with no password is enabled
+
</li><li>By default, username <code><nowiki>root</nowiki></code> with no password is enabled
0. Login, click on "Change password", and change the password
+
</li><li>Login, click on "Change password", and change the password
0. Click "Databases", fill-in "Create new database" with <code><nowiki>moodle</nowiki></code> and click "Create"
+
</li><li>Click "Databases", fill-in "Create new database" with <code><nowiki>moodle</nowiki></code> and click "Create"
0. Click "Privileges" then "Add a new User"
+
</li><li>Click "Privileges" then "Add a new User"
0. Add user <code><nowiki>moodle</nowiki></code> with all "Data" and "Structure" privileges checked
+
</li><li>Add user <code><nowiki>moodle</nowiki></code> with all "Data" and "Structure" privileges checked</li></ol>
 +
 
 
== Configuring Apache Modules ==
 
== Configuring Apache Modules ==
 
* As root, run the following:
 
* As root, run the following:
第36行: 第39行:
 
* Repeat with <code><nowiki>proxy_connect.load</nowiki></code> and <code><nowiki>proxy.load</nowiki></code>
 
* Repeat with <code><nowiki>proxy_connect.load</nowiki></code> and <code><nowiki>proxy.load</nowiki></code>
 
== Configuring virtual hosts ==
 
== Configuring virtual hosts ==
0. Edit <code><nowiki>/etc/apache2/apache2.conf</nowiki></code>, adding a <code><nowiki>NameVirtualHost</nowiki></code> line, so that the last three lines of the file look like this:  
+
<ol><li>Edit <code><nowiki>/etc/apache2/apache2.conf</nowiki></code>, adding a <code><nowiki>NameVirtualHost</nowiki></code> line, so that the last three lines of the file look like this: <pre><nowiki>
<pre><nowiki>
+
    # Include the virtual host configurations
# Include the virtual host configurations
+
    NameVirtualHost 158.59.195.113:80
NameVirtualHost 158.59.195.113:80
+
    Include /etc/apache2/sites-enabled/[^.#]* </nowiki></pre>
Include /etc/apache2/sites-enabled/[^.#]* </nowiki></pre>
+
</li><li>Create a file named azi.conf in /etc/apache2/sites-available with the following: <pre><nowiki>
0. Create a file named azi.conf in /etc/apache2/sites-available with the following:  
+
    <VirtualHost 158.59.195.113:80>
<pre><nowiki>
+
    ServerName linus.yhspatriot.net
<VirtualHost 158.59.195.113:80>
+
    ServerAdmin [email protected]
ServerName linus.yhspatriot.net
+
    ProxyRequests off
ServerAdmin [email protected]
+
    <Proxy *>
ProxyRequests off
+
    Order deny,allow
<Proxy *>
+
    Allow from all
Order deny,allow
+
    </Proxy>
Allow from all
+
    ProxyPass / http://158.59.195.113:8080/
</Proxy>
+
    ProxyPassReverse / http://158.59.195.113:8080/
ProxyPass / http://158.59.195.113:8080/
+
    ProxyPass /misc_ http://158.59.195.113:8080/misc_
ProxyPassReverse / http://158.59.195.113:8080/
+
    ProxyPassReverse /misc_ http://158.59.195.113:8080/misc_
ProxyPass /misc_ http://158.59.195.113:8080/misc_
+
    ProxyPass /p_ http://158.59.195.113:8080/p_
ProxyPassReverse /misc_ http://158.59.195.113:8080/misc_
+
    ProxyPassReverse /p_ http://158.59.195.113:8080/p_
ProxyPass /p_ http://158.59.195.113:8080/p_
+
    </VirtualHost>
ProxyPassReverse /p_ http://158.59.195.113:8080/p_
+
 
</VirtualHost>
+
 
<VirtualHost 158.59.195.113:80>
+
    <VirtualHost 158.59.195.113:80>
ServerName mysql.yhspatriot.net
+
    ServerName mysql.yhspatriot.net
ServerAdmin [email protected]
+
    ServerAdmin [email protected]
ProxyRequests off
+
    ProxyRequests off
<Proxy *>
+
    <Proxy *>
Order deny,allow
+
    Order deny,allow
Allow from all
+
    Allow from all
</Proxy>
+
    </Proxy>
DocumentRoot /var/www/phpmyadmin/
+
 
Options +FollowSymLinks
+
    DocumentRoot /var/www/phpmyadmin/
<IfModule mod_php4.c>
+
 
php_flag magic_quotes_gpc On
+
    Options +FollowSymLinks
php_flag magic_quotes_runtime Off
+
 
php_flag file_uploads On
+
    <IfModule mod_php4.c>
php_flag short_open_tag On
+
            php_flag magic_quotes_gpc On
php_flag session.auto_start Off
+
            php_flag magic_quotes_runtime Off
php_flag session.bug_compat_warn Off
+
            php_flag file_uploads On
php_value upload_max_filesize 2M
+
            php_flag short_open_tag On
php_value post_max_size 2M
+
            php_flag session.auto_start Off
</IfModule>
+
            php_flag session.bug_compat_warn Off
<IfModule mod_dir.c>
+
 
DirectoryIndex index.php
+
            php_value upload_max_filesize 2M
</IfModule>
+
            php_value post_max_size 2M
</VirtualHost>
+
    </IfModule>
<VirtualHost 158.59.195.113:80>
+
 
ServerName moodle.yhspatriot.net
+
    <IfModule mod_dir.c>
ServerAdmin [email protected]
+
            DirectoryIndex index.php
ProxyRequests off
+
    </IfModule>
<Proxy *>
+
    </VirtualHost>
Order deny,allow
+
 
Allow from all
+
 
</Proxy>
+
    <VirtualHost 158.59.195.113:80>
DocumentRoot /var/www/moodle/
+
    ServerName moodle.yhspatriot.net
Options +FollowSymLinks
+
    ServerAdmin [email protected]
<IfModule mod_php4.c>
+
    ProxyRequests off
php_flag magic_quotes_gpc On
+
    <Proxy *>
php_flag magic_quotes_runtime Off
+
    Order deny,allow
php_flag file_uploads On
+
    Allow from all
php_flag short_open_tag On
+
    </Proxy>
php_flag session.auto_start Off
+
 
php_flag session.bug_compat_warn Off
+
    DocumentRoot /var/www/moodle/
php_value upload_max_filesize 2M
+
 
php_value post_max_size 2M
+
    Options +FollowSymLinks
</IfModule>
+
 
<IfModule mod_dir.c>
+
    <IfModule mod_php4.c>
DirectoryIndex index.php
+
            php_flag magic_quotes_gpc On
</IfModule>
+
            php_flag magic_quotes_runtime Off
</VirtualHost></nowiki></pre>
+
            php_flag file_uploads On
0. create a sym-link in sites-enabled:
+
            php_flag short_open_tag On
 +
            php_flag session.auto_start Off
 +
            php_flag session.bug_compat_warn Off
 +
 
 +
            php_value upload_max_filesize 2M
 +
            php_value post_max_size 2M
 +
    </IfModule>
 +
 
 +
    <IfModule mod_dir.c>
 +
            DirectoryIndex index.php
 +
    </IfModule>
 +
    </VirtualHost></nowiki></pre>
 +
</li><li>create a sym-link in sites-enabled:</li></ol>
 +
 
 
<code><nowiki>ln -s /etc/apache2/sites-available/azi.conf /etc/apache2/sites-enabled/azi.conf</nowiki></code>
 
<code><nowiki>ln -s /etc/apache2/sites-available/azi.conf /etc/apache2/sites-enabled/azi.conf</nowiki></code>
 
== Installing moodle ==
 
== Installing moodle ==
第112行: 第128行:
 
several unsuccessful attempts to use the moodle package I found it much easier to install moodle from source,
 
several unsuccessful attempts to use the moodle package I found it much easier to install moodle from source,
 
using the following proceedure:
 
using the following proceedure:
0. Download the latest moodle source
+
<ol><li>Download the latest moodle source</li></ol>
 +
 
 
(<code><nowiki>wget http://download.moodle.org/stable15/moodle-1.5.2.tgz</nowiki></code> worked at the time this
 
(<code><nowiki>wget http://download.moodle.org/stable15/moodle-1.5.2.tgz</nowiki></code> worked at the time this
 
was written
 
was written
0. Untar it in <code><nowiki>/var/www</nowiki></code>
+
<ol><li>Untar it in <code><nowiki>/var/www</nowiki></code>
0. Point a web browser at <code><nowiki>http://158.59.195.113/moodle</nowiki></code>
+
</li><li>Point a web browser at <code><nowiki>http://158.59.195.113/moodle</nowiki></code>
0. Run through all the setup pages:
+
</li><li>Run through all the setup pages:</li></ol>
 +
 
 
* use <code><nowiki>/var/moodledata</nowiki></code> for data directory (as root):
 
* use <code><nowiki>/var/moodledata</nowiki></code> for data directory (as root):
0. <code><nowiki>mkdir /var/moodledata</nowiki></code>
+
<ol><li><code><nowiki>mkdir /var/moodledata</nowiki></code>
0. <code><nowiki>chown www-data.www-data /var/moodledata</nowiki></code>  
+
</li><li><code><nowiki>chown www-data.www-data /var/moodledata</nowiki></code></li></ol>
 +
 
 
== Installing zope2.7 ==
 
== Installing zope2.7 ==
 
As root:
 
As root:
0. <code><nowiki>apt-get install zope2.7</nowiki></code>
+
<ol><li><code><nowiki>apt-get install zope2.7</nowiki></code>
0. <code><nowiki>apt-get install zope-zwiki</nowiki></code>
+
</li><li><code><nowiki>apt-get install zope-zwiki</nowiki></code>
0. <code><nowiki>mkzope2.7instance</nowiki></code>
+
</li><li><code><nowiki>mkzope2.7instance</nowiki></code>
0. edit <code><nowiki>/var/lib/zope2.7/instance/linus/etc/zope.conf</nowiki></code> changing <code><nowiki>http-server</nowiki></code> port to 8080
+
</li><li>edit <code><nowiki>/var/lib/zope2.7/instance/linus/etc/zope.conf</nowiki></code> changing <code><nowiki>http-server</nowiki></code> port to 8080</li></ol>
 +
 
 
Now log into your zope instance and create a <code><nowiki>SiteRoot</nowiki></code>, setting the <code><nowiki>Base</nowiki></code> to <code><nowiki>http://linus.yhspatriot.net</nowiki></code> and the <code><nowiki>Path</nowiki></code> to <code><nowiki>/</nowiki></code>.
 
Now log into your zope instance and create a <code><nowiki>SiteRoot</nowiki></code>, setting the <code><nowiki>Base</nowiki></code> to <code><nowiki>http://linus.yhspatriot.net</nowiki></code> and the <code><nowiki>Path</nowiki></code> to <code><nowiki>/</nowiki></code>.
 
----
 
----
[[category:CategoryDocumentation]]
 
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2009年5月12日 (二) 17:54的最新版本

Goal

To run moodle (http://moodle.org/) and zope2.7 (http://www.zope.org/) on port 80 of our school computer science web server (http://linus.yhspatriot.net). We are behind a firewall with only port 80 open, so I needed to setup virtual hosting with apache2 to make this work. I wanted linus.yhspatriot.net to point to a zope2.7 instance, and moodle.yhspatriot.net to point to a moodle instance. I found it convenient to have mysql.yhspatriot.net point to mysql-admin as well.

Setting up the server

  1. install ubuntu 5.04 server
  2. edit /etc/network/interfaces for static ip address by changing the primary interface to:
    # The primary network interface
    iface eth0 inet static
        address 158.59.195.113
        netmask 255.255.252.0
        gateway 158.59.192.1
    
  1. edit /etc/apt/sources.list removing cdrom source at top and uncommenting universe sources
  2. do the apt-get dance (apt-get update and apt-get upgrade)
  3. install the following using apt-get:
  • ssh
  • zip and unzip
  • apache2
  • mysql-server
  • phpmyadmin

Configuring mysql

  1. Point a web brower at http://158.59.195.113/phpmyadmin/
  2. By default, username root with no password is enabled
  3. Login, click on "Change password", and change the password
  4. Click "Databases", fill-in "Create new database" with moodle and click "Create"
  5. Click "Privileges" then "Add a new User"
  6. Add user moodle with all "Data" and "Structure" privileges checked

Configuring Apache Modules

  • As root, run the following:

ln -s /etc/apache2/mods-available/proxy.conf /etc/apache2/mods-enabled/proxy.conf

  • Repeat with proxy_connect.load and proxy.load

Configuring virtual hosts

  1. Edit /etc/apache2/apache2.conf, adding a NameVirtualHost line, so that the last three lines of the file look like this:
        # Include the virtual host configurations
        NameVirtualHost 158.59.195.113:80
        Include /etc/apache2/sites-enabled/[^.#]* 
  2. Create a file named azi.conf in /etc/apache2/sites-available with the following:
        <VirtualHost 158.59.195.113:80>
        ServerName linus.yhspatriot.net
        ServerAdmin [email protected]
        ProxyRequests off
        <Proxy *>
        Order deny,allow
        Allow from all
        </Proxy>
        ProxyPass / http://158.59.195.113:8080/
        ProxyPassReverse / http://158.59.195.113:8080/
        ProxyPass /misc_ http://158.59.195.113:8080/misc_
        ProxyPassReverse /misc_ http://158.59.195.113:8080/misc_
        ProxyPass /p_ http://158.59.195.113:8080/p_
        ProxyPassReverse /p_ http://158.59.195.113:8080/p_
        </VirtualHost>
    
    
        <VirtualHost 158.59.195.113:80>
        ServerName mysql.yhspatriot.net
        ServerAdmin [email protected]
        ProxyRequests off
        <Proxy *>
        Order deny,allow
        Allow from all
        </Proxy>
    
        DocumentRoot /var/www/phpmyadmin/
    
        Options +FollowSymLinks
    
        <IfModule mod_php4.c>
                php_flag magic_quotes_gpc On
                php_flag magic_quotes_runtime Off
                php_flag file_uploads On
                php_flag short_open_tag On
                php_flag session.auto_start Off
                php_flag session.bug_compat_warn Off
    
                php_value upload_max_filesize 2M
                php_value post_max_size 2M
        </IfModule>
    
        <IfModule mod_dir.c>
                DirectoryIndex index.php
        </IfModule>
        </VirtualHost>
    
    
        <VirtualHost 158.59.195.113:80>
        ServerName moodle.yhspatriot.net
        ServerAdmin [email protected]
        ProxyRequests off
        <Proxy *>
        Order deny,allow
        Allow from all
        </Proxy>
    
        DocumentRoot /var/www/moodle/
    
        Options +FollowSymLinks
    
        <IfModule mod_php4.c>
                php_flag magic_quotes_gpc On
                php_flag magic_quotes_runtime Off
                php_flag file_uploads On
                php_flag short_open_tag On
                php_flag session.auto_start Off
                php_flag session.bug_compat_warn Off
    
                php_value upload_max_filesize 2M
                php_value post_max_size 2M
        </IfModule>
    
        <IfModule mod_dir.c>
                DirectoryIndex index.php
        </IfModule>
        </VirtualHost>
  3. create a sym-link in sites-enabled:

ln -s /etc/apache2/sites-available/azi.conf /etc/apache2/sites-enabled/azi.conf

Installing moodle

My goal was to use packages from the ubuntu and universe repositories whenever possible, but the after several unsuccessful attempts to use the moodle package I found it much easier to install moodle from source, using the following proceedure:

  1. Download the latest moodle source

(wget http://download.moodle.org/stable15/moodle-1.5.2.tgz worked at the time this was written

  1. Untar it in /var/www
  2. Point a web browser at http://158.59.195.113/moodle
  3. Run through all the setup pages:
  • use /var/moodledata for data directory (as root):
  1. mkdir /var/moodledata
  2. chown www-data.www-data /var/moodledata

Installing zope2.7

As root:

  1. apt-get install zope2.7
  2. apt-get install zope-zwiki
  3. mkzope2.7instance
  4. edit /var/lib/zope2.7/instance/linus/etc/zope.conf changing http-server port to 8080

Now log into your zope instance and create a SiteRoot, setting the Base to http://linus.yhspatriot.net and the Path to /.