Skip to content

lamp mysql

khensolomon edited this page May 9, 2018 · 2 revisions

MySQL

phpMyAdmin

$ sudo apt-get update
$ sudo apt-get install phpmyadmin
$ sudo apt-get install phpmyadmin php-mbstring php-gettext

$ sudo phpenmod mcrypt
$ sudo phpenmod mbstring

$ sudo systemctl restart apache2

export PATH=$PATH:/usr/local/mysql/bin

docs

/usr/share/doc/phpmyadmin

/usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
  Options FollowSymLinks
  DirectoryIndex index.php
  AllowOverride All
</Directory>

<VirtualHost *:80>
  ServerName sql.local
  DocumentRoot /usr/share/phpmyadmin
  <Directory /usr/share/phpmyadmin>
    Require all granted
  </Directory>
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

On subdamin

# disable phpmyadmin
$ sudo a2disconf phpmyadmin

/etc/apache2/conf-available/phpmyadmin.conf

ServerName sql.local

/etc/apache2/sites-available/phpmyadmin.conf

<VirtualHost *:80>
  ServerAdmin admin@example.com
  ServerName mysql.sitename.com

  DocumentRoot /usr/share/phpmyadmin

  <Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php

    <IfModule mod_php5.c>
      <IfModule mod_mime.c>
          AddType application/x-httpd-php .php
      </IfModule>
      <FilesMatch ".+\.php$">
          SetHandler application/x-httpd-php
      </FilesMatch>

      php_flag magic_quotes_gpc Off
      php_flag track_vars On
      php_flag register_globals Off
      php_admin_flag allow_url_fopen Off
      php_value include_path .
      php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
      php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/
    </IfModule>
  </Directory>

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Clone this wiki locally