arch linux下安装mysql笔记

1.useradd mysql

2.
[root@zgu etc]# vi /etc/my.cnf

找到datadir
然后
chown mysql data路径 -R

3.
mysql_install_db --user=mysql

4.
[root@zgu etc]# cat rc.local
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#

sudo -u mysql /usr/share/mysql/mysql.server start

5.
pacman -S nginx php mcrypt

下载
phpmyadmin

6.

修改/etc/php.ini
开启
cgi.fix_pathinfo=1

开启
extension=mysql.so
extension=mcrypt.so

_______________________________________________________
然后
sudo chown nginx /var/log/nginx/ -R
[root@zgu conf]# pwd
/etc/nginx/conf
[root@zgu conf]# cp fastcgi_params fastcgi_phpadmin

[root@zgu conf]# cat fastcgi_phpadmin
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;#只要修改这一行
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;

_______________________________________________

[root@zgu conf]# cat nginx.conf
其中一部分
    server {
        listen       9133;
    #    server_name  localhost;
root /home/zuroc/dev/php/phpMyAdmin-3.1.0-beta1-all-languages;
    #    ssl                  on;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_timeout  5m;

    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
    #    ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    #    ssl_prefer_server_ciphers   on;

        location ~ .*$ {
include  /etc/nginx/conf/fastcgi_phpadmin;  #请根据自己保存的路径进行设置
fastcgi_index index.php;
fastcgi_pass  127.0.0.1:5133; #请根据自己的FastCGI绑定的地址和端口进行配置
}
    }



安装lighttpd 为了其中的一个脚本 lighttpd才几百k 炯

sudo -u mysql /etc/rc.d/mysqld start
/etc/rc.d/nginx start
/etc/rc.d/phpcgi start

其中phpcgi是自己写的,不要忘了chmod +x

[root@zgu zuroc]# cat /etc/rc.d/phpcgi
#! /bin/sh
DESC=php-cgi
NAME=php-cgi
PID=/var/tmp/php-cgi.pid
case "$1" in
restart)
     echo -n "Stopping $DESC ... "
     kill `cat $PID`
     echo -n "Starting $DESC ... "
     /usr/bin/spawn-fcgi -a 127.0.0.1 -p 5133 -f php-cgi -C 2 -P $PID
    ;;
start)
     echo -n "Starting $DESC: "
     /usr/bin/spawn-fcgi -a 127.0.0.1 -p 5133 -f php-cgi -C 2 -P $PID
     ;;
stop)
     echo -n "Stopping $DESC: "
     kill `cat $PID`
     rm $PID
     ;;
*)
     N=/etc/init.d/$NAME
     echo "Usage: $N {start|stop}" >&2
     exit 1
     ;;
esac
echo 
exit 0




你可能感兴趣的:(mysql,linux,nginx,PHP,cgi)