FreeBSD Installing: Skillnad mellan sidversioner
m (clean up, typos fixed: avaliables → availables, exemple → example, softwares → software, statments → statements, automaticly → automatically) |
|||
(2 mellanliggande sidversioner av en annan användare visas inte) | |||
Rad 1: | Rad 1: | ||
= Using Ports = | = Using Ports = | ||
Ports are FreeBSB software package system, you can use to install, uninstall, update your | Ports are FreeBSB software package system, you can use to install, uninstall, update your software packages. | ||
If you didn't install it along the basic system, you can do it now: | If you didn't install it along the basic system, you can do it now: | ||
Rad 15: | Rad 15: | ||
Using Ports, the package system itself will verify dependencies, download (if necessary), compile and install them all. | Using Ports, the package system itself will verify dependencies, download (if necessary), compile and install them all. | ||
You can use binary packages | You can use binary packages availables at install media (like CD, USB or FTP) as well. | ||
= Quick install = | = Quick install = | ||
Rad 21: | Rad 21: | ||
You could install Moodle using Ports: | You could install Moodle using Ports: | ||
<code>cd /usr/ports/www/ | <code>cd /usr/ports/www/moodle25/</code> | ||
<code>make install clean</code> | <code>make install clean</code> | ||
Rad 127: | Rad 127: | ||
Using GIT, you can download, update, upgrade moodle to Apache www public diretory | Using GIT, you can download, update, upgrade moodle to Apache www public diretory | ||
<code>cd /usr/local/www/ | <code>cd /usr/local/www/apache24/data/</code> | ||
<code>git clone -b | <code>git clone -b MOODLE_25_STABLE git://git.moodle.org/moodle.git</code> | ||
Set Apache user as owner of all Moodle directory and files: | Set Apache user as owner of all Moodle directory and files: | ||
Rad 151: | Rad 151: | ||
<code>mysql -u root -p</code> | <code>mysql -u root -p</code> | ||
Then execute following SQL | Then execute following SQL statements, replacing "yourpassword" for some password you want: | ||
<code>mysql> CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;</code> | <code>mysql> CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;</code> | ||
Rad 167: | Rad 167: | ||
Execute Moodle CLI Installer: | Execute Moodle CLI Installer: | ||
<code>cd /usr/local/www/ | <code>cd /usr/local/www/apache24/data/moodle</code> | ||
<code>su www -c '/usr/bin/php-cli admin/cli/install.php'</code> | <code>su www -c '/usr/bin/php-cli admin/cli/install.php'</code> | ||
Rad 177: | Rad 177: | ||
=== Web Installer === | === Web Installer === | ||
Open your web browser to the host name or IP address plus "/moodle", like | Open your web browser to the host name or IP address plus "/moodle", like example.com/moodle or 127.0.0.1/moodle. Then, follow the instructions. | ||
== Post-installation == | == Post-installation == | ||
Rad 183: | Rad 183: | ||
=== Configure a cronjob === | === Configure a cronjob === | ||
Use server crontab to | Use server crontab to automatically execute Moodle Cron each 5 minutes: | ||
<code>crontab -u www -e</code> | <code>crontab -u www -e</code> | ||
Rad 189: | Rad 189: | ||
<code> | <code> | ||
<nowiki>*</nowiki>/5 * * * * cd /usr/local/www/ | <nowiki>*</nowiki>/5 * * * * cd /usr/local/www/apache24/data/moodle ; /usr/bin/php-cli admin/cli/cron.php > /dev/null | ||
</code> | </code> | ||
Rad 202: | Rad 202: | ||
== See also == | == See also == | ||
# [[Installation]] | # [[Installation]] | ||
# [[ | # [[Installation FAQ]] | ||
# [[ | # [[Unix or Linux Installation]] | ||
Nuvarande version från 4 februari 2021 kl. 16.08
Using Ports
Ports are FreeBSB software package system, you can use to install, uninstall, update your software packages.
If you didn't install it along the basic system, you can do it now:
portsnap fetch
:portsnap extract
If you already have it installed, just update:
portsnap fetch update
Using Ports, the package system itself will verify dependencies, download (if necessary), compile and install them all.
You can use binary packages availables at install media (like CD, USB or FTP) as well.
Quick install
You could install Moodle using Ports:
cd /usr/ports/www/moodle25/
make install clean
Step by step install
Install Apache
Apache will be your http server.
cd /usr/ports/www/apache22
make install clean
Now, configure Apache to start at boot:
echo 'apache24_enable="YES"' >> /etc/rc.conf
/usr/local/etc/rc.d/apache24 start
Point your web browser to the host name or IP address and you should see the venerable “It Works”.
Install MySQL
MySQL will be your SQL database server.
cd /usr/ports/databases/mysql56-server/
make install clean
Now, configure MySQL to start at boot:
echo 'mysql_enable="YES"' >> /etc/rc.conf
/usr/local/etc/rc.d/mysql-server start
For increase security, set a password for the MySQL root user:
/usr/local/bin/mysqladmin -u root password 'your-password'
Install PHP
PHP is the scripting language in which Moodle is developed
cd /usr/ports/lang/php5
Before we proceed, we need to add a configuration option so that PHP build includes support for the Apache server:
make config
Select “Build Apache module”:
make install clean
Copy the recommended configuration file for production server:
cp /usr/local/etc/php.ini-development /usr/local/etc/php.ini
Create a mod_php configuration file at "/usr/local/etc/apache24/Includes/mod_php.conf":
<IfModule mod_php5.c>
DirectoryIndex index.php index.html
</IfModule>
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>
Moodle require somes additional PHP extensions.
cd /usr/ports/lang/php5-extensions/
Check (if not checked already) this extensions at menu and install: CTYPE, CURL, DOM, GD, HASH, ICONV, JSON, MBSTRING, MYSQL, MYSQLI, OPENSSL, SOAP, SIMPLEXML, TOKENIZER, XMLRPC, XSL, ZIP, ZLIB:
make config
Then install this extensions:
make install clean
Install GIT
GIT is a tool to download, update and contribe code to Moodle.
cd /usr/ports/devel/git
make install clean
Preparing Moodle
Read Installing documentation before follow this steps.
Download Moodle
Using GIT, you can download, update, upgrade moodle to Apache www public diretory
cd /usr/local/www/apache24/data/
git clone -b MOODLE_25_STABLE git://git.moodle.org/moodle.git
Set Apache user as owner of all Moodle directory and files:
chown -R www:www moodle
Create Moodledata
mkdir /usr/local/www/apache24/moodledata
Give Apache user total privilegies to this directory
chown -R /usr/local/www/apache24/moodledata
chmod -R 777 /usr/local/www/apache24/moodledata
Create Moodledb
Access MySQL console
mysql -u root -p
Then execute following SQL statements, replacing "yourpassword" for some password you want:
mysql> CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
mysql> GRANT ALL ON moodle.* TO moodle@localhost IDENTIFIED BY 'yourpassword';
Installing Moodle
You can choose two methods, using command line interface (CLI) or web installer.
CLI
Execute Moodle CLI Installer:
cd /usr/local/www/apache24/data/moodle
su www -c '/usr/bin/php-cli admin/cli/install.php'
Follow the instructions and if you need more information:
su www -c '/usr/bin/php-cli admin/cli/install.php --help'
Web Installer
Open your web browser to the host name or IP address plus "/moodle", like example.com/moodle or 127.0.0.1/moodle. Then, follow the instructions.
Post-installation
Configure a cronjob
Use server crontab to automatically execute Moodle Cron each 5 minutes:
crontab -u www -e
*/5 * * * * cd /usr/local/www/apache24/data/moodle ; /usr/bin/php-cli admin/cli/cron.php > /dev/null
Check Moodle configurations
- Settings > Site administration > Reports > Security overview: Overview details of your environment security
- Settings > Site administration > Courses > Backups > Automated backup setup: Setup Moodle to automatic backup your courses
- Settings > Site administration > Server > HTTP: If you need to set up proxy credentials
- Settings > Site administration > Plugins > Message Outputs > Email: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page.
See also
References
- http://www.freebsd.org/doc/handbook/ports.html
- http://www.freebsd.org/doc/handbook/packages-using.html
- http://www.freebsd.org/doc/en/books/handbook/network-apache.html
- http://dev.mysql.com/doc/refman/5.6/en/freebsd-installation.html
- https://docs.moodle.org/400/sv/PHP
- http://git.moodle.org/
- https://docs.moodle.org/400/sv/Installing_Moodle
- https://docs.moodle.org/400/sv/Git_for_Administrators
- https://docs.moodle.org/400/sv/Cron