亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

freebsd9.1源碼安裝apache、mysql、php環(huán)境(親側通過)

新浪博客   發(fā)布時間:2014-07-20 22:03:15   作者:奔跑的蝸牛   我要評論
freebsd9.1源碼安裝apache、mysql、php環(huán)境,奔跑的蝸牛親側通過精心原創(chuàng),需要的朋友可以參考下

新手不建議用源碼安裝,請慎重

1.安裝9.1系統(tǒng)

2.通過Sysinstall安裝預裝軟件

=========================================================

3.安裝Linux_libio兼容包

rc.conf 增加一句linux_enable=true 應該是 linux_enable="YES"

========================================================

4.通過ports安裝SSH守護進程(ports/security/sshgard)

5.通過Ports安裝加密相關的軟件(ports/security/mcrypt)

6.安裝MYSQL

7.安裝apr(/configure   ,make install clean)

8.安裝apr-util1.5.1(/configure --with-apr=/usr/local/apr)

9.安裝Apache

10. 安裝PHP

11.安裝FastCGI

12.安裝Xcache

13.安裝Memcache

15.安裝Proftpd

 

Freebsd支持中文.txt

設置全局的 locale 參考下面方法:

vi /etc/login.conf

最后增加這個:

chinese:Chinese Users Accounts:\

:charset=UTF-8:\

:lang=zh_CN.UTF-8:\

:tc=default:

然后修改你的passwd文件,使用vipw命令

user:password:1111:11:language:0:0:User Name:/home/user:/bin/sh

language位置寫入chinese,關聯(lián)上你的locale。

export LC_CTYPE="zh_CN.UTF-8"

export LC_ALL="zh_CN.UTF-8"

export LANG="zh_CN.UTF-8"

需要更新一下數據庫,使用 cap_mkdb /etc/login.conf

登出再登錄,使用命令 locale 就可以看到你的 locale 已經修改完成了

php需要環(huán)境.txt

1.curl,gd,mbstring,jpeg,png,php_memcache,xcache,mysql,apache

安裝時都需要指定安裝目錄

Robin_預裝包.txt

通過Sysinstall安裝(光盤)

1.archives:libzip;zip;unzip

2.databases: sqlite

3.converters: libiconv(php用于編碼轉換)

4.devel: pre-8.20l(Apache);perl-5.12.4.3

5.emulators: linux_base兼容包

6.FTP: curl-1.21.3.2

7.graphics: giflib-4.1.6 ; jpeg-8.3 ; libexif-0.6.20 ; png-1.4.8

8.lang: perl-5.12.4.3 ; python ; ruby

9.all:  libxml2-7.8-1 , freetype

ports/emulators/linux_libauo

ports/security/sshguard

ports/security/mcrypt

 kldstat 命令內核掛載情況,是否關在linux.ko

開始安裝

1、安裝mysql 

 

創(chuàng)建用戶組mysql

shell>pw groupadd mysql

添加用戶至用戶組

shell> pw useradd -r -g mysql mysql

解壓:因為mysql是已經編譯好的版本,因此無需安裝

cd /soft 

tar –vzxf mysql-5.6.11.tar.gz  解壓

mv mysql-5.6.11-free* /usr/local/servers/mysql

cd  /usr/local/shadow/mysql

chown –R mysql .  更改當前文件夾下所有文件的用戶(注意后面有.)

chgrp –R mysql .  更改當前文件夾下所有文件的組

./scripts/mysql_install_db –user=mysql  安裝mysql服務,會生成一個my.cnf的配置文件

chown –R root .   修改mysql文件夾內所有文件用戶為root

chown –R mysql data修改mysql文件夾內data文件夾用戶為mysql

./bin/mysqld_safe –user=mysql &  啟動mysql服務

./bin/mysql –u root –p 密碼為空

use mysql

Delete from user where host<>’127.0.0.1’;

select host,user,password from user;

update user set host=’%’,password=password(‘shadow’); //修改登錄ip為任意;密碼為shadow

flush privileges;   //刷新mysql帳號權限

然后遠程連一下數據庫試試吧。。

  初始化root密碼

bin/mysqladmin -u root password 'newpassword'

bin/mysqladmin –u root password  123456

./mysqladmin   -u   root   -p   password   '456'  

 然后系統(tǒng)會詢問你現(xiàn)在的密碼,你輸入現(xiàn)在的密碼123回車就可以了  

 下次使用MYSQL的時候,ROOT   的口令就是456了

 測試帳號

bin/mysql –u root –p

然后輸入密碼,出現(xiàn)提示符:

mysql>

技巧提示:

mysql #運行mysql 客戶端,并開放root用戶的遠程訪問權限。以便調試

use mysql

update user set host = '%' where user = 'root' and host <> 'localhost';

flush privileges;

quit

2、apache安裝

Step 1

編譯Apache的要求

1.  磁盤空間   2.ANSI- C編譯器及編譯環(huán)境 3.確保準確的時間 4.Perl5 [可選]

5.  apr/apr-util >= 1.2

需要先下載  apr-1.4.6.tar.gz 和 apr-util-1.5.1.tar.gz

配置并安裝  地址  http://apr.apache.org/download.cgi

apr和apr-util包含在Apache httpd的發(fā)行源代碼中,并且在絕大多數情況下使用都不會出現(xiàn)問題。

當然,如果apr或apr-util的1.0或1.1版本已經安裝在你的系統(tǒng)中了,則必須將你的apr/apr-util升級到1.2版本,

或者將httpd單獨分開編譯。要使用發(fā)行源代碼中自帶的apr/apr-util源代碼進行安裝,你必須手動完成:

@note: 編譯和安裝 apr 1.4.6

tar -zxvf apr-1.4.6.tar.gz

cd srclib/apr-1.4.6

./configure –-prefix=/usr/local/apr/

make

make install

@note: 編譯和安裝 apr-util 1.5.1

tar -zxvf apr-util1.5.1.tar.gz

cd ../apr-util1.5.1

./configure –-prefix=/usr/local/apr-util/ –-with-apr=/usr/local/apr/

make

make install

step2-1安裝httpd

tar zxvf httpd-2.2.15.tar.gz

cd ../httpd-2.2.15

安裝示例: ./configure --prefix=/usr/local/servers/apache22 --enable-so      --enable-deflate=shared --enable-ssl=shared --enable-expires=shared        --enable-headers=shared --enable-rewrite=shared --enable-static-support      --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr-util/bin/apu-1-config --with-mpm=prefork --enable-cache=shared --enable-disk-cache=shared --enable-mem-cache=shared --enable-vhost-alias=shared --enable-suexec --with-pcre

make

make install

apache 啟動服務

    /usr/local/servers/apache22/bin/httpd -k start restart stop

    /usr/local/servers/apache22/bin/httpd -k graceful

    /usr/local/apache/bin/apachectl -k restart

3、安裝php

    版本要求,至少5.4以上

    安裝apache需要vhost支持

    可以平滑重啟

1.安裝mod_fastcgi

    下載mod_fastcgi-2.4.6

    解壓縮

    修改Makefile.AP2改名為Makefile

修改   top_dir=你的apache路徑

    然后執(zhí)行命令make install 安裝  

2.phpcgi 服務啟動 即安裝php 需要php5.4以上

    /usr/local/servers/php/sbin/php-fpm &

    安裝示例: ./configure --prefix=/usr/local/php --with-apxs2=apache路徑/bin/apxs2

--enable-fpm --with-zlib=/zlib路徑 --with-bz2=/bzip2路徑 --with-curl=/curl路徑 --with-gd=/gd路徑

--with-jpeg-dir=/jpeg路徑 --with-png-dir=/png路徑 --enable-mbstring --with-mcrypt=/mcrypt路徑

--with-mysql=/mysql路徑 --with-mysqli=/mysql路徑 --with-libxml-dir=/xml路徑 --enable-mysqlnd

    我是這樣進行安裝配置的

    ./configure --prefix=/usr/local/servers/php --with-apxs2=/usr/local/servers/apache22/bin/apxs --enable-fpm --with-zlib --with-bz2 --with-curl --with-gd --enable-gd-jis-conv --with-freetype-dir --with-jpeg-dir --with-png-dir --enable-mbstring --enable-ftp --enable-exif --with-mcrypt --with-mysql --with-mysqli=mysqlnd --with-libxml-dir --enable-mysqlnd

完成上面會顯示感謝使用PHP等字樣

make

編譯成功后出現(xiàn)"Build complete."字樣,那么就可以進行安裝了:

(make編譯時fpm模塊出錯:解決辦法php5.4.11/sapi/fpm/fpm/fpm_sockets.c文件修改三處代碼     info.tcpi_sacked  改為: info.__tcpi_sacked

info.tcpi_unacked 改為: info.__tcpi_unacked)

make install

 完成即可  可以平滑重啟

 3、拷貝php配置文件

cp  php.ini-development(開發(fā)模式)  或者production生產模式     /usr/local/servers/php/etc/php.ini

修改php.ini

    disable_functions =system,exec,shell_exec,passthru,ini_alter,dl,pfsockopen,openlog,syslog,readlink,symlink,link,

leak,popen,escapeshellcmd,apache_child_terminate,apache_get_modules,apache_get_version,

apache_getenv,apache_note,apache_setenv,virtual;,phpinfo

4、修改配置

