Posts Tagged ‘Apache’
Hello boys and girls! to day we are going to talk about LAMP, and no I do not mean the light with a shade. In the Linux world LAMP is an acronym for Linux, Apache, MySQL and PHP(sometimes Perl/Python). This is a popular HTTP server configuration where my own blog is kept. This configuration is particularly useful for many of the open source content management systems and blogging systems out there, such as Joomla, Drupal, WordPress, b2evolution. But you already knew that didn’t you? otherwise you wouldn’t bee looking for instruction on how to configure LAMP for Debian (but in case you didn’t know, there it is).
You may wish to configure LAMP because you want to do some PHP and MySQL development, or test out a new CMS you found out about, or you self host your own top level domain website. First make sure you system is updated and upgraded with apt-get. First let us install the Apache server.
sudo apt-get install apache2 apache2-doc
Now to see if it worked, open your browser and in the address bar type http://localhost/ and if all went well you should see a simple text “It works!” Now it is time to install PHP (which is a server side programing language.)
sudo apt-get install php5 php5-mysql libapache2-mod-php5
Create the file /var/www/test.php and insert:
Don’t forget to start and stop Apache
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start
Once, completed lead http://localhost/test.php in your browser and you should see a list of information about your server. MySQL is a common open source database server which works in conjunction with PHP on many blog systems and content management systems. to install type in terminal:
sudo apt-get install mysql-server mysql-client
The install script will ask you to imput a root user password after doing so you will have a MySQL server running on your system. I am not a MySQL pro, and generally only create blank MySQL databases to be filled by the install scripts of my chosen CMS. I do not know much about the command line client for MySQL and install some MySQL GUI’s.
sudo apt-get install mysql-admin mysql-navigator
I find MySQL Administrator in my menus and fire it up, imputing local host for the server and use root user and password I specified during installation of MySQL. Once connected I select User Administration and right click int the lower left hand corner to select New User. I name the new user php and give it a password then in the Schema Privileges I assign all privliges. (This might not be wise, as I said I am not a MySQL pro, and haven’t taken the time to further investigate this). After clicking apply changes, I close down MySQL Administrator. If you need web access to manage your MySQL install PHPmyAdmin.
sudo apt-get install phpmyadmin
During installation you will be asked to select what server you are running, choose apache2. now test it out by navigating your browser to http://localhost/phpmyadmin and if everything went correctly you should be looking at a login page. I like to create a symlink in my home directory to /var/www and change the user and group of the directory to allow for that users access.
ln -s /var/www/ ~/public_html
sudo chown -Rv myuser:sudo /var/www
Congratulations, you know have a working LAMP configuration on Debian. Now you can start developing your own LAMP powered website, or install one of the many PHP and MySQL driven blogging systems and content management systems.




