I have NOT done much of web-developing and I would like to learn about it: how you can create https-connections. I am currently using apache with mysql/php as software development tools.
Are the connections/ports to be used always configured from the server or do you need some scripts for it in php? and do you need to do anything else in MySQL except enable: have_ssl ?
The tutorials that I have managed to find were a bit confusing about everything and not very thorough, So I was hoping that someone here might be so kind and explain the stuff briefly or maybe give me a link to some good tutorial.
If somebody could give me a link to some "easy to read" tutorial or briefly explain how the system works.
Thank you!
You should use Apache-SSL , OR mod_ssl with-in Apache Sever
I suggest to use mod_ssl
if your are new to developing php/mysql try to use XAMPP of WAMP instead of installing apache and configuring mod_ssl manually you can easily active mod_ssl in both of them if you want to do it manually
http://tud.at/programm/apache-ssl-win32-howto.php3
if you want redirect a certain path to use https instead of http ,
for example
http ://yoursite.com/secure/ to https ://yoursite.com/secure/
Modify htaccess file and add this
RewriteRule "^(/secure/.*)" "https://%{HTTP_HOST}$1" [R=301,L]
SSL would be entirely handled by the webserver. The only thing you might do with PHP is make sure that your application is being accessed in SSL by checking if $_SERVER['HTTPS'] is set.
SSL connections to MySQL are generally not needed in a secure environment. It will add overhead to your connections that you may want to avoid.
Search for "How to configure SSL in Apache" and you will find quite a few tutorials on the subject.
Related
I just fixed a problem but do not exactly understand why the solution works.
Setting:
Windows 10
Laravel 7.0
PHP built in server (via php artisan serve --port=80)
Hosts file with entry 127.0.0.1 something.local
Problem:
Making a web page request to http://something.local in the browser took very long to load. Upon inspection in chrome dev tools I found out that it is not the server but the actual content download.
Although we are talking about ~7MB to download a download time of >10sec seemed insane to me.
Solution that I do not really understand :
Changing the hosts file entry to 127.0.0.1 something.habibi fixed it for me.
Why does it take so long to download a web page if I use an entry ending in .local in my hosts file?
Thoughts:
.local is not a top level domain but a special-use domain. It seems to me that because of this the request to a url ending in .local might not stay on my machine but goes through my wlan/router somehow and thus takes longer.
But this is as far as I got. It would be nice if someone can make better sense of this behaviour.
Unfortunately I can not make the special behavior of a special-use domain any clearer to you as this is not my forte at all.
But:
Do you - by any chance - have a chrome extension called "Xdebug helper" installed?
If this chrome extension would be the actual cause of your problem than your solution makes sense: changing the url in the browser has the effect that the Xdebug helper extension does not debug this new url you just put in.
Therefore you might think that your problem is caused by the different ending (switching from ".local" to ".habibi") but in reality it is just this chrome extension that gets disabled for the new url.
So long story short: your question is not reproducible and thus can't really be answered.
By the way: Others seem to have the same problem.
I I am trying to convert php links with variables to html link (like on SMF) so increase seo of my site,
My links are like:
http://site.com/pages/page1.php?v1=var1&v2=var2&v3=var3&v4=var4
or:
http://site.com/pages/?v1=var1&v2=var2&v3=var3&v4=var4
I need it to look like this:
http://site.com/pages/page1.var1.var2.var3.var4.html
or
http://site.com/pages/var1.var2.var3.var4.html
or
http://site.com/page.php/var1,var2.var3.var4.html
linke in SMF forums:
http://forum.com/index.php/topic,9197.0.html
How to do that and alos be able to GET those variable values?
You just need to learn how to implement URL rewriting. I know PHP runs on Windows in IIS, but I'm going to go ahead and assume you are probably running Apache. Just read up on redirecting with .htaccess files and mod_rewrite. There's also something similar (that, alas, you have to pay for) called ISAPI Rewrite for windows servers which I've used plenty of times. And if you don't want to use a third party plugin and you have server 2008, the wizards for IIS do a pretty decent job and they just modify your web.config file directly to do the redirects.
you might want to try to research about URL encoding that's what i know if you like to change how your links display the url... hope my answer is enough :)
http://www.jaywebtechnologies.co.cc
I see that your issue is already solved (for Linux).
If anyone has the same problem with a Windows Server, you can use Ionics ISAPI Rewrite Filter
http://iirf.codeplex.com/
I've been using it for years now, and it works perfectly. Just wanted to post it here in case anybody needs it.
I have couple of websites on php. I want to mobile enable them so they can be seen from a smart phone or iphone. Is there any quick conversion tools for these.
I tried the steps in this site and got a 500 exception from hostgator.
http://www.mikeindustries.com/blog/archive/2005/07/make-your-site-mobile-friendly
I am looking for some rad techniques. my sites are not complex.
for eg. yndc.tradepeacefully.com
From hostgator support :
http://support.hostgator.com/articles/hosting-guide/hardware-software/is-php-running-as-apache-or-cgi
Now check the notes on the link you posted, especially note 3 :
In order to use auto prepending and
auto appending, you must be running
PHP as a standard Apache module and
not “as cgi”. If need be, you can run
PHP as Apache sometimes and CGI other
times by using your .htaccess file to
specify rules.
So this approach won't work on Hostgator (unless you're on dedicated hosting, see the support page), since they're running PHP as CGI...
To mobile-enable your site, you just need two things:
Detect the browser's user agent.
Forward to a mobile version of the site.
You should be able to find a htaccess file on Google that will accomplish the #1. The hard part is going to be coming up with a new layout for your site that is mobile-friendly.
That part will be mostly written from scratch.
You get the 500 error probably because your hosting provider does not support the php_value in .htaccess files.
I would like to be able to port some new site pages over to PHP using the same db as in the coldfusion site. Is it possible to have PHP run pages in say other directory and go back and forth ?
Many thanks for your reply.
Terry
As others have said, yes, it is possible. Your configuration doesn't really matter, (unless you're looking for help getting it setup), because it can be done on any modern webserver (Apache, IIS, etc).
Something to think about, though, is the default document. If your web application uses urls like:
http://example.com/myApp/ (no index.cfm or index.php in the url)
Then you need to be aware of the explicit order of default documents. If you have both an index.php and an index.cfm template in the same directory, which will execute?
If your default document list is (a variation of):
index.cfm index.php default.aspx index.html
Then the ColdFusion page will be the one to execute. On the other hand, if the default document list is (a variation of):
index.php index.cfm default.aspx index.html
Then the PHP page will be the one to execute.
Yes, this is possible, I have this available on my production web server (RedHat but it shouldn't matter). If you're looking for details on configuration I couldn't help you though, I had my host set it up. I wouldn't imagine a standard install of both would conflict, just set up the proper handling for each file extension and you should be good to go, keeping them in separate directories or mixing them in one.
It is possible as long as you are running the same web server (i.e. IIS or Apache) for both ColdFusion and PHP. If you let us know what your environment is, people may be able to further assist you - but the answer to your question is yes.
Yes,
It's technically no different to Windows servers which have both PHP and .Net installed, or a Linux server with Perl and PHP.
Speaking generally, after installing the languages you're using you set up your web server to handle files of different extensions. This is done differently depending on whether you're using IIS or Apache, but you effectively say .php files should be handled by the PHP interpreter and .cfm files handled by the Coldfusion interpreter.
As others have said, its entirely possible and not hard to setup. Just watch out for Default Document as Adam Tuttle said.
I will take it a step further: you even run CF and PHP in the same application server!
Use Cauchos Resin for CF and its Quercus support for PHP:
http://quercus.caucho.com/
Of course, if your PHP app is non-trivial and/or relies on some custom extensions or extensions that Quercus doesnt support than your SOL. But might be interesting to check out.
We have a hosted site that has a CMS we built running on a LAMP stack. We noticed that when you save HTML that has a tag embedded in the HTML the request immediately dies. This does not occur on the staging or local development instances of the CMS, so I'm assuming its a server configuration issue. Any ideas what might cause this behavior?
I've looked through the PHP.INI and apache confige files but nothing stood out as a possible culprit.
UPDATE
I've filed a ticket with the host that runs our VPS, so far they haven't been helpful. As someone suggested I checked the apache logs to see if there were any problems. The only error I'm seeing is "Directory index forbidden by Options directive". That error seems to be happening independent of the form submit timing out.
We built the CMS using CakePHP and the CakePHP logs reveal no other useful information either. The request isn't making it to PHP at all as we put a die() call in the root index.php page and it still times out.
UPDATE2
Thanks for the suggestions. I'm confident that this will be resolved but figured it was worth taking it here first.
UPDATE3
MediaTemple was able to replicate the issue and said it was a Top Level Filtering Rule that was causing the issue, surely something out of my realm of control. All the same I appreciate the responses :)
I've had similar problems caused by apaches mod_security. If you have mod_security enabled on the server, you can try something like this (in a .htaccess file):
<IfModule mod_security.c>
SecFilterEngine Off
</IfModule>
Since you have system where this error does not appear it is a configuration error.
Find the difference between the failing and the other systems.
If you have too many files to compare. Start reducing the complexity of the system as far as possible.
Are you using an application-firewall? Sounds like some sort of security-programm just killing the request.