日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

为什么下载源码包需要到官网上去下载?

發(fā)布時(shí)間:2025/5/22 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 为什么下载源码包需要到官网上去下载? 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1. 為什么下載源碼包需要到官網(wǎng)上去下載?

答:官網(wǎng)提供的源碼包更完整,無修改,無病毒,無后門。

2. 64位機(jī)器是否可以安裝32位rpm包?64位機(jī)器是否可以安裝32位的mysql二進(jìn)制免編譯包?

答:可以,但是不建議這樣做,最好是安裝對(duì)應(yīng)版本的包,不容易出問題。

3. 編譯安裝apache時(shí), 會(huì)有什么問題?

答:編譯安裝apache需要底層接口庫apr的支持,如果不加--with-included-apr參數(shù),會(huì)編譯出錯(cuò):Cannot use an external APR with the bundled APR-util

4. 編譯php時(shí),必須加上 --with-apxs2=/usr/local/apache2/bin/apxs 這是什么意思呢?

答:使用apache自帶的apxs工具將編譯產(chǎn)生的php動(dòng)態(tài)鏈接庫libphp5.so自動(dòng)加載到apache的模塊列表中,如果不使用該工具,則需要手動(dòng)添加。

5. 當(dāng)配置好apache的配置文件后,如何檢驗(yàn)配置文件是否正確?

答:使用apache自帶的工具apachectl -t選項(xiàng)檢測(cè)配置。

6. 如何查看80端口是否啟動(dòng)?

答:netstat -lnp |grep ':80'

7. 更改apache配置文件httpd.conf后,如何重新加載配置文件?

答:apachectl graceful

8. 如何查看apache加載了哪些模塊?

答:apachectl -M

9. 怎么查看php加載了哪些模塊?

答:php -m

10. 簡單描述靜態(tài)加載和動(dòng)態(tài)共享模塊的區(qū)別。

答:靜態(tài)加載是在編譯時(shí)將模塊一同編譯進(jìn)可執(zhí)行文件中,可執(zhí)行文件較大,但是執(zhí)行速度快;動(dòng)態(tài)加載是將模塊和可執(zhí)行程序分開編譯,執(zhí)行時(shí)調(diào)用模塊功能,可執(zhí)行文件較小,執(zhí)行速度較慢。

11. 當(dāng)我們配置好lamp環(huán)境后,訪問php程序無法解析,你如何去排查這個(gè)問題呢?

答:首先 /usr/local/apache2/modules/目錄下得有l(wèi)ibphp5.so模塊

然后 httpd.conf 中得有 LoadModule libphp5.so 語句

同時(shí) httpd.conf 中得有 AddType application/x-httpd-php .php 語句

最后 apache 要重新加載配置文件

12. 如何配置apache的虛擬主機(jī)

答:編輯apache主配置文件:vim apache2/conf/httpd.conf

去掉 #Include conf/extra/httpd-vhosts.conf 最前面的注釋符 #,并且修改:

Deny from all 為 Allow from all

最后編輯虛擬主機(jī)配置文件:vim ?apache2/conf/extra/httpd-vhosts.conf

根據(jù)實(shí)際需求修改相關(guān)內(nèi)容

13. 如何配置apache的用戶驗(yàn)證

答:[root@CentOS6 ~]vim ?/usr/local/apache2/conf/extra/httpd-vhosts.conf

……

<VirtualHost *:80>

DocumentRoot "/data/www"

ServerName www.test.com

ServerAlias www.mydiscuz.com

? ?<Directory /data/www/important/>

? ? ? ?AllowOverride AuthConfig

? ? ? ?AuthName "username"

? ? ? ?AuthType Basic

? ? ? ?AuthUserFile /data/.htpasswd

? ? ? ?require valid-user

? ?</Directory>

</VirtualHost>

……

[root@CentOS6 ~]# htpasswd -c /data/.htpasswd jack

New password:123456

Re-type new password:123456

Adding password for user jack

14. 如何配置apache的日志以及日志按天切割

答:[root@CentOS6 ~]# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf

……

<VirtualHost *:80>

DocumentRoot "/data/www"

ServerName www.test.com

ServerAlias www.mydiscuz.com

ServerAlias www.others.com

?ErrorLog "logs/test.com-error_log"

? ?CustomLog "| /usr/local/apache2/bin/rotatelogs -l /usr/local/apache2/logs/test.com-access_%Y%m%d_log 86400" combined

……

15. 如何配置apache的圖片等靜態(tài)文件的過期時(shí)間

答:[root@CentOS6 ~]# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf

……

CustomLog "| /usr/local/apache2/bin/rotatelogs -l /usr/local/apache2/logs/test.com-access_%Y%m%d_log 86400" combined env=!p_w_picpath-request

