Advertisement
shokti

centos 6.5 - install LAMP server

Apr 29th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. install apache web server:
  2. yum install httpd
  3.  
  4. start at boot:
  5. chkconfig httpd on
  6.  
  7. start web server:
  8. service httpd start
  9.  
  10. allow webserver in the firewall:
  11.  
  12. nano /etc/sysconfig/iptables
  13. --------------------------------------------------------
  14. -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
  15. --------------------------------------------------------
  16.  
  17. restart firewall:
  18. service iptables restart
  19.  
  20. install mysql server:
  21. yum install mysql mysql-server
  22.  
  23. start at boot:
  24. chkconfig mysqld on
  25.  
  26. start mysql server:
  27. service mysqld start
  28.  
  29. configure some directory structures and create some management system tables:
  30. mysql_install_db
  31.  
  32. harden installation by changing defaults:
  33. mysql_secure_installation
  34.  
  35. to login mysql:
  36. mysql -u root -p
  37.  
  38. install php:
  39. yum install php php-mysql
  40.  
  41. nano /var/www/html/testphp.php
  42. --------------------------------------------------------
  43. <?php
  44. phpinfo();
  45. ?>
  46. --------------------------------------------------------
  47.  
  48. add EPEL repository:
  49. wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
  50. rpm -ivh epel-release*
  51. yum repolist
  52.  
  53. install phpmyadmin:
  54. yum install phpMyAdmin
  55.  
  56. edit config files:
  57. nano /etc/httpd/conf.d/phpMyAdmin.conf
  58. --------------------------------------------------------
  59. Alias /phpMyAdmin /usr/share/phpMyAdmin
  60. Alias /phpmyadmin /usr/share/phpMyAdmin
  61.  
  62. #<Directory /usr/share/phpMyAdmin/>
  63. # <IfModule mod_authz_core.c>
  64. # # Apache 2.4
  65. # Require local
  66. # </IfModule>
  67. # <IfModule !mod_authz_core.c>
  68. # # Apache 2.2
  69. # Order Deny,Allow
  70. # Deny from All
  71. # Allow from 127.0.0.1
  72. # Allow from ::1
  73. # </IfModule>
  74. #</Directory>
  75. --------------------------------------------------------
  76.  
  77. cp /usr/share/phpMyAdmin/config.sample.inc.php /usr/share/phpMyAdmin/config.inc.php
  78.  
  79. nano /usr/share/phpMyAdmin/config.inc.php
  80. --------------------------------------------------------
  81. /* Authentication type */
  82. $cfg['Servers'][$i]['auth_type'] = 'http';
  83. --------------------------------------------------------
  84.  
  85. service httpd restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement