I was finally able to duplicate my Magento store and now i'm able to develop in/with git.
The Copy is stored in /var/www.dev
So i thought i duplicate my apache/site-available/shop to dev.shop in the same folder, change the configuration from ServerName shop.com to dev.shop.com and that should be enought.
Unfortunatly all my requests for dev.shop.com become redirected to shop.com, and i can't figure out why.
Logs say it is a 302 redirect. So it cant be a Javascript, and since it is before the php stuff will run it has to be the apache Server.
Here is some config.
/etc/apache2/sites-available/shop.com
<VirtualHost *:80>
ServerAdmin it@shop.com
ServerName www.shop.com
ServerAlias shop.com
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Allow,Deny
</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 Indexes 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 *:443>
ServerAdmin it@shop.com
ServerName www.shop.com
ServerAlias shop.com
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/shop.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/shop.com.key
SSLCACertificateFile /etc/apache2/ssl/SSL_CA_Bundle.pem
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Allow,Deny
</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_ssl.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access_ssl.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
And this is the /etc/apache2/sites-available/dev.shop.com
<VirtualHost *:80>
ServerAdmin it@shop.com
ServerName dev.shop.com
ServerAlias dev.shop.com dev shop.com
DocumentRoot /var/www.dev
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www.dev/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Allow,Deny
</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
</VirtualHost>
<VirtualHost *:443>
ServerAdmin it@shop.com
ServerName www.dev.shop.com
ServerAlias dev.shop.com
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/shop.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/shop.com.key
SSLCACertificateFile /etc/apache2/ssl/SSL_CA_Bundle.pem
DocumentRoot /var/www.dev
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www.dev/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Allow,Deny
</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_ssl.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access_ssl.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>