Alpine Linux LNMP安装配置

Standard

看到说Docker官方Image将会开始要使用它,所以装个看看呗。
下载地址:www.alpinelinux.org

apk add nginx memcached mysql mysql-client php php-dev php-cli php-pear php-phar php-fpm php-gd php-memcache php-json php-mysql php-pdo php-pdo_mysql php-mysqli php-zip php-zlib php-bz2 php-ctype php-mcrypt bash git;
apk add gcc g++ make autoconf;
 
#first running php -m on the command
#then compare the output to php -n -m
vi /usr/bin/pecl;  # 'exec $PHP -C -q $INCARG ... '
pecl install xdebug
 
vi /etc/php/php.ini;
...
zend_extension=/usr/lib/php/modules/xdebug.so
xdebug.remote_enable=1
xdebug.remote_port=9090
xdebug.remote_connect_back=1
xdebug.auto_trace=1
xdebug.collect_params=1
xdebug.collect_return=1
xdebug.profiler_enable=1
xdebug.var_display_max_data=10000
xdebug.var_display_max_depth=20
...
 
vi /etc/nginx/nginx.conf;
    ...
    location ~ \.php$ {                                                     
        root           html;                                                
        fastcgi_pass   127.0.0.1:9000;                                      
        fastcgi_index  index.php;                                           
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; 
        include        fastcgi_params;                                      
    }    
    ...
 
vi /usr/share/nginx/html/index.php;
<?php
    phpinfo();
?>
 
apk add curl openssl php-openssl;
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer;
 
/etc/init.d/php-fpm start;
/etc/init.d/nginx start;
 
/etc/init.d/mariadb setup;
/etc/init.d/mariadb start;
/etc/init.d/memcached start;
 
apk add phpmyadmin;
cd /usr/share/nginx/html/;
cp -rf /usr/share/webapps/phpmyadmin ./;
cp /etc/phpmyadmin/config.inc.php ./phpmyadmin;
apk del phpmyadmin;
 
cd /usr/share/nginx/html;
wget https://github.com/jokkedk/webgrind/archive/master.zip;
unzip master.zip;
mv webgrind-master webgrind;
apk add python graphviz font-misc-misc;
 
cd /etc/profile.d;
cat color_prompt;
  # Setup a red prompt for root and a green one for users.
  # rename this file to color_prompt.sh to actually enable it
  NORMAL="\[\e[0m\]"
  RED="\[\e[1;31m\]"
  GREEN="\[\e[1;32m\]"
  if [ "$USER" = root ]; then
        PS1="$RED\h [$NORMAL\w$RED]# $NORMAL"
  else
        PS1="$GREEN\h [$NORMAL\w$GREEN]\$ $NORMAL"
  fi
 
mv color_prompt color_prompt.sh;
vi alias.sh;
  alias ll="ls -al"
  alias rm="rm -i"
 
#yemaosheng.com

Leave a Reply

Your email address will not be published.

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