Jump to content

Prestashop 1.5.0.13 keeps on redirecting to old servername despite updating apache successfully


Recommended Posts

Hi, I followed http://www.foscode.com/apache-virtual-host-ubuntu/ and combined it with some others. I run Ubuntu 12.04 on a EC2 server.

 

My apache is pointing to /var/www subdivided in

/var/www/site1

/var/www/site2 -> my prestashop install 1.5.0.13

/var/www/site3 -> php my admin

/var/www/site4 -> Amazon MWS

 

In the end I have a more easy setup:

my /etc/apache2/sites-available/default

<VirtualHost *:80>
   ServerAdmin webmaster@localhost

   DocumentRoot /var/www
   <Directory />
       Options FollowSymLinks
       AllowOverride None
   </Directory>
   <Directory /var/www>
       Options FollowSymLinks MultiViews
       AllowOverride None
       DirectoryIndex index.php index.html
       Order allow,deny
       allow from all
   </Directory>

   ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
   <Directory "/usr/lib/cgi-bin">
       AllowOverride None
       Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
       Order allow,deny
       Allow from all
   </Directory>

   ErrorLog ${APACHE_LOG_DIR}/error.log

   # Possible values include: debug, info, notice, warn, error, crit,
   # alert, emerg.
   LogLevel warn

   CustomLog ${APACHE_LOG_DIR}/access.log combined

   Alias /doc/ "/usr/share/doc/"
   <Directory "/usr/share/doc/">
    Options MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
   </Directory>

</VirtualHost>

<VirtualHost *:81>
   ServerAdmin webmaster@localhost

   DocumentRoot /var/www/site1
   <Directory />
       Options FollowSymLinks
       AllowOverride None
   </Directory>
   <Directory /var/www/site1>
       Options FollowSymLinks MultiViews
       AllowOverride None
       DirectoryIndex index.php index.html
       Order allow,deny
       allow from all
   </Directory>

   ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
   <Directory "/usr/lib/cgi-bin">
       AllowOverride None
       Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
       Order allow,deny
       Allow from all
   </Directory>

   ErrorLog ${APACHE_LOG_DIR}/error.log

   # Possible values include: debug, info, notice, warn, error, crit,
   # alert, emerg.
   LogLevel warn

   CustomLog ${APACHE_LOG_DIR}/access.log combined

   Alias /doc/ "/usr/share/doc/"
   <Directory "/usr/share/doc/">
    Options MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
   </Directory>

</VirtualHost>

<VirtualHost *:82>
   ServerAdmin webmaster@localhost
   DocumentRoot /var/www/site2
   <Directory />
       Options FollowSymLinks
       AllowOverride All
   </Directory>
   <Directory /var/www/site2>
       Options FollowSymLinks MultiViews
       AllowOverride All
       Order allow,deny
       allow from all
   </Directory>
   ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
   <Directory "/usr/lib/cgi-bin">
       AllowOverride None
       Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
       Order allow,deny
       Allow from all
   </Directory>
   ErrorLog ${APACHE_LOG_DIR}/error.log
   # Possible values include: debug, info, notice, warn, error,
   # crit, alert, emerg.
   LogLevel warn
   CustomLog ${APACHE_LOG_DIR}/access.log combined
   Alias /doc/ "/usr/share/doc/"
   <Directory "/usr/share/doc/">
    Options MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
   </Directory>
</VirtualHost>

<VirtualHost *:83>
   ServerAdmin webmaster@localhost
   DocumentRoot /var/www/site3
   <Directory />
       Options FollowSymLinks
       AllowOverride None
   </Directory>
   <Directory /var/www/site3>
       Options FollowSymLinks MultiViews
       AllowOverride None
       Order allow,deny
       allow from all
   </Directory>
   ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
   <Directory "/usr/lib/cgi-bin">
       AllowOverride None
       Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
       Order allow,deny
       Allow from all
   </Directory>
   ErrorLog ${APACHE_LOG_DIR}/error.log
   # Possible values include: debug, info, notice, warn, error,
   # crit, alert, emerg.
   LogLevel warn
   CustomLog ${APACHE_LOG_DIR}/access.log combined
   Alias /doc/ "/usr/share/doc/"
   <Directory "/usr/share/doc/">
    Options MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
   </Directory>
</VirtualHost>

<VirtualHost *:84>
   ServerAdmin webmaster@localhost
   DocumentRoot /var/www/site4
   <Directory />
       Options FollowSymLinks
       AllowOverride None
   </Directory>
   <Directory /var/www/site4>
       Options FollowSymLinks MultiViews
       AllowOverride None
       Order allow,deny
       allow from all
   </Directory>
   ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
   <Directory "/usr/lib/cgi-bin">
       AllowOverride None
       Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
       Order allow,deny
       Allow from all
   </Directory>
   ErrorLog ${APACHE_LOG_DIR}/error.log
   # Possible values include: debug, info, notice, warn, error,
   # crit, alert, emerg.
   LogLevel warn
   CustomLog ${APACHE_LOG_DIR}/access.log combined
   Alias /doc/ "/usr/share/doc/"
   <Directory "/usr/share/doc/">
    Options MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
   </Directory>
</VirtualHost>

 

then tried sudo a2ensite default

answer: site default already enabled

 

then sudo service apache2 restart

 

-> It was working like this without problem while using

ec2-54-247-22-255.eu-west-1.compute.amazonaws.com

ec2-54-247-22-255.eu-west-1.compute.amazonaws.com:81

ec2-54-247-22-255.eu-west-1.compute.amazonaws.com:82

ec2-54-247-22-255.eu-west-1.compute.amazonaws.com:83, or

ec2-54-247-22-255.eu-west-1.compute.amazonaws.com:84

 

Then I tried to get a elastic IP and here the PROBLEMS started:

even if 54.247.120.173 (on port 80) is working and showing the index.php located in /var/www/

54.247.120.173:81 brings me to a 403 Forbidden page and I cannot figure out why?

54.247.120.173:82 brings me to http://ec2-54-247-22-255.eu-west-1.compute.amazonaws.com:82/index.php? and times out...

 

Again, I cannot figure out why!!

 

54.247.120.173:83 is working

 

54.247.120.173:84 is working too!!

 

Ok, then to access my site2 folder, I thought about renaming it to site 4 as 54.247.120.173:84 is working. But here again, it doesn't fix nothing:

54.247.120.173:84 would then redirect to http://ec2-54-247-22-255.eu-west-1.compute.amazonaws.com:82/index.php?

 

It seems obvious that "http://ec2-54-247-22-255.eu-west-1.compute.amazonaws.com:82/index.php?" is stored in a file of the prestashop install.

What can be the issue? I'm guessing...

1. .htaccess file to be biased in site2 folder -> I checked but cannot see any reference to http://ec2-54-247-22-255.eu-west-1.compute.amazonaws.com:82/index.php?

 

2. index.php itself -> I checked /config/config.inc but couldn't find any occurence of "ec2". Where could the redirection be located?

Link to comment
Share on other sites

I tried:

grep "*ec2*" /var/www/site2/* -R

 

which didn't show nothing. I'm not extra familiar with grep, if you have an idea in order for me to confirm that none of the files under /var/www/site2 (my prestashop directory) contain the string "http://ec2-54-247-22-255.eu-west-1.compute.amazonaws.com:82/index.php?"

 

I'm sure prestashop does this redirection on its side...

Link to comment
Share on other sites

I tried grep "ec2-54-247" /var/www/site2/* -R > /var/www/grep.txt

(see grep.txt)

 

Then I deleted all cache files in the cache directories

/var/www/site2/cache/smarty/cache

/var/www/site2/themes/default/cache

 

Now grep "ec2-54-247" /var/www/site2/* -R > /var/www/grep2.txt outputs an empty file :)

 

I cleared my cache on the browser...

 

And it is still redirecting my elastic IP 54.247.120.173 to http://ec2-54-247-22-255.eu-west-1.compute.amazonaws.com:82/index.php?

 

Where can it come from?

Link to comment
Share on other sites

Nobody?

 

I tried to find it again on my side:

I discovered that not only prestashop 1.5 was impacted but also my MySQL install.

 

I did a separate install of prestashop in a fresh folder and did the same for mySQL and they are working. I kept th impacted prestashop install in order to understand what happened...

Link to comment
Share on other sites

×
×
  • Create New...