<IfModule mod_expires.c>

? ? ? ?ExpiresActive on

? ? ? ?ExpiresByType p_w_picpath/gif "access plus 1 days"

? ? ? ?ExpiresByType p_w_picpath/jpeg "access plus 24 hours"

? ? ? ?ExpiresByType p_w_picpath/png "access plus 24 hours"

? ? ? ?ExpiresByType p_w_picpath/css "now plus 2 hours"

? ? ? ?ExpiresByType application/x-javascript "now plus 2 hours"

? ? ? ?ExpiresByType application/x-shockwave-flash "now plus 2 hours"

? ? ? ?ExpiresDefault "now plus 0 min"

? ?</IfModule>

<IfModule mod_rewrite.c>

……

16. 如何限定某個(gè)目錄下的php文件沒有執(zhí)行權(quán)限

答:[root@CentOS6 ~]# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf

……

<Directory /data/www/important>

? ? ? ?php_admin_flag engine off

? ? ? ?<filesmatch "(.*)php">

? ? ? ? ? ?Order deny,allow

? ? ? ? ? ?Deny from all

? ? ? ?</filesmatch>

? ?</Directory>

……

17. 如何配置apache的域名重定向

答:[root@CentOS6 ~]# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf

……

<VirtualHost *:80>

DocumentRoot "/data/www"

ServerName www.test.com

ServerAlias www.mydiscuz.com

<IfModule mod_rewrite.c>

? ? ? ?RewriteEngine on

? ? ? ?RewriteCond %{HTTP_HOST} ^www.mydiscuz.com$

? ? ? ?RewriteRule ^/(.*)$ http://www.test.com/$1 [R=301,L]

? ?</IfModule>

……

18. 如何配置php的錯(cuò)誤日志

答:[root@centos6 ~]# mkdir /usr/local/php/logs

[root@centos6 ~]# chmod 777 /usr/local/php/logs

[root@centos6 ~]# ?vim /usr/local/php/etc/php.ini

……

; Example:

error_log = /usr/local/php/logs/php_errors.log

; Log errors to syslog (Event Log on Windows).

……

; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED

; Development Value: E_ALL

; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT

; http://php.net/error-reporting

error_reporting = E_ALL & ~E_NOTICE

……

19. 如何在php中配置open_basedir, 是否可以在httpd.conf 中針對(duì)虛擬主機(jī)配置open_basedir?

答:[root@centos6 logs]# ?vim /usr/local/php/etc/php.ini

……

; open_basedir, if set, limits all file operations to the defined directory

; and below. ?This directive makes most sense if used in a per-directory

; or per-virtualhost web server configuration file. This directive is

; *NOT* affected by whether Safe Mode is turned On or Off.

; http://php.net/open-basedir

open_basedir = /data/www/:/tmp/

……

可以在httpd.conf 中針對(duì)虛擬主機(jī)配置open_basedir:

[root@centos6 logs]# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf

……

<VirtualHost *:80>

# ?ServerAdmin webmaster@dummy-host2.example.com

DocumentRoot "/data/www"

ServerName www.test.com

ServerAlias www.aaa.com

ServerAlias www.bbb.com

?php_admin_value open_basedir "/data/www/:/tmp/"

<Directory "/data/www">

AllowOverride None

Options None

……

20. 如何禁止php的函數(shù)exec

答:[root@centos6 ~]# vim /usr/local/php/etc/php.ini

……

; This directive allows you to disable certain functions for security reasons.

; It receives a comma-delimited list of function names. This directive is

; *NOT* affected by whether Safe Mode is turned On or Off.

; http://php.net/disable-functions

disable_functions = eval,assert,popen,passthrn,escapeshllarg,escapes

hellcmd,passthru,exec,system,chroot,scandir,chgrp,chown,escapeshellc

md,escapeshellarg,shell_exec,proc_get_status,ini_alter,ini_restore,d

l,pfsockopen,openlog,syslog,readlink,syslink,leak,popepassthru,strea

m_socket_server,popen,proc_open,proc_close

21. 我們以源碼安裝LAMP環(huán)境時(shí),先安裝哪個(gè),后安裝哪個(gè)?為什么呢?

答:php依賴于MySQL,還需要使用Apache的apxs工具,所以只要是最后安裝PHP即可。

22. 怎么確定你的php.ini 在哪個(gè)目錄下?

答:php -i |grep 'Configuration File'

23. 怎么確定你的php的extension_dir 在哪里?

答:php -i |grep 'extension_dir'


轉(zhuǎn)載于:https://blog.51cto.com/rachy/1892296

總結(jié)

以上是生活随笔為你收集整理的为什么下载源码包需要到官网上去下载?的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。