•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 402,910 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,097 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 4642 | Replies: 25
![]() |
•
•
Join Date: Apr 2005
Location: Old Hampshire, Old England (LOL)
Posts: 11,937
Reputation:
Rep Power: 30
Solved Threads: 268
How to install a Debian LAMP Server
The combination of Linux + Apache + MySQL + PHP setup is known as LAMP
We will be using:
Debian Linux - Operating System
Debian is an opensource operating system, which uses the popular Linux kernel. It is a good choice for servers as it is stable and has an easy to use package manager
Apache - Web server
Apache is one of the most famous web servers and with just few simple commands, you can configure apache to play nicely with PHP.
Note: You put your content /var/www.
MySQL 5 - Database Server
The MySQL database is renownd for its excellent performance, high reliability and ease of use.
PHP5 - Scripting Language
PHP is a common scripting language that is especially suited for Web development and can be easialy embedded into HTML pages and works well with other technogies such as the MySQL database and Apache webserver.
phpMyAdmin - Web-based database administration software.
PhpMyAdmin is an excellent web based database administration tool. Managing databases and tables couldnt any simpler.
Note:
First, lets ensure that the system meets the minimum requirements for Debian and that it has at least 256MB of RAM available. If your machine has less than 256MB ram then it can cause lot of problems and MySQL will give you the error "cannot connect to mysql.sock".
Getting Started:
Debian linux is my favourite for servers as it has the command "apt-get".
This command makes it easy for a beginner to install packages as you dont need to worry about package dependencies or manually creating configuration files.
I will assume that you have already installed debian and have it up and running (very easy). I personally love to use the netinstall cd and install just a base system then use apt-get.
If you wish to access the server remotely through SSH from a windows PC then please download a tool called PuTTY
Install:
Ok, now type (in this order, hit enter at the end of the line) and wait for it to complete. Reboot once all the software is installed
apt-get update
apt-get install apache2 php5 libapache2-mod-php5 mysql-server mysql-client php5-mysql phpmyadmin ssh
Security:
By default the mysql root (superuser) account does not have a password. Set one like this:
mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('new-password') WHERE user='root';
mysql> FLUSH PRIVILEGES;
You are now ready to roll!
The combination of Linux + Apache + MySQL + PHP setup is known as LAMP
We will be using:
Debian Linux - Operating System
Debian is an opensource operating system, which uses the popular Linux kernel. It is a good choice for servers as it is stable and has an easy to use package manager
Apache - Web server
Apache is one of the most famous web servers and with just few simple commands, you can configure apache to play nicely with PHP.
Note: You put your content /var/www.
MySQL 5 - Database Server
The MySQL database is renownd for its excellent performance, high reliability and ease of use.
PHP5 - Scripting Language
PHP is a common scripting language that is especially suited for Web development and can be easialy embedded into HTML pages and works well with other technogies such as the MySQL database and Apache webserver.
phpMyAdmin - Web-based database administration software.
PhpMyAdmin is an excellent web based database administration tool. Managing databases and tables couldnt any simpler.
Note:
First, lets ensure that the system meets the minimum requirements for Debian and that it has at least 256MB of RAM available. If your machine has less than 256MB ram then it can cause lot of problems and MySQL will give you the error "cannot connect to mysql.sock".
Getting Started:
Debian linux is my favourite for servers as it has the command "apt-get".
This command makes it easy for a beginner to install packages as you dont need to worry about package dependencies or manually creating configuration files.
I will assume that you have already installed debian and have it up and running (very easy). I personally love to use the netinstall cd and install just a base system then use apt-get.
If you wish to access the server remotely through SSH from a windows PC then please download a tool called PuTTY
Install:
Ok, now type (in this order, hit enter at the end of the line) and wait for it to complete. Reboot once all the software is installed
apt-get update
apt-get install apache2 php5 libapache2-mod-php5 mysql-server mysql-client php5-mysql phpmyadmin ssh
Security:
By default the mysql root (superuser) account does not have a password. Set one like this:
mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('new-password') WHERE user='root';
mysql> FLUSH PRIVILEGES;
You are now ready to roll!
TRY MY SUGGESTIONS AT YOUR OWN RISK!
james.bennet1@ntlworld.com
james.bennet1@ntlworld.com
•
•
Join Date: Apr 2005
Location: Old Hampshire, Old England (LOL)
Posts: 11,937
Reputation:
Rep Power: 30
Solved Threads: 268
Danceinstructor, you said that
i dont know, i submitted it to davey for the PHP tutorials section but he said it wasnt in-depth enough. Fair enough, i dont have a problem with that, i may try to submit it again soon (with additional sections for a: doing a debian netinstall b: checking php/mysql are working and c: securing ssh and maybe adding FTP/samba
•
•
•
•
This is good stuff, but shouldn't it be under Web Hosting Tutorials?
i dont know, i submitted it to davey for the PHP tutorials section but he said it wasnt in-depth enough. Fair enough, i dont have a problem with that, i may try to submit it again soon (with additional sections for a: doing a debian netinstall b: checking php/mysql are working and c: securing ssh and maybe adding FTP/samba
TRY MY SUGGESTIONS AT YOUR OWN RISK!
james.bennet1@ntlworld.com
james.bennet1@ntlworld.com
I think its great. It's to the point and succinct. It makes it look easy (which it is for the most part). If somebody has a problem, then its a good reason for them to post and everyone can benefit from that discussion (and possibly use that info to improve/udate the tutorial).
Although in my opinion this is a "server administratration" tutorial and doesn't really apply to scripters/programmers.
Although in my opinion this is a "server administratration" tutorial and doesn't really apply to scripters/programmers.
•
•
Join Date: Apr 2005
Location: Old Hampshire, Old England (LOL)
Posts: 11,937
Reputation:
Rep Power: 30
Solved Threads: 268
Oh ok, i just put it there as that was what i used it for (instead of using sopmething like XAMPP i did that that and ran it u nder virtual pc so that i could develop from my windows pc)
i have nearly finished a new version which adds parts on:
installing debian
securing ssh
file transfer to server
bssic sql commands
phpinfo to test if it works
i have nearly finished a new version which adds parts on:
installing debian
securing ssh
file transfer to server
bssic sql commands
phpinfo to test if it works
Last edited by jbennet : May 15th, 2007 at 2:17 am.
TRY MY SUGGESTIONS AT YOUR OWN RISK!
james.bennet1@ntlworld.com
james.bennet1@ntlworld.com
•
•
Join Date: Aug 2005
Location: somewhere in time
Posts: 71
Reputation:
Rep Power: 4
Solved Threads: 3
It appears that there is little more to a Debian install than this. I just installed it as a Web server from the downloads on the Debian site.
It appears to work fine as a stand-alone PC, but is not functioning as a server on my network. I cannot even ping it. I've read that all the ports are closed by default with a Debian install, but have not found info regarding what I need to do to complete the Web server setup.
What do I need to know to do this? I'm looking forward to your other tutorials.
Thus far I think Red Hat was much easier to work with.
It appears to work fine as a stand-alone PC, but is not functioning as a server on my network. I cannot even ping it. I've read that all the ports are closed by default with a Debian install, but have not found info regarding what I need to do to complete the Web server setup.
What do I need to know to do this? I'm looking forward to your other tutorials.
Thus far I think Red Hat was much easier to work with.
•
•
Join Date: Apr 2005
Location: Old Hampshire, Old England (LOL)
Posts: 11,937
Reputation:
Rep Power: 30
Solved Threads: 268
when you installed did you choose the Standdard System option. If not then you dont get the DHCP client.
Also make sure to guve it a proper hostname . NOT LOCALHOST!
go into a command prompt and type . Thats I-F. Post the details here. Also at the command prompt it should say sometuing like
root@(name): $
tell us what the name is
Also make sure to guve it a proper hostname . NOT LOCALHOST!
go into a command prompt and type
ifconfig
root@(name): $
tell us what the name is
Last edited by jbennet : Jun 7th, 2007 at 5:08 pm.
TRY MY SUGGESTIONS AT YOUR OWN RISK!
james.bennet1@ntlworld.com
james.bennet1@ntlworld.com
•
•
Join Date: Apr 2005
Location: Old Hampshire, Old England (LOL)
Posts: 11,937
Reputation:
Rep Power: 30
Solved Threads: 268
if you want a GUI just do
apt-get install xorg gnome gdm
reboot then type startx if it doesnt come up automatically.
apt-get install xorg gnome gdm
reboot then type startx if it doesnt come up automatically.
TRY MY SUGGESTIONS AT YOUR OWN RISK!
james.bennet1@ntlworld.com
james.bennet1@ntlworld.com
•
•
Join Date: Apr 2005
Location: Old Hampshire, Old England (LOL)
Posts: 11,937
Reputation:
Rep Power: 30
Solved Threads: 268
just drop your content in /var/www by the way.
index.php
go to http://(hostname)/phpmyadmin to configure the database
index.php
<?php
phpinfo();
?>
go to http://(hostname)/phpmyadmin to configure the database
Last edited by jbennet : Apr 17th, 2008 at 7:56 am.
TRY MY SUGGESTIONS AT YOUR OWN RISK!
james.bennet1@ntlworld.com
james.bennet1@ntlworld.com
•
•
Join Date: Apr 2007
Location: Manchester, U.K
Posts: 383
Reputation:
Rep Power: 2
Solved Threads: 5
When I try to set the password everything seemed to go OK so I restarted my pc and then tried myphp admin without a pass and it would still let you login
Any Ideas?
Also where is the dir where I can drop all my file's etc in to be hosted on apache?
Cheers
Bondi007
Any Ideas?
Also where is the dir where I can drop all my file's etc in to be hosted on apache?
Cheers
Bondi007
I will try and help you even if everyone has given up!
I will not stop! IM BONDI
I will not stop! IM BONDI
•
•
Join Date: Apr 2005
Location: Old Hampshire, Old England (LOL)
Posts: 11,937
Reputation:
Rep Power: 30
Solved Threads: 268
did you set the mysql password with
drop your files into the webroot (ususally somewhere under /var/www)
see post 8
•
•
•
•
mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('new-password') WHERE user='root';
mysql> FLUSH PRIVILEGES;
drop your files into the webroot (ususally somewhere under /var/www)
see post 8
TRY MY SUGGESTIONS AT YOUR OWN RISK!
james.bennet1@ntlworld.com
james.bennet1@ntlworld.com
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
ad advertising architecture backup beta blog business cd centro competition crash daniweb database debian dell development doubleclick enterprise fix gentoo google install internet kernel linux longhorn mail microsoft mmorpg news novell open php qmail red hat rhel security server smtp software source spam suse ubuntu web windows windows server
- Certification Poll (Geeks' Lounge)
- Complete Debian Linux Server Setup Tutorial (*nix Software)
- Complete Debian Linux Server Setup Tutorials (*nix Hardware Configuration)
- Is it necessary to install Internet Information Server while developing web applicat (ASP)
Other Threads in the PHP Forum
- Previous Thread: Short URL Script Error
- Next Thread: conditional navigation



Linear Mode