PHP environment (2): lamp (linux + apache + mysql + php) is built. The combination of moodle and onlinejudge is safer, more stable, and open-source than windows, therefore, it is often used as a server system. Therefore, lamp combination is also an indispensable capability. However, it is still a little difficult for kids who are not familiar with linux systems.
I. preparations.
Ubuntu-12.04.1-desktop-i386.iso
II. install ubuntu
Ubuntu is a kind of linux system. because of the increasing popularity of powerful desktop systems, CentOS is also a good choice for servers.
Use a virtual machine to load the ubuntu-12.04.1-desktop-i386.iso image file, and then always install it. After installation, the English interface is used by default. if you are not familiar with the English interface, you can search the internet and change it to a Chinese interface.
After installation, enter the desktop and press the windows key and enter "te" to find the terminal command and drag it to the menu bar.
III. install mysql
Enter the terminal, enter sudo su to enter the permission mode, and then enter apt-get install mysql-server mysql-client to confirm installation.
4. install apache2
Enter apt-get install apache2 to confirm installation.
The default apache web page execution folder in ubuntu is under/var/www/, and the configuration file is in/etc/apache2/apache2.conf, the configuration file subdirectory is under/etc/apache2 /.
Enter Firefox, type http: // localhost, and It works is displayed! Indicates that the installation is successful.
5. install php
Continue entering apt-get install php5 libapache2-mod-php5 to confirm installation
Restart apache and enter/etc/init. d/apache2 restart.
Create a new webpage, vi/var/www/info. php, and add content Save it. you can also run apt-get install gedit and then run gedit/var/www/info. php.
Enter Firefox, type http: // localhost/info. php, and the php properties page appears, indicating that the installation is successful.
6. install phpmyadmin
Phpmyadmin can manage databases on the web page, which is very convenient
Continue to input apt-get install phpmyadmin
Enter cp-rf/usr/share/phpMyAdmin/var/www/
Go to Firefox and type http: // localhost/phpmyadmin. The phpmyadmin page appears, indicating that the installation is successful.
Appendix 1. install moodle
Moodle is a very powerful teaching system, which integrates many plug-ins such as examination and test, which is troublesome to use.
Continue to input apt-cache Search php5
Install PHP library apt-get install php5-mysql php5-curl php5-gd php5-idn php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc
Create the moodledata folder mkdir/var/moodledata
Download moodledata and decompress it to/var/www /.
Change folder permissions chmod 777/var/moodledata
Chmod 777/var/www/moodle
Enter Firefox, type http: // localhost/moodle, and the moodle page appears, indicating that the installation is successful.
Appendix 2 install onlinejudge
The onlinejudge online evaluation system and program design training and competition platform are difficult to build because of development difficulty and portability. Here is an open source OJ-hustoj http://code.google.com/p/hustoj/
Run the following commands in ubuntu to install the SDK:
Sudo apt-get update & sudo apt-get install subversion
Sudo yum update & sudo yum install subversion. i386
Svn checkout http://hustoj.googlecode.com/svn/trunk/install hustoj
Cd hustoj
Edit install. sh and web/include/db_info.inc.php.
Sudo./install. sh
Enter Firefox browser, type http: // localhost/onlinejudge, the onlinejudge page appears to indicate that the installation is successful, use the administrator account root login background testing to check whether the evaluation system can operate, other problems to view http://code.google.com/p/hustoj/wiki/FAQ