Jump to content

alexfung

Members
  • Content Count

    30
  • Joined

  • Last visited

Everything posted by alexfung

  1. My pages worked fine last week. After the weekend upgrade it broken. I think I've narrowed it to the .htaccess. RewriteEngine on RewriteRule (.*)\.x.l$ http://bank.alexfung.info/loadxxl.php [PT] The idea is, all requests for .xml and .xsl files will be routed to this php, which then file_get_contents() the files from a read directory that the http demon is told not to access. I have reduced the php to read: $uri=$_SERVER["REQUEST_URI"]; echo $uri; exit; but still: URI = loadxxl.php: runs correctly URI = xxx.xml: gets "400 Bad Request" <-- why? URI = xxx.xxx: gets "404 Not Found" as expected Any ideas why this would fail after the PHP upgrade?
  2. Through my office firewall I cannot access strange port numbers like 2082. Why is 2082 chosen? Is there a security benefit? Is there a way I can access cpanel at port 80?
  3. You are right! When I saw "--with-dom --with-dom-xslt --with-dom-exslt" I thought it is enabled, but comparing with an older phpinfo I saved, it used to have "'--enable-xslt' '--with-xslt-sablot' " as well, the two flags you mentioned. I'll go get the ticket.
  4. I wrote this code last year and it has been fine since then. Last time I run it was some two or three weeks ago. Today it failed. What has happened? I got: <br /> <b>Fatal error</b>: Call to undefined function: xslt_create() in <b>/home/alexfun/public_html/bank/loadxxl.php</b> on line <b>48</b><br /> the php is essentially this: header('Content-Type: text/xml; charset=UTF-8'); header('Cache-Control: private, max-age=60'); $hXML = xslt_create(); $output = xslt_process($hXML, $xml, 'private.xsl', NULL, NULL, array('id' => $_SESSION['accid'])); xslt_free($hXML); I'm on Server 24.
  5. The requirements sounds like single sign on to me. Look for those special purpose commercial software. They have servers that work together. Basically, each server only knows about the details of its own users. When passing a user to another site, the servers chat. All the target server knows is that a user is coming, and a partner server has authenticated who he is. Without these software, maintaning the id/pwd is maddening.
  6. Would TCH add to apache -enable-module=expires and -enable-module=headers? That should improve the server performance by making us easier to control the cacheability of things. By the way, what is "TCH Family"? If "customers" mean people hosted at TCH, why didn't I get a password for the TCH Family forum?
  7. I am new to web programming. And I can't make these options work. Not even make them "work as intended". <Location /test/alex.txt> SetHandler application/x-httpd-php </Location> gives me a 500 Internal Server Error. Same when without the SetHandler directive. What's wrong with my <location>? Changing it to Files worked: <Files alex.txt> SetHandler application/x-httpd-php </Files> but why the original one crashed? Similarly: ExpiresActive On ExpiresByType text/xml A3600 ExpiresByType text/html A300 nearly copied and pasted from apache doc. Placed in .htaccess, any of these lines crashes any file access. Is it because the module is not loaded with the TCH apache? Finally the XBitHack. I added XBitHack Full I traced the http headers and can't see any effect. I turned several .htm files to 654, and then 755. I can't see any Modified tag generated. Why? Thanks for reading.
  8. Ah! it can be turned off after all. Thanks
  9. 1) Is the forum search function disabled? I get errors whenever I search anything. 2) is there a forum to talk about the forums?
  10. My first script using session: <?php session_start(); echo ini_get('session.use_trans_sid') . "<br>"; ?> <a href="page2.php">continue</a> To my surprise, the ini_get returns 1, and the <a> target receives a PHPSESSID=...... query string. Same after adding: ini_set('session.use_only_cookies',"1"); So I check the phpinfo(). Even more mysterious to me: http://www.totalchoicehosting.com/help/info.php says it is off (and "only cookie" on), but phpinfo() running on my server it says otherwise (sid on, only cookie off). Why? Since the trans_sid is a "PHP_INI_SYSTEM" setting, does it mean I have no way to disable it? Why is the system set this way?
  11. Thanks Lianna, for checking out eFTP. How about SafeTP http://www.cs.berkeley.edu/~smcpeak/SafeTP/index.html It has a GNU unix source. Don, thanks for pointing out. The control panel file manager is secure and good when I update a few files. I've written a program to scan my hard disk for files that requires updating to my site. The program can't use the control panel. SafeTP claims it is completely transparent to client, so perhaps my program can use it. Even if it doesn't it is much easier to transfer large number of files using an FTP client than the file manager, which is pretty difficult to navigate around the directory tree. By the way, the file manager lacks a simple features. It cannot make a copy of a file in the same directory using a new name (ie "cp a b"). That that is a Control Panel issue, not a TCH issue.
  12. FTP isn't secure. Can I use eFTP on TCH?
  13. The [F] just happen to be in the manual example. I wanted to serve some JS files depending on country, and doesn't what to add .js to the list of php processed extensions. So my intention is: RewriteCond %{REMOTE_HOST} ^.*\.hk$ RewriteRule (.*)\.js hk$1.js [L] I quoted the example from the manual just to make sure I don't complicate the issue by making other mistakes unrelated to my inability to access the %{REMOTE_HOST}
  14. An example from Apache URL rewrite guide: RewriteCond %{REMOTE_HOST} ^badhost\.mydomain\.com$ RewriteRule !^http://[^/.]\.****.* - [F] Nevermind what exactly it is doing. At least it can detect the hostname of the requester. I can't get it work. %{REMOTE_HOST} is always null. Similary PHP $_SERVER['REMOTE_HOST'] is null. In php I can revert to gethostbyaddr($_SERVER['REMOTE_ADDR'], what do I do in RewriteCond? By the way, can I access the rewrite log to ease debugging?
  15. I solved my posted question: <?php echo gethostbyaddr($_SERVER['REMOTE_ADDR']) ?> However, I failed to do similar things in .htaccess. Textbook examples have RewriteCond %{REMOTE_HOST} ... but does not work (because it is always null). Why?
  16. Thanks for the code. I got REMOTE_ADDR, but not REMOTE_HOST. OTOH, the http://www.totalchoicehosting.com/help/info.php correctly listed my REMOTE_HOST under Apache Environment. How is it possible? An unrelated question. I have turned on notifications, and set the correct email address. However, I never got any notifications. Is there something wrong?
  17. I did a <?php echo $_SERVER['REMOTE_HOST'] ?>. Returns empty. Then I copied an example from PHP manual: <?php $headers = apache_request_headers(); foreach ($headers as $header => $value) { echo "$header: $value <br />\n"; } ?> no REMOTE_HOST line. no Remote_ADDR line. How does the PHP_INFO list REMOTE_HOST? By the way, can I check REMOTE_HOST in .htaccess RewriteCond?
  18. I'd love to be added to the family. But is it OK if I add my root site and subdomains? The root site alexfung.info is a personal site, but the game.alexfung.info is highly information (game guides).
  19. Thanks It's good to know that my changes are safe
  20. Thanks it is linked. However, I am astonished that my DOCUMENT_ROOT=/usr/local/apache/htdocs What is happening?
  21. Since cpanel is editing my htaccess files, and I am also editing them, is the any conflict? Is there anything I should avoid doing? Something that will confuse cpanel, or something that cpanel will remove?
  22. I added a <Location /spcc> Deny from all </Location> into my .htaccess. I suppose that will stop all URL requests to the spcc directory. However, this 3 lines kills my site. Give 500 (internal server error) to any page access. What's wrong with it? I also tried <Directory /spcc> Deny from all </Directory> and gets the same result.
  23. There is no way I know of to create a symbolic link without using telnet/ssh. I understand that telnet and ssh are potentially dangerous and should be restricted. Yet, I hope TCH can provide a method for us to manage symbolic links.
×
×
  • Create New...