Advertisement
shokti

ubuntu server LAMP installation

Sep 5th, 2012
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. install apache server:
  2. sudo apt-get install apache2
  3. after install go to http://localhost/ to check if it is running.
  4. -------------------------------------------------------------------------------
  5. install php:
  6. sudo apt-get install php5 libapache2-mod-php5
  7. after install create a php file called info.php in the /var/www/ directory:
  8.  
  9. <?php
  10. phpinfo(); ?>
  11.  
  12. and then go to http://localhost/info.php to check if php is running correctly.
  13. -------------------------------------------------------------------------------
  14. install mysql server:
  15. sudo apt-get install mysql-server mysql-client php5-mysql
  16. after install try going to mysql command line:
  17. sudo mysql -u root -p
  18. --------------------------------------------------------------------------------
  19. install phpmyadmin:
  20. sudo apt-get install phpmyadmin
  21. after install go to http://localhost/phpmyadmin
  22.  
  23. ================================================================================
  24. create your website virtualhost in apache:
  25.  
  26. copy default virtualhost file and modify it:
  27. sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/yourdomain.com
  28.  
  29. modify virtualhost using nano and save changes:
  30. sudo nano /etc/apache2/sites-available/yourdomain.com
  31. <VirtualHost *:80>
  32. ServerAdmin webmaster@yourdomain.com
  33. ServerName yourdomain.com
  34. ServerAlias www.yourdomain.com
  35. [...]
  36. DocumentRoot /var/www/yourdomain.com/public_html
  37. </VirtualHost>
  38.  
  39. enable your domain:
  40. sudo a2ensite yourdomain.com
  41.  
  42. restart apache server:
  43. sudo service apache2 restart
  44.  
  45. ================================================================================
  46. configure php for apache:
  47.  
  48. edit php config file php.ini:
  49. sudo nano /etc/php5/apache2/php.ini
  50. set Directory for the file HTTP upload:
  51. upload_tmp_dir = "/tmp/upload"
  52. set Directory for data session save:
  53. session.save_path = "/tmp/session"
  54. set Directory for data session cookie save:
  55. session.cookie_path = "/tmp/cookie"
  56.  
  57. create the directories defined in the config file:
  58. sudo mkdir /tmp/upload
  59. sudo mkdir /tmp/session
  60. sudo mkdir /tmp/cookie
  61.  
  62. set permission for the directories:
  63. sudo chmod 777 /tmp/upload
  64. sudo chmod 777 /tmp/session
  65. sudo chmod 777 /tmp/cookie
  66.  
  67. =================================================================================
  68. NOTES:
  69. to activate php5 if not activated:
  70. a2enmod php5
  71.  
  72. alternate php5 installation to support extensions for other application usage.
  73. like MySQL, Apxs2, gettext, FTP Mbstring, OpenSSL Xml etc:
  74.  
  75. sudo apt-get install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
  76.  
  77. =================================================================================
  78. NOTE:
  79. Could not reliably determine the server’s fully qualified domain name error:
  80. sudo nano /etc/apache2/conf.d/name
  81. add the line:
  82. ServerName localhost
  83. sudo service apache2 restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement