Advertisement
zeine77

postgresql-apache-ubuntu

Apr 5th, 2013
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sudo apt-get install postgresql
  2.  
  3. sudo apt-get install pgadmin3
  4.  
  5. sudo apt-get install phppgadmin
  6.  
  7. gksudo gedit /etc/postgresql/9.1/main/postgresql.conf
  8.  
  9. listen_addresses = 'localhost'
  10.  
  11. gksuso gedit /etc/postgresql/9.1/main/pg_hba.conf
  12.  
  13. local   all         all                               md5
  14.  
  15. gksudo gedit /etc/apache2/apache2.conf
  16.  
  17. Include /etc/phppgadmin/apache.conf
  18.  
  19. sudo /etc/init.d/apache2 restart
  20. sudo /etc/init.d/postgresql restart
  21.  
  22. <?php
  23.     $dirname = getcwd();
  24.     $dir = opendir($dirname);
  25.     while($file = readdir($dir)) {
  26.         if($file != '.' && $file != '..' && !is_dir($dirname.$file)) {
  27.             echo '- <a href="'.$file.'">'.$file.'</a>'.'<br /><br />';
  28.         }
  29.     }  
  30.     closedir($dir);
  31. ?>
  32.  
  33. sudo -u postgres psql template1
  34. ALTER USER postgres with encrypted password 'password';
  35. \q
  36.  
  37. sudo -u postgres createuser -d -R -P username
  38.  
  39. sudo -u postgres createdb -O username database_name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement