Jump to content

ironhamster88

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Everything posted by ironhamster88

  1. I've just given that a shot, all I seem to get is the error: An error occurred during a connection to test.wunderapps.com. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long) Thanks Pete
  2. I've included a VirtualHost entry below. The SSL governs the entire domain so it's not included in the VHost config for each vhost. <VirtualHost XXX.XXX.XXX.XXX:80> ServerName sub1.domain.com ServerAlias www.sub1.domain.com DocumentRoot /home/domain/public_html/_apps/sub1/public_html ServerAdmin webmaster@sub1.domain.com UseCanonicalName On CustomLog /usr/local/apache/domlogs/sub1.domain.com combined CustomLog /usr/local/apache/domlogs/sub1.domain.com-bytes_log "%{%s}t %I .\n%{%s}t %O ." ## User wunderap # Needed for Cpanel::ApacheConf <IfModule !mod_disable_suexec.c> SuexecUserGroup wunderap wunderap </IfModule> ScriptAlias /cgi-bin/ /home/domain/public_html/_apps/sub1/public_html/cgi-bin/ </VirtualHost>
  3. Hi requinix, Exactly so - we have a lot of sub domains and we are adding more all the time so a wildcard SSL was the only practical option. The subdomains are done using virtual hosts. As I mentioned, without SSL, the document root directory for each subdomain is correct (i.e. /home/public_html/_apps/sub1 being the docroot for sub1.domain.com), but it's when you visit one of the subdomains behind SSL that the issue occurs. For some reason, behind SSL, each subdomain's document root reverts back to the document root for domain.com as oppose to sub1.domain.com. The mod_rewrite code is in there purely to allow the wildcard SSL to be distributed across the multiple subdomains. There's one entry for each subdomain as the SSL doesn't work for the domains without the mod_rewrite. I was just wondering if there was something I could put in the mod_rewrite to make it maintain the correct document root for each subdomain (as it is when it's not behind SSL) rather than reverting the document root for each domain back to the doc root for the base domain. Thanks Pete
  4. Hi Guys, So I've recently bought and installed a wildcard SSL on my server which governs domain.com and any subdomain that I add to it. In essence, the cert works fine. For example, if I set up a static 'hello world' PHP page and set the domain to sub1.domain.com, the page is displayed in both HTTP and HTTPS (with some mod_rewrite which I'll come to shortly). The issue is that the domain is serving applications, which all kind of need their own document root to function properly. If I print_r the $_SERVER array outside HTTPS, I see the correct document root - something like: /home/domain.com/public_html/_apps/sub1/ That would be the doc root for sub1.domain.com If I then switch over to HTTPS and again, print_r the $_SERVER array, I get: /home/domain.com/public_html It seems to be completely ignoring the docroot for that subdomain. The current mod_rewrite I'm using in the docroot of the base domain is: RewriteEngine On RewriteCond %{SERVER_PORT} ^443$ RewriteCond %{HTTP_HOST} ^sub1\.domain\.com$ [NC] RewriteCond %{REQUEST_URI} !^/_apps/sub1/ RewriteRule ^(.*) /_apps/sub1/$1 This is required to get the wildcard SSL working across multiple subdomains. Without this, switching to SSL just reverts to the base domain. Does anybody know if/how I can maintain the document root from normal HTTP inside HTTPS and stop it changing the document root to that of the base domain when running through HTTPS? Cheers Pete
  5. The only DNS settings that I know of are the ones that are set up with regard to the amazon aws hosting. So I've got an amazon aws url that looks something like: ec2-181-72-3-45.compute-1.amazonaws.com
  6. Hi all, I've got an amazon aws instance running Fedora. All set up and working well, the issue came when I try to set up vhosts. Internally (i.e. from a browser on the box), they work, so I can open Firefox on Fedora via VPN and type say: http://site1.localhost and I see the site fine. However, if I revert back to my computer and go to http://site1.amazon-aws-url.com (amazon-aws-url in place of my actual aws url), I get a Server not found error. Obviously I'm missing some sort of config somewhere, but I don't know what. Any suggestions? Cheers Pete
  7. aah yes, so it was including the PHP because I was targeting the file in relation to the file that was reading it. Cheers for that, works a charm.
  8. Hi Guys, I need a bit of help. Here's my scenario. I have a page with content populated with PHP (i.e. dragged from a DB and echo'd). I have another page (on the same server), with this page, I need to drag in the first place and extract the contents of a certain div (i.e. #main_content). The problem is, if I use file_get_contents() and print the result out, i get the php in it, as oppose to the actual output. So, if I have say: echo $page->main_content; I get that in the string that's returned by using file_get_contents(). The whole purpose of this is for a site indexing system whereby a cronjob runs a script that grabs the content from certain parts of select pages at set intervals and stores it in a table. If anybody can point me in the right direction, would be much appreciated. Cheers Pete
  9. <?php if(strpos($_POST['email'], ';')) { // break string into array by semicolons $arr = explode(';', $_POST['email']); // loop through the array of emails foreach($arr as $email) { // remove any spaces in the email address (if the user has used ; followed by a space to separate emails) $email = trim($email); // insert $email into database } } else { // normal insert functions for singular emails } ?>
  10. Hi guys / girls, Ok, I have a slight problem with mod rewrite. My current URLs are as follows: http://whatever.com/profile/?username=someuser I need it to be: http://whatever.com/profile/someuser I've not spent much time at all working with mod-rewrite, can anybody help? I've got this so far but all I get is a 404. RewriteEngine on RewriteCond %{REQUEST_URI} !^/profile/ [NC] RewriteRule ^([^/\.]+)/?$ /profile/index.php?id=$1 [L] Cheers Pete
  11. Or even.... <?php $old_date = '01/21/2009'; // or date('m/d/y') or whatever $new_date = date('Y-m-d', strtotime($old_date)); ?> ** edit ** aah that's pretty much what roopurt18 said, whoops :-P
  12. Hi Fiona, No worries. CURL is a free PHP library that is usually installed in most configurations of PHP. Basically, a CURL request is where PHP sends a request (and parameters) to a script on an external site, without the user leaving your site. The receiving script will then take the parameters you have passed to it and return a value, object, array, xml string whatever. The best analogy I can think of is say when you use an online store. You have browsed the store and added some items to your basket. You then go to the checkout page and choose to pay with your credit or debit card. You enter your credit and debit card details and the the money is deducted from your account. However, your average e-commerce site doesn't have the facility to manually pull money out of your account, that is what a payment provider is for such as Protx/SagePay. When you have entered your credit card details, the code on the shop you are purchasing takes the data you gave it and (usually) performs a curl request. It sends that data to a script hosted on the Protx/SagePay server. The service on that server then attempts to withdraw the funds and returns data stating whether the transaction was honored or not. But you don't know it does that because the browser doesn't leave the shop. So yeah, basically, it's a way of posting information to a script on another site to receive a response without the user knowingly leaving the site they where originally on. A code example would be something like: <?php $request = 'your XML here'; $ch = curl_init('https://crm-server.com/processing-script.php'); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $response = curl_exec($ch); ?> For more information take a look at: http://uk3.php.net/curl Cheers Pete
  13. Hi Fiona, A cron job would be a good way of doing things, however you need to produce a file or string that can be sent to the CRM server that the CRM system can read. It might be worth checking out the CRM system (if it is a white label product) to see if it has some form of API whereby you can use the cron job to run perhaps a CURL request posting an XML report of that days transactions to the CRM. Another (and by no means perfect) solution would be to (assuming that the CRM has an API) write a CURL request (or even AJAX and JSON) that, every time a transaction is made, it posts the transaction information to the CRM server, although this will most likely be quite slow and will slow down your users experience. Finally, if the CRM solution your client has is hosted on a server you have access to and you are comfortable with it, you could always write some code to accept requests from an external source and process them and then write something into your application that utilises this facility on the CRM system. I hope this has helped :-) Thanks Pete
  14. Hi Ashish, Firstly, if you are including the file (as you would with class files), you want to be using either include, include_once, require, or require_once (depending on your needs regarding file references). For class files, I always use require_once. Also, you are forming a class constructor the PHP4 OO way. Assuming the server you are running your PHP on has PHP5 installed, you want to use __construct as oppose to naming a method the same name as the class to run a constructor function. so, in your view file, you want to put: <?php require_once('path-to-file.php'); ?> In the class, you want to use: <?php class config { public $db_engine = 'mysql'; public $db_username = 'root'; public $db_password = ''; function __construct() { // Database related configurations $this->db_engine = 'mysql'; $this->db_username = 'root'; $this->db_password = ''; } } ?> Cheers Ironhamster88
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.