修改/usr/local/servers/php/etc/php.ini文件(新版本可能不需要)

register_globals = On

修改/usr/local/apache/conf/ httpd.conf文件

設置apache的默認文件名次序

DirectoryIndex index.html index.htm index.php

增加php后綴支持

AddType application/x-httpd-php .php .php3 .phtml

AddType application/x-httpd-php-source .phps

5、重啟apache服務

/usr/local/apache/bin/apachectl -k restart

6、測試php

<?php

echo phpinfo();

?>

4、proftp 服務安裝啟動,安裝ftp

    /usr/local/servers/proftp/sbin/proftpd &

    安裝示例:./configure --prefix=/usr/local/servers/proftpd

    添加、修改、刪除帳號

首先添加管理組     

./ftpasswd --group --name=czh --gid=1001 --file=../etc/group   

添加用戶

./ftpasswd --passwd --name=sohuishangbao --uid=1004 --gid=80 --file=../etc/passwd

--shell=/sbin/nologin --home=/wwwroot/lianmeng

./ftpasswd --passwd --name=hsbczh --uid=1003 --gid=1001 --file=../etc/passwd

--shell=/sbin/nologin --home=/wwwroot/www.huishangbao.com/www

輸入后,會提示輸入用戶的密碼,密碼不能太長,不能有特殊字符。   

注意,以上路徑需根據各服務具體路徑而定

www1:*:1003:80:User &:/home/www1:/usr/sbin/nologin

www2:*:1004:80:User &:/home/www2:/usr/sbin/nologin

www3:*:1005:80:User &:/home/www3:/usr/sbin/nologin

www4:*:1006:80:User &:/home/www4:/usr/sbin/nologin

www5:*:1007:80:User &:/home/www5:/usr/sbin/nologin

www6:*:1008:80:User &:/home/www6:/usr/sbin/nologin

www7:*:1009:80:User &:/home/www7:/usr/sbin/nologin

www8:*:1010:80:User &:/home/www8:/usr/sbin/nologin

www9:*:1011:80:User &:/home/www9:/usr/sbin/nologin

相關文章

  • Unix,BSD,Linux系統(tǒng)三者的區(qū)別小結

    這篇文章主要介紹了Unix,BSD,Linux系統(tǒng)三者的區(qū)別小結,需要的朋友可以參考下
    2023-05-03
  • FreeBSD如何添加硬盤?FreeBSD添加硬盤的方法

    一些朋友問小編FreeBSD如何添加硬盤?別擔心,今天小編就為大家分享FreeBSD添加硬盤的方法,希望對大家會有幫助,有需要的朋友一起去看看吧
    2017-04-06
  • Freebsd PF 安裝使用詳解

    今天小編為大家?guī)淼氖荈reebsd PF 安裝使用詳解,希望對大家會有幫助,有需要的朋友一起去看看吧
    2017-04-06
  • FreeBSD下zfs: failed with error 6錯誤如何解決?

    最近一些朋友問小編 FreeBSD下zfs: failed with error 6錯誤如何解決?今天小編要為大家?guī)淼氖?FreeBSD下zfs: failed with error 6錯誤的解決方法,有需要的朋友一起去看
    2017-04-06
  • Unix文件系統(tǒng)和pwd命令實現(xiàn)詳解

    今天小編要為大家?guī)淼氖荱nix文件系統(tǒng)和pwd命令實現(xiàn)詳解,希望對大家會有幫助,有需要的朋友一起去看看吧
    2017-04-01
  • Unix中的dot命令詳解

    今天小編將為大家?guī)淼氖荱nix中的dot命令詳解!希望對大家會有幫助!有需要的朋友一起去看看吧
    2017-03-22
  • freebsd時間設置小節(jié)詳解

    近日!一些朋友對于freebsd時間設置小節(jié)存在疑慮!下面小編將為大家?guī)淼氖莊reebsd時間設置小節(jié)詳解!希望對大家會有幫助!有需要的朋友一起去看看吧
    2017-03-19
  • grub2引導freebsd詳解

    今天小編要為大家?guī)淼氖莋rub2引導freebsd詳解!希望對大家會有幫助,有需要的朋友一起去看看吧
    2017-03-19
  • FreeBSD10安裝內核源代碼方法講解

    下面小編為大家?guī)淼氖荈reeBSD10安裝內核源代碼方法講解!希望能夠幫助到大家!有需要的朋友一起去看看吧
    2017-03-19
  • FreeBSD下如何使GraphicsMagick支持中文字體?

    最近一些朋友在問FreeBSD下如何使GraphicsMagick支持中文字體?今天小編為大家?guī)淼氖荈reeBSD下使GraphicsMagick支持中文字體的方法!有需要的朋友一起去看看吧
    2017-03-15

最新評論