To Teach You Create a LAMP (Linux/Apache/MySql/PHP) Server With Ubuntu Step by Step in 2 Hours

Tools you need to prepare

  1. A computer with at least 1GHz CPU, 4GB RAM and 60G hard disk (considering the running speed of your website which will be hosted in the server, a high performance computer is recommended)
  2. An USB flash disk with at least 2GB (all data on this flash disk will be erased).
  3. Connect the computer to the Internet with LAN

OK, let’s start

  1. Download Ubuntu 14.04 LTS desktop version (64bit) from http://www.ubuntu.com/download/desktop, it’s an ISO format file and the file size is about 1GB.
  2. Download UltraISO from https://www.ezbsystems.com/ultraiso/
  3. Install UltraISo, and then run it
  4. In UltraISO, locate the local file to the download directory of Ubuntu, then double click the Ubuntu ISO file.
  5. Plug your USB flash disk to your computer
  6.  Choose Bootable -> Write Disk Image from the main menu, check if the destination disk is correct, set “Write Method” to “USB-HDD+”., then click Write.
  7. After finish, pull off the USB flash disk, and plug it to the computer to which you want to create the server.
  8. Turn on the server, press F12 (or F9, F10, different mainboards vary, pay attention to the message at boot time) to choose boot device.
  9. Select start menu to boot from “USB-HDD+”, then start to install Ubuntu by following the on-screen steps, you need to input admin password during the installation, remember it.
  10. After installation, enter the admin password to login Ubuntu, and then you can see the desktop, press Ctrl + Alt + T, call out the terminal.
  11. Input “sudo apt-get update”, then press Enter, it will ask you the admin password, just input it, similarly hereinafter.
  12. Input “sudo apt-get install openssh-server”, then press Enter.
  13. Input “sudo service ssh start”, then press Enter.
  14. Input “sudo gedit /etc/ssh/sshd_config”, in the editor window, add a “#” in the begin of this line “PermitRootLogin without-password” to rem it, and then add a line “PermitRootLogin yes” in the bottom, then press Ctrl + S to save the file, and press Alt + F4 to exit editor.
  15. Ok, now the SSH service is installed successfully, you are able to use a SSH client to control the server in another computer, both Windows and Linux system.
  16. Then let’s install Apache now, input “sudo apt-get install apache2” in the terminal then press Enter.
  17. Open the firefox browser, type “locahost” in the address bar then press Enter, you should see the Apache default page.
  18. Then back to the termianl to continute to install PHP5, input “sudo apt-get install php5”, then press Enter.
  19. Input “sudo apt-get install mysql-server” and press Enter to install MySQL.
  20. Input “sudo apt-get install phpmyadmin” and press Enter to install PhpMyAdmin, during the installation it will ask you the destionation webservice and root password, select “apache2” and give it a root password, considering security, you should not use the password same with the system admin password.
  21. Input “sudo chmod 777 /var/www” and press Enter to modify the permission of the web root directory.
  22. Input “sudo ln -s /usr/share/phpmyadmin /var/www/html/” and create a shortcut url of the PhpMyAdmin.
  23. Type “locahost/phpmyadmin” in firefox’s address bar then press Enter, you should see the interface of PhpMyAdmin.
  24. OK, all parts of LAMP system are ok, but we still need a ftp service to modify our files, so come back to the terminal, input “sudo apt-get update” then press Enter to update the software packages.
  25. Input “sudo apt-get install vsftpd” then press Enter to install vsftpd service.
  26. Input “sudo service vsftpd start” then press Enter to start the ftp service.
  27. Now we should create a ftp user, input “sudo useradd -d /var/www/html -s /bin/bash ftpuser”. Notice the “ftpuser” here is the account name of the ftp user, you can change it to your own.
  28. Input “sudo passwd ftpuser” then press Enter, then input a new password twice to create a password for ftp account.
  29. Input “sudo gedit /etc/vsftpd.conf” then press Enter, then in the editor, delete the “#” in the begin of the line “local_enable=YES”, and add 4 lines in the bottom:
    userlist_deny=NO
    userlist_enable=YES
    userlist_file=/etc/allowed_users
    seccomp_sandbox=NO
  30. Then press Ctrl + S to save, and press Alt + F4 to close editor.
  31. Input “sudo gedit /etc/allowed_users” then press Enter, make sure that “ftpuser” is in it, if not, add it.
  32. Input “sudo gedit /etc/ftpusers” then press Enter, make sure that “ftpuser” is NOT in it (account here CANNOT login ftp).
  33. Input “sudo service vsftpd restart” then press Enter to restart the ftp service.
  34. Ok, all over now, you can use a ftp client to connect to the service with the account and password you created.

Notice: All articles are original by ComputerBlog.com.au, please make sure the original URL will be kept in reproduction.

Post Footer automatically generated by wp-posturl plugin for wordpress.

(13)

Share This:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.