centos,linux,mysql,php,lighttpd手动安装


依赖文件 可以选择性安装 

yum install ntp vim-enhanced gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel ncurses-devel zlib-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel libXpm-devel gettext-devel  pam-devel kernel libxml2-devel  openssl openssl-devel curl-devel pcre-devel




1. mysql

build :

./configure --prefix=/home/work/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=innobase  && make && make install


配置:

cd /home/work/local/mysql

./mysql_install_db --user=mysql --datadir=/home/work/local/mysql/var


编辑 /etc/my.cnf, 输入如下内容:

[client]
#password = your_password
port = 3306
socket = /home/work/local/mysql/mysql.sock

[mysqld]
datadir=/home/work/local/mysql/var
socket=/home/work/local/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
default-character-set=utf8


# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0


[mysqld_safe]
log-error=/home/work/local/mysql/var/log/mysqld.log
pid-file=/home/work/local/mysql/run/mysqld/mysqld.pid


启动:

启动mysql server:

nohup /bin/sh ./bin/mysqld_safe --datadir=/home/work/local/mysql/var --socket=/home/work/local/mysql/mysql.sock --log-error=/home/work/local/mysql/var/log/mysqld.log --pid-file=/home/work/local/mysql/run/mysqld/mysqld.pid --user=mysql &

或者:nohup /bin/sh ./bin/mysqld_safe &


打开 mysql client

./bin/mysql -uroot -p





2. php-fcgi 安装:


build:

./configure --prefix=/home/work/local/php --enable-mbstring --disable-debug --with-zlib --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-gd --with-mysql=/home/work/local/mysql --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-config-file-path=/home/work/local/php/etc --sysconfdir=/home/work/local/php/etc --with-curl  --with-freetype-dir=/usr/include/freetype2 --enable-gd-native-ttf

&& make && make install


3. lighttpd 安装:


build:

./configure --prefix=/home/work/local/lighttpd --with-openssl && make && make install


配置: 编辑 local/lighttpd/etc/lighttpd.conf


server.document-root = "/home/work/sites/default"

server.port = 80
server.username = "work"
server.groupname = "work"

server.modules = (
        "mod_rewrite",
        "mod_access",
        "mod_auth",
        "mod_fastcgi",
        "mod_redirect",
        "mod_simple_vhost",
        "mod_accesslog",
        )

dir-listing.activate = "disable"

static-file.exclude-extensions = (".fcgi", ".php", ".rb", "~", ".inc", ".py")
index-file.names = ("index.html", "index.htm", "index.php", "index.py")

var.log_root = "/home/work/var/lighttpd/log"
server.errorlog = log_root + "/error.log"
accesslog.filename = log_root + "/access.log"

server.network-backend = "linux-sendfile"
server.max-fds = 2048
server.stat-cache-engine = "simple"
server.max-connections = 1024
server.follow-symlink = "enable"
server.upload-dirs = ( "/home/work/var/lighttpd/tmp" )

url.access-deny = ( "~", ".inc" )

var.socket_dir = "/home/work/var/lighttpd"

simple-vhost.server-root = "/home/work/sites"
simple-vhost.default-host = "default"
simple-vhost.document-root = ""

fastcgi.server = (
        ".php" => (
            (
            "socket" => socket_dir + "/php-fastcgi.socket",
            "bin-path" => "/home/work/local/php/bin/php-cgi",
            "max-procs" => 1,
            "broken-scriptfilename" => "enable",
            )
        )
    )


url.rewrite-once = (
        "^/bbs/install(/.*)$" => "/bbs/install/index.php/$1",
        "^/bbs(/.*)$" => "/bbs/index.php/$1",
        "^/cms/(index\.php|images|uploads|css|uploads|js|robots\.txt).*$" => "$0",
        "^/cms(/.*)$" => "/cms/index.php/$1",
        #"^/chy/(index\.php|images|uploads|css|uploads|js|robots\.txt).*$" => "$0",
        #"^/chy(/.*)$" => "/chy/index.php/$1",

        "^/ccms/(index\.php|images|uploads|css|uploads|js|robots\.txt).*$" => "$0",
        "^/ccms(/.*)$" => "/ccms/index.php/$1",

        "^/pma/.*$" => "$0",
        #"^(index\.php|images|uploads|css|uploads|js|robots\.txt).*$" => "$0",
        "^/www/(index\.php|images|uploads|css|uploads|js|robots\.txt).*$" => "$0",
        "^/www(/.*)$" => "/www/index.php/$1",
        "^(/.*)$" => "/www/index.php/$1",
        )

启动lighttpd :

sbin/lighttpd -f etc/lighttpd.conf








  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值