Install web server with Apache2 - PHP5 - MySQL - PHPMyAdmin

bombraid
  12 years ago
  12

Apache is the most popular HTTP server, here's how to install with PHP5, MySQL and PHPMyAdmin.
 

Installation

1- Open a terminal 

2- Copy and paste this line :

sudo apt-get install apache2 mysql-server php5 php5-mysql php5-cli php5-imagick php5-gd php5-mcrypt php5-curl phpmyadmin

 

Configuration

Go to the /etc/apache2/ and watch the component files:

apache2.conf  conf.d  envvars  httpd.conf  mods-available  mods-enabled  ports.conf  sites-available  sites-enabled

Most of these files are more or less specific to Debian / Ubuntu and allow us to separate the configuration into multiple parts.

  • httpd.conf is the file used by apache1, it is kept empty in Apache2 to ensure backward compatibility. It will not serve us.
  • envvars is used to set environment variables specific to Apache.
  • ports.conf contains the listen directive that specifies the addresses and ports to listen.
  • apache2.conf is the main configuration file is from him that all other files are loaded.
  • conf.d is a directory that contains several smaller files that will be analyzed by apache.The only file is currently charset, which specifies the encoding used by default.
  • mods-available lists apache modules installed.
  • mods-enabled modules that use.
  • sites-available lists vhosts installed.
  • sites-enabled vhosts used.
Comments
jamied_uk 3 years ago

To clarify
when adding modules... adding LoadModule headers_module modules/mod_headers.so
to my apache2.conf file is how? as i have no httpd.conf file??? or is there a command i can use to auto do this? i need to secure my webserver as developers are morons and dont nativly protect against todays vulnarabilities properly and expect us all to be experts, for example i need that above module along with a lot of other things to prevent xxs for example!? help someone!!


prithvi 12 years ago

Thank you... :)


Wizard2475 12 years ago

This was great. Easy to follow as it did everything for you. Being new to Linux, I need a little more info. I know what watch means (grey area), but not sure how to use it as you referenced above. I guess I'll figure it out. Even though I'm hanging on this last part, this tutorial has saved me a lot of time.
Thank You Very Much