How to install APACHE, MYSQL, PHP, and phpMyAdmin after installing Debian

Communications | Debian Support

Ok so you have just installed Debian for the first time and now want to do something useful with this new Linux box. How about we set up a web server that has php and mysql support. Then we will install phpMyAdmin to make it easier to manage the databases. If you have no idea how to install Debian, see the post, How to get started with Debian before attempting this part.

Lets log on to the Debian box as root.


apt-get upgrade update
apt-get install apache
apt-get install phpmyadmin
apt-get install mysql-server

Don’t forget to change the root passwords for this stuff. To test it get the ip address of your Debian box using the

ifconfig

Then go to a web browser on another computer hooked up to your network and type in the IP address of your server into the address line of internet explorer.

You should be able to type
http://192.168.0.[x]

you now have a fully functioning web server with php. You can now start editing the code by


cd /var/www
ls

Have fun!

cleaner code

you can also do:
apt-get update && apt-get upgrade

This will update the local apt-get repository and update any packages that are outdated from the install.

Then you can install more then one package at a time with apt-get.
:
apt-get install apache mysql-server phpmyadmin

Also, If you're not going to do any NFS, priting or PPP(dialup) connections, its safe to remove some pacakages. The --purge option tells apt-get to remove all config files as well.
:
apt-get --purge remove lpr pormap ppp

A good thing to remove as well if you're running a static IP on your box is the dhcp-client. I've noticed boxes that are staticly coded with IP's have them reassigned by a local dhcpd
:
apt-get --purge remove dhcp-client