Bookmark and Share

EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff

Training Missions

Read Me First New
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom

Knowledge Bank

Discussion Forums
Enigma Chat New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Enigma Zine
Downloads
Tools New

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

The Urinal

Click Here To Vote For EG!

hakipedia

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site.

enigma group

enigma group

enigma group

enigma group

Enigma Group's Articles


Setting Up a LAMP Server on Ubuntu or Debian - Submitted By: t3hmadhatt3r 2009-07-01 23:59:57
Hello. Today I will show you how to install a LAMP server package. LAMP meaning Linux, Apache, MySQL, and PHP. I am assuming you already have some sort of linux (Preferably Ubuntu or Debian but, it is your choice Wink ) and will start with apache, which is pretty simple. Open a shell and type:

sudo apt-get install apache

You will need to enter your password to continue. Now for php, which is also equaly simple. Enter these commands into the shell:

sudo apt-get install php

Again, enter your password to continue. Now for MySQL.

sudo apt-get install mysql

Enter your username and pass (I just used root and root because I'm only using the DB on my localhost) and continue the installation.

Now you should be set to build apps and test on your localhost. To check browse to http://localhost/. If you see "It Works" than apache is working. Now to check php. Open a shell and type:

gksudo nautilus (For Ubuntu)

or

gksudo konqueror (For Debian)

This command opens a root shell. Go to the root of your filesystem (Where you see the etc, var, mnt and other folders) and enter the /var/ directory. Now right click www (This is where your web files are stored) and click the "Permission" tab and change the owner of the directory to your username. Then click make changes. Now you are free to add files to the web root without using the sudo command Wink. Browse to the /var/www/ folder and add a file called info.php. Inside add the code:

<?php
phpinfo();
?>

Open your broswer and go to http://localhost/info.php. If you see your php info php is ready to be used! Now for mysql -- Create a new php file in your web root named mysql.php and inside add this code:

<?php
$mysql_con = mysql_connect('localhost','root','root');
if (!$mysql_con)
     {
     die('Database connection failed: ' . mysql_error());
     }
else
   {
   echo 'Connection successful!';
   }
?>

This code does the following:

Uses mysql_connect() to attempt to connect to the DB at the localhost using root as username and root as password. If an error occurs it echo's Database connection failed: along with the mysql error. If the connection is successful than the script echo's 'Connection successful!'. Now test it out of course!

If all the previous test worked than your ready to start testing and creating web apps on your localhost!

I hope you learned a bit of linux, managing a server, and maybe even some coding from this tutorial.

I will be making more tutorials on managing your web server, coding web apps, making hacking challenges, and code audits Smiley.

Thanks for reading.

Return to Misc category list

 

Who's Online

419 Guests, 89 Users
themastersinner, RedEvolution, GMo, psychomarine, hackaday, 7A69, raj gupta, st3alth, BlankBender, Nasrudin, Nemehinmeli, JohnJohnJohn, R00tMANiAC, aGuesst, i_lost_the_game, sebas, boneminion, avalor, c0zy, kynapse, Ausome1, teehee, rohian, Blizer, HKxprt0101, aVoid, N4g4c3N, Chandu, InjectioN, ruio, slyjakes, WhiteZ, hack_programs, zah2an, maduchi, thec0unt, NotMyOwn, alien007, th3punish3r, upinsmoke, hawx_ps3, klesco, gadjomatto, darkang3l, f4nt0mx, bharaniravikanth, ertow, blink_212, jucsville, aviracer12, raj.kiran.hero, jaiaccet, zinoustyle, trimper, samron7709, bushranger, exploit100, Rik, n.karthik, machorri, Rex_Mundi, neosaleem, vander130, 0x80483fb, dtpvb2010, jasonmax, Posix, Abhinav2107, htechie, basaksudipto92, data, BinaryShinigami, Distorted, k98kurz, invas10n, ishkur88, out0fre4ch, aloksaini, BioHazard, StirfryNinja, Valterri, thiscalling, FlamingLemming, chess_rock, nuxglwk, Psiber_Syn, crazyhacker54, enyo, hawkcannon