2019年3月8日 星期五

【ASP.NET】HTTP 錯誤 500.21 - Internal Server Error 錯誤碼0x8007000d

HTTP 錯誤 500.21 - Internal Server Error

處理常式 "PageHandlerFactory-Integrated" 的模組清單中有錯誤的模組 "ManagedPipelineHandler"



模組 IIS Web Core
通知 ExecuteRequestHandler
處理常式 PageHandlerFactory-Integrated
錯誤碼 0x8007000d 

學習記錄

             撰寫第一支程式,發生了錯誤訊息並記錄下來,希望能了解錯誤訊息,將它解決^^。
            

HTTP 錯誤 500.21 - Internal Server Error

處理常式 "PageHandlerFactory-Integrated" 的模組清單中有錯誤的模組 "ManagedPipelineHandler"



模組IIS Web Core
通知ExecuteRequestHandler
處理常式PageHandlerFactory-Integrated
錯誤碼0x8007000d
可能原因

  • 使用 Managed 處理常式,卻未安裝 ASP.NET,或安裝不完整。
  • 處理常式模組清單的設定中有拼字錯誤。

解決方式
        重新安裝註冊FrameWork 版本4.0.30319,安裝完成後即可正常使用
安裝步驟(windows 7)
  1. 開啟命令提示字元(點滑鼠右鍵)以系統管理員身份執
  2. 輸入HTTP 錯誤 500.21 - Internal Server Error 

    處理常式 "PageHandlerFactory-Integrated" 的模組清單中有錯誤的模組 "ManagedPipelineHandler"



    模組 IIS Web Core
    通知 ExecuteRequestHandler
    處理常式 PageHandlerFactory-Integrated
    錯誤碼 0x8007000d 

    學習記錄

                 撰寫第一支程式,發生了錯誤訊息並記錄下來,希望能了解錯誤訊息,將它解決^^。
                

    HTTP 錯誤 500.21 - Internal Server Error

    處理常式 "PageHandlerFactory-Integrated" 的模組清單中有錯誤的模組 "ManagedPipelineHandler"



    模組IIS Web Core
    通知ExecuteRequestHandler
    處理常式PageHandlerFactory-Integrated
    錯誤碼0x8007000d
    可能原因

    • 使用 Managed 處理常式,卻未安裝 ASP.NET,或安裝不完整。
    • 處理常式模組清單的設定中有拼字錯誤。

    解決方式
            重新安裝註冊FrameWork 版本4.0.30319,安裝完成後即可正常使用
    安裝步驟(windows 7)
    1. 開啟命令提示字元(點滑鼠右鍵)以系統管理員身份執

    輸入%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i   

    1. 出現訊息如下圖1所示:
    2. 當你安裝完成後,如下圖2所示:
    3. 退出可以輸入  exit  
      

  3. 出現訊息如下圖1所示:
  4. 當你安裝完成後,如下圖2所示:
  5. 退出可以輸入  exit  

解决IIS7中出现An error occurred on the server when processing the URL错误提示的方法

相信用过IIS7的朋友在调试程序的时候都遇到过下面这样的错误提示:

    An error occurred on the server when processing the URL. Please contact the system administrator.If you are the system administrator please click here to find out more about this error.

    其实这是IIS7对ASP程序发送的一个脚本错误消息,只要是程序中有错误就会出现这样的错误提示,所以关键的一步是要将具体的错误显示出来,方法如下:

    1、打开控制面板→管理工具→Internet 信息服务(IIS)管理器→双击“ASP”图标,相关截图如下所示:

    2、在左边的窗口中找到你的网站,然后在右边的窗口中展开“调试属性”,把“将错误发送到浏览器”设为True即可,相关截图如下所示:

    此时你再运行ASP程序时就会看到具体的错误了,然后再根据错误提示进行相应的修改即可。

    小提示:在IIS7中请将父路径启用,否则只要你用到了父路径就会出现上面的错误了,启用父路径的设置在上面第二步的地方,上图中已经标出来了。

Windows Server 2008R2 64 bit + IIS 7.5 + PHP 32 bit

安裝及設定流程:
  1. 下載 PHP VC9 x86 ZIP 包 (thread safe 或 non thread safe 都可以),php各版本下載網址: https://windows.php.net/downloads/releases/archives/
  2. 下載 Microsoft Visual C++ 2008 SP1 可轉散發套件 (x86) (沒安裝這個最後要 run PHP 會收到 500 錯誤)
  3. 解壓縮 PHP 包到某個目錄
  4. 複製 php.ini-production 為 php.ini 到 c:\windows 下
  5. 設定 php.ini
  6. 伺服器新增 IIS 角色
  7. 應用程式開發安裝要勾選 CGI、ASP、ASP.NET
  8. 設定處理常式對應 FastCGI -> PHP
  9. 建立 PHP 32bit用的應用程式集區
  10. 完成
  11. 剩下就是關於 安全性、效能、Extension 的設定了
額外資訊:
Q. 為何不安裝 PHP 64 bit ?
A. PHP 資料型態長度會因為編譯的位元平台而有變化,integet 在 32 bit 是 4 bytes,在 64 bit 就變成 8 bytes,如果應用程式沒考量到這個狀況,就有可能出現意外。

2014年6月19日 星期四

在ASP網頁中自動產生QRCode

function qrCode(strText,intSize)
    if strText = "this" then
        strProtocol = "http"
        strHTTPS = lcase(request.ServerVariables("HTTPS")
        if strHTTPS <> "off" then strProtocol = "https"
        strDomain = Request.ServerVariables("SERVER_NAME")
        strURL = Request.ServerVariables("SCRIPT_NAME")
        strQueryString = Request.ServerVariables("QUERY_STRING")
        strText = strProtocol & "://" & strDomain & strURL & "?" & strQueryString
    end if

    qrCode = "https://chart.googleapis.com/chart?cht=qr&chs=" & intSize & "x" & intSize & "&chld=L|1&chl=" & server.URLEncode(strText)

end function


所以只要下以下命令即可:
        qrCode("this",150)

詳細資料請參閱:https://developers.google.com/chart/infographics/docs/qr_codes

2013年2月28日 星期四

centos下安裝filezilla

因为filezilla的官方二進制包是在debian下編譯的,所以我們無法使用。但是使用源代碼的話又有很多的依賴,我在filezilla的 WIKI上看到了一個非官方的二進制包,地址为:http://wiki.filezilla-project.org /Unofficial_Binaries
這样的話安裝步驟就簡單多了,我們可以直接下載這個在CentOS平台的二進制包,然後解壓就可以直接運行了。
FileZilla 3.2.4 for CentOS 5.3

下載地址:http://code.technoplaza.net/filezilla/history/FileZilla-3.2.4-x86-CentOS_5.3.tar.bz2

tar xvfj FileZilla-3.2.4-x86-CentOS_5.3.tar.bz2

mv filezilla /usr/local/

ln -s /usr/local/filezilla/bin/filezilla /usr/local/bin/filezilla 

2013年2月25日 星期一

設定mysql

# mysql_secure_installation




NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...



All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

強化yum功能

強化yum功能

  1. yum install yum-fastestmirror(加快yum下載速度)
  2. yum install yum-priorities
    • vim /etc/yum/pluginconf.d/priorities.conf
      • 在 [main]下新增enabled=1 (預設已寫上)
    • cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
    • vim /etc/yum.repos.d/CentOS-Base.repo
      • 在[base], [addons], [updates], [extras]項目下新增 priority=1
      • 在[centosplus],[contrib]項目下新增 priority=2
  3. /etc/init.d/yum-updatesd restart
二、下載相關套件並安裝(請自行對應)
 OR
  • wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
  • x86_64 wget http://apt.sw.be/redhat/el5/en/x86_64/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
  • 安裝金鑰
    • rpm --import http://www.wles.chc.edu.tw/upfiles/file/RPM-GPG-KEY.dag.txt
     OR
    • rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
  • rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm (以i386為例)
三、檢查更新
  • yum check-update