Localhost redirect to different project folder - prestashop

I am working in a prestashop project.
Operating System: Linux Mint 19.1
CMS: prestashop
The problem came today, when I cloned my production site to my local machine.
It was not the first time I cloned this project. Actually, I have in:
/var/www/html
different directories:
pre_prestashop pre_magento etc
Now as I said, I copied from production real live website, to local machine in a new directory within /var/www/html
I called it:
dev_prestashop
Everything was perfect, and I can see when I type localhost in my browser every project/directory:
pre_prestashop
pres_magento and
=> dev_prestashop
The fact is, when I try to access locahost/dev_prestashop it makes a redirect to my old directory localhost/pre_prestashop (pre_prestashop works and local site is OK, but it is my OLD local site and not dev_prestashop).
I've been googling but none is experiencing this issue.
I check my /etc/apache2/sites-available and see:
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www/html
ServerName localhost
ServerAlias pre_calleja
ServerAlias dev_prestashop
<Directory /var/www/html/>
Options +FollowSymlinks
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I verified every single filed in database, and deleted .htaccess file from root directory in dev_prestashop...
I can't understand what is happening.
Actually, If I comment pre_prestashop to _pre_prestashop and change dev_prestashop to pre_prestashop, everything works perfectly, so problems is not in dev_prestashop.
I would apreciate very much help to understand this problem, more than solve it because now I am working in renamed folder.
Thanks.

Related

VirtualBox Ubuntu 16.04 apache2 vhost jumping to https or not showing the page

I am trying to set up some vhosts on a Virtual Box with Ubuntu 16.04 Apache2 PHP 7.0 to start moving the code to PHP7.
I have moved the v-host file from the older VBox which looked like this
<VirtualHost 192.168.2.174:80>
ServerName admin.ubuntu16.de
ServerAlias admin.ubuntu16.de
ServerAdmin email#company.de
DocumentRoot /home/www/public_html/workspace/admin
php_value auto_prepend_file '/home/www/public_html/workspace/admin/administration/conf/register_globals.php'
<Directory /home/www/public_html/workspace/admin>
Options Indexes FollowSymLinks MultiViews ExecCGI
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
But it kept on trying to load the page with https or saying that there is no access to site root folder
These settings work perfectly on Ubuntu 14 Virtuall Box with apache2 and PHP 5.5.something
So I followed the tutorial and changed it to simply
<VirtualHost 192.168.2.174:80>
ServerName admin.ubuntu16.de
ServerAlias admin.ubuntu16.de
ServerAdmin email#company.de
DocumentRoot /home/www/public_html/workspace/admin
</VirtualHost>
But now it just jumps straight to https mode
I obviously ran a2ensite
I also switched off the default site by running "a2dissite 000-default.conf"
I also enable modules to do with proxying and a bunch of others while getting appache to actuallly start :-)
Any ideas on things I might off missed are greatly appreciated.
Just a little edit:
All the files for the sites are situated on the main Windows machine and are imported through /media/sf-workspace
The symbolic link is then created as /home/www/public_html/workspace
I would first eliminate the symbolic links and just make a copy of all the files inside the virtual box to remove that variable.
Apache can be screwy with symlinks.

vhosts dont appear to be working on OS X Mavericks Apache installation

I am trying to set up the Apache server which comes with OS X Mavericks with vhosts so that a domain name resolves to my user level document webroot. I have followed this tutorial which guided me through setting up the apache server with php:
http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-9-mavericks/
as well as this one which guided me through setting up the vhosts:
http://coolestguidesontheplanet.com/set-virtual-hosts-apache-mac-osx-10-9-mavericks-osx-10-8-mountain-lion/
Following these tutorials, if I type localhost in my browser it correctly resolves to the system level root (/Library/WebServer/Documents/ folder). If I use localhost/~myusername it correctly resolves to my user level root (/users/myusername/Sites/).
However, whenever I navigate to my domain, I get redirected to the system level root rather than my user level root.
My vhosts file reads as follows:
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Library/WebServer/Documents/
</VirtualHost>
<VirtualHost *:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
DocumentRoot "/Users/myusername/Sites/mydomain"
<Directory "/Users/myusername/Sites/mydomain">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Any ideas?
Have you enabled Virtualhosts?
NameVirtualHost *:80
And included your vhosts directory
Include <path>/vhosts/*
On a Macbook, you may need to include /private/ at the beginning of any absolute path, so that Apache can read it correctly off the file system.
For others who have the same problem...
It was frustratingly simple - I had missed the "" around the localhost directory.
How annoying!
Try starting apache manually with the -S option to see what the problem might be:
/usr/sbin/httpd -S

'httpd-vhost.conf' breaks Wamp?

This is my first post...
I am attempting to host a development website from my laptop using Wamp; my goal is to install Wordpress and have users log in from there homes...
I've successfully installed Wamp 2.2.
I've included 27.0.0.1 localhost in my 'host' file.
I've removed the # from the front of Include conf/extra/httpd-vhosts.conf.
localhost works perfectly until I edit my 'httpd-vhost.conf' file to include the following...
<VirtualHost *:80>
SeverAdmin webmaster#localhost
ServerName localhost
DocumentRoot C:/Program Files/WampServer2/www
ErrorLog "C:/Program Files/WampServer2/www/logs/error.log"
CustomLog "C:/Program Files/WampServer2/www/logs/access.log" common
</VirtualHost>
Once I restart Wamp the icon stays orange. If I attempt to put Wamp online, an alert titled 'Aestan Tray Menu' stating "Could not execute menu item (internal error). [Exception] Could not preform service action: the service has not been started".
Port 80 tested as "not actually used".
When I run 'httpd.exe' a command window opens then immediately closes before I can read it. I've tried various formats to <VirtualHost *:80> with no avail, however once I comment out my changes I am able to successfully restart Wamp and access localhost.
I haven't been able to find post about this problem anywhere! Thanks!
I am not sure this is so complex. I know the original post is very old but just for those with a similar issue since I had it this morning.
To see the error, you run httpd.exe from within the command prompt. Just open a command prompt and then cd into the folder that contains httpd.exe, then type httpd.exe (i.e. don't just double click it from within the folder).
The result should tell you where the error lies. In my case, it was a syntax error inside the vhosts file.
I suspect your problem is the unquoted DocumentRoot with a space in it. Try:
<VirtualHost *:80>
SeverAdmin webmaster#localhost
ServerName localhost
DocumentRoot "C:/Program Files/WampServer2/www" # <- quotes added around this line
ErrorLog "C:/Program Files/WampServer2/www/logs/error.log"
CustomLog "C:/Program Files/WampServer2/www/logs/access.log" common
</VirtualHost>

Apache: 3 virtual hosts working perfectly, 1 is not, but settings seem to be the same (Mac)

(OSX Leopard 10.5.8)
I've been using virtual hosts with no problems until now, when I tried to make a new block of code for the next one. The offender is called project1.
I've got an index.php sitting in the project1/html/ folder, just like all the others. But every time I try to go to http://project1/ in the browser I get a 404.
Here's the contents of httpd-vhosts.conf:
<VirtualHost *:80>
ServerName localhost
DocumentRoot "/Users/sebu/_SERVER/"
</VirtualHost>
<VirtualHost *:80>
ServerName skeleton
DocumentRoot "/Users/sebu/_SERVER/skeleton/public_html/"
</VirtualHost>
<VirtualHost *:80>
ServerName pickle
DocumentRoot "/Users/sebu/_SERVER/pickle/"
</VirtualHost>
<VirtualHost *:80>
ServerName project1
DocumentRoot "/Users/sebu/_SERVER/project1/html/"
</VirtualHost>
Here's what I've checked already:
I restarted Apache (every time I change something).
I tried clearing the browser cache.
I tried rebooting.
I made sure the file permissions are exactly the same as the other working vhosts (dirs and files).
I've got the line Options Indexes +FollowSymLinks -MultiViews in httpd.conf (turning Multiviews off was the solution to an earlier problem).
I ran httpd -S to check the syntax and it said everything was OK.
I tried pinging project1 just to check and sure enough it says cannot resolve project1: Unknown host
(Not sure if it's worth mentioning, but when I did a ls -la in _SERVER/ I noticed that project1/ had permissions written as drwxr-xr-x# with the # on the end. I read that this meant it was a quarantined file and would wait for me to open it so I ran open project1/ and it went away.)
do you have an entry in /etc/hosts for skeleton, pickle, but not project1? If so, add an entry for project1 and that should resolve your issue.

Magento not accessible since tried to move to multi website setup. Apache issue?

I wish I had never seen this article:
http://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup
I have Apache 2.2 installed on my XP machine and until a while ago I had a Magento site that I could test the development of a custom module on. I decided that I wanted to have multiple websites and multiple stores so that I could test that my modules configuration variables set at the different scopes (global, website, and store) were working as expected.
So I followed the instructions in the above Magento article. I created a website and gave it a name of “paulsplace.com”. I created a couple of Stores under that website. I then went to System/Configuration/General/Web and, with the scope set to paulsplace.com, I set the unsecured and secured URLs to http://paulsplace.com/ and https://paulsplace.com/ and hit Save Config - what a mistake!!
I got a 404 error. And now I can’t get to my magento front end or back end.
I tried a couple of things:
I added these lines to my hosts lookup file:
127.0.0.1 paulsplace.com
127.0.0.1 www.paulsplace.com
I then uncommented this line in my httpd,conf file:
Include conf/extra/httpd-hosts.conf
and added the following to the conf/extra/httpd-hosts.conf file:
<VirtualHost *:80>
ServerAdmin me#myemail.com
DocumentRoot "C:/Applications/Apache Software Foundation/Apache2.2/htdocs"
ServerName paulsplace.com
ErrorLog "logs/paulsplace.com-error.log"
CustomLog "logs/paulsplace.com-access.log" common
</VirtualHost>
and restarted Apache.
If I browse to “http://www.paulsplace.com” I now get a page that just says “It works!”. Same for “http://paulsplace.com” and “http://www.paulsplace.com/magento/index.php”.
I tried a few more things - I added this line to httpd.conf:
AccessFileName htaccess
(I did this because Windows Explorer didn’t let me create a file starting with a dot; I could do it from the command prompt, but I believe what I have done should be ok).
I changed AllowOverride to All from None:
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
<Directory "C:/Applications/Apache Software Foundation/Apache2.2/htdocs">
AllowOverride All
</Directory>
and in C:\Applications\Apache Software Foundation\Apache2.2\htdocs\htaccess (a file that I created), I entered:
SetEnvIf Host www\.paulsplace\.com MAGE_RUN_CODE=pws1
SetEnvIf Host www\.paulsplace\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^paulsplace\.com MAGE_RUN_CODE=pws1
SetEnvIf Host ^paulsplace\.com MAGE_RUN_TYPE=website
(pws was the value I used for the “Code” when creating my store).
Please tell me how I can put this right. I feel like I’m taking one step forward and three backward at the moment.
Any help really would be greatly appreciated.
<VirtualHost *:80>
ServerAdmin me#myemail.com
DocumentRoot "Change this to point at your magento install"
ServerName paulsplace.com
ErrorLog "logs/paulsplace.com-error.log"
CustomLog "logs/paulsplace.com-access.log" common
SetEnv MAGE_RUN_TYPE website
SetEnv MAGE_RUN_CODE pws1
</VirtualHost>
If changing anything in System Configuration borks your system, you can always clear out the bad values in the database directly, and clear your Magento cache. Do a
select * from core_config_data where value LIKE '%paulsplace.com%'
This will give you the two rows that were added when you clicked save. Remove the rows. Next, clear out all the files in
var/cache/*
to clear your cache. Then restore your Apache config to what it was before you started monkeying around. This should restore your site back to its previous state, and you can continue to experiment with things.