back

Setting up C Programming in Linux for Ubuntu Linux 10.04 LTS

  • Download and Install Ubuntu 10.04 LTS
  • Install basic LAMP (Apache,MySQL,PHP) Web server and Tomcat server
    • install tasksel sudo apt-get install tasksel
    • in a terminal type type sudo tasksel to start the server installation utility
    • use space bar to select LAMP server
    • tab to Ok and hit return
    • when asked for mysql passwords do not enter anything, leave blank
    • open System/Administration/Synaptic Package Manager
  • Select and install:
    • build-essential
    • gcc
    • libgd2-xpm
    • libgd2-xpm-dev
    • php5
    • php5-gd
    • php5-mysql
    • apache2-prefork-dev
    • libmysqlclient15-dev
  • To configure Apache
    • make sure you have a public_html folder in your home area, if not, create one
    • create a cgi-bin folder inside this
    • in a terminal type sudo a2enmod php5 then sudo a2enmod userdir
    • edit apache config file: sudo gedit /etc/apache2/sites-enabled/000-default
    • change the ScriptAlias /cgi-bin/ entry to /home/your-user-name/public_html/cgi-bin/
    • change Directory to "/home/your-user-name/public_html/cgi-bin" my version loks like this:
      	ScriptAlias /cgi-bin/ /home/david/public_html/cgi-bin/
      	<Directory "/home/david/public_html/cgi-bin">
      		AllowOverride None
      		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
      		Order allow,deny
      		Allow from all
      	</Directory>
      
    • edit apache config file: sudo gedit /etc/apache2/mods-available/php5.conf
    • comment out the user directory section according to the instructions
    • type sudo /etc/init.d/apache2 restart to restart the server
    • in a browser check that http://localhost is working
    • http://localhost/~yourubuntuusername is your home directory for web content
  • To configure MySQL
    • MySQL root user has NOTHING to do with the the system root user you become when you use "sudo.."
    • if you have no MySQL root password set, in a terminal type "mysql -u root mysql" to enter the MySQL system prompt
    • with a password set, type "mysql -u root-p mysql" and enter the password.
    • now you can configure the mysql configuration database itself
    • type: create database test;and hit return
    • type: grant all privileges on test.* to ' '@'localhost'; and hit return
    • type: flush privileges; and hit return
    • type: quit; and hit return
    • note that mysql commands end with a semi-colon ;