Jump to content

How to change the port server


Recommended Posts

It's not a probleme of database;

 

I have installed Prestashop on my personal computer (http://localhost:80/index.php).

 

Now i want to access on my local prestashop by http://my.ddns.net:8080/index.php from the extern

  I have create a dynamic dns...

  I have create the NAT rules on my "router" (in realitity a FreeBox, LiveBox, AOLBox,...)  my.ddns.net:8080 -> localhost:80

  firwall are off

 

------------

 

I have found a occurence of : _PS_SSL_PORT_ but no _PS_HTTP_PORT

 

 

I have replaced index.php of prestashop by my helloWorld index.php and it's works. So it's prestashop make me crazy.

 

I have added the port information in ps_configuration.PS_SHOP_DOMAIN like : my.ddns.net:8080 but faille

Edited by LuzoWeb (see edit history)
Link to comment
Share on other sites

If you don't configure an IP for to have external access, you cannot access your shop. To configure DNS zones is not an easy thing without knowledge.

 

http://en.wikipedia.org/wiki/DNS_zone

 

You should open on your router an IP to have access from outside, than you can access the IP. An access as URL is not possible in this case without DNS and DNS zone configured.

 

Port 8080 is not a simply port, but mainly ports for proxy-servers. You configured a proxy-server ? Which tutorials did you follow ?

 

For to configure a local DynDNS you should follow the tutorials of your router. With FirtzBox it is quite easy for ex. cause this option is already on board.

Edited by selectshop.at (see edit history)
Link to comment
Share on other sites

Thank you for you help.

 

The probleme come from : www\prestashop_1.5.6.2\classes\shop\Shop.php in function initialize() near line 410...

header('location: '.$url);

give me : "Location: http://my.ddns.net/index.php?"

 

I need to refactor the prestashop code, and use : $_SERVER['HTTP_HOST'] => string 'my.ddns.net:8080'

Not really, Why you don't use a free DynDNS service ? It is quite easy to configure.

Link to comment
Share on other sites

I do not have fallow tutorial. I have right configured server & proxy. Because i have created an html test file at the root of my server(vhost) and i can see it.

 

But when a acces index.php of prestashop, the classes/shop/shop.php redirect me without the port information because i'am not in 'www' subdomain (PrestaShop is it racist ; )

Link to comment
Share on other sites

I do not have fallow tutorial. I have right configured server & proxy. Because i have created an html test file at the root of my server(vhost) and i can see it.

 

But when a acces index.php of prestashop, the classes/shop/shop.php redirect me without the port information because i'am not in 'www' subdomain (PrestaShop is it racist ; )

Sorry, but in fact I don't understand what exactly you have configured ? You have a server machine ? This machine is a proxy on which is installed Linux ? Now yre you trying to connect this machine to the net ? If yes, the machine also has a DNS and DNS Zone configured like any other server or not ? If not, the only possibility to access to the net is through an IP and DynDNS service.

  • Like 1
Link to comment
Share on other sites

You are right:

the only possibility to access to the net is through an IP and DynDNS service.

 
Let me resume.
 
I'am at home with a Personal computer (PC windows 7 with easyPHP and prestashop 1.5.6.2 installed and running)
Prestashop work in localhost.
 
Now, I want visitors on my prestashop website hosted on my PC windows7. So i create a Dyn DNS/No-IP service, vhost, etc... : Congratulation: My website are now online :D

But when I GET index.php, prestashop redirect me without the port informaion.
For me, it's a bug of Prestashop because he don't have to care about DNS... even for internationalisation...

 

Link to comment
Share on other sites

 

But when I GET index.php, prestashop redirect me without the port informaion.

For me, it's a bug of Prestashop because he don't have to care about DNS... even for internationalisation...

 

 

No not a bug, cause is missing the DNS(nameserver and the zone). Ports are directed to protocols, protocols to zones. If you don't add a nameserver to a specific IP (and port) you will be unable to access any database. You can access your "congratulations" site, cause this is a simple html site without any functions. For to access database (this is the reason why I told you to set localhost:8080) you need more than only what you have. The nameserver must be accessible and for this you must configurate it and route it to an IP, like any other "server" on the web. To configure a server you should have some knowledge of servers and network configuration, It is not an easy 5 minutes job.

 

The only possibility and easy way is through your router and a DynDNS service, but your router must have this service included. I don't suggest you to route a router. It is not an easy thing and you should have special knowledge (it is like to crack your mobile OS)

Link to comment
Share on other sites

I don't understand why you speak me of Database, or router... I have just explaned my situation ...
access database is All Correct
 

I have removed the port information from getHttpHost()

$host = pSQL(Tools::getHttpHost());// == 'my.ddns.net:8080'
$pos = strrpos($host, ':');// not good algorithme => user:[email protected]
if ($pos!==false)
$host = substr($host, 0, $pos);// == 'my.ddns.net'
Then i can find the id_shop ... in initialize() and continue the script without redirection.
 
But prestashop still redirect me a little further... in atother function...
 
 
Edited by LuzoWeb (see edit history)
Link to comment
Share on other sites

I think the same result you had by adding to tab "Preferences -> seo & URLS" to www and SSL nothing (blank field) or "localhost" cause this has a neutral behaviour and by flushing the server cache and IP tables cache of your router you got connection. Prestashop does not force any port, by using port standards 80 and port 21 for FTP. The problem was setting manually to your database directions which you were forcing somewhere in your configuration (nameserver or IP routing table on your router. Port 8080 is not really necessary) ;) .

 

But I'm glad you solved your problem by yourself.

Link to comment
Share on other sites

×
×
  • Create New...