The LAMP server (Linux, Apache, MySQL, PHP (or Perl) is one of the most important servers you might ever set up. Install all in single command. Open linux terminal and run the following command:
sudo apt-get update
sudo apt-get install lamp-server^
It’s important to remember the caret (^) at the end of the command.
WARNING!
The use of ^ in the package name suggests that this is a ‘meta-package’. Meaning a number of programs that are usually installed together.
If you try to remove this ‘meta-package’ you could remove a lot of programs you are not expecting to… SSH being one of them!
So please do install your lamp server using these instructions, but do not remove it using lamp-server^
What is LAMP Server?
LAMP Server is a collection of open source software used to create a web server. The collection consists of:
Linux – the operating system
Apache server – the server
MySQL – the database system
PHP – the programming language
After completion of installation:
Check Apache Server -
You can test the installation by visiting http://localhost/ in a browser, you should see a massage saying “It works!“.
For MySQL Server -
This installs:
MySQL Server – to store/serve your database
MySQL Client – a client to access your MySQL server
Be sure to pay attention during the install. You will be asked to create a password for the MySQL root user. You can then access the server in the terminal by typing/copying:
mysql -uroot -ppassword
Obviously replace ‘password‘ with the password you just created (leave the ‘-u‘ and ‘-p‘ before your username and password). You should now be logged in and be displaying ‘mysql>‘ on your command line ready for your SQL queries!
For PHP -
You must restart your Apache server now for the changes to take effect:
sudo service apache2 restart
To test this, open gedit and type/copy:
<?php
phpinfo();
?>
Save the file as info.php into folder /var/www/html. Now navigate to this file in your web browser by visiting http://localhost/info.php
OR
Once PHP installed, you can test your PHP setup by creating a simple info.php page in your web server document root, using this single command.
Then open a web browser, and enter http://localhost/info.php to view the php information page.
You should see a page displaying your PHP version and the rest of your PHP installation information.
Comments
Post a Comment