I'm using a dynamic DNS service, and I want to switch from a free domain name to my own domain name. I'm not that experianced at working with Apache, so I'd appreciate it if I could get a sanity check. I'm currently using a single server connected to my home router. I'm running a Debian based Linux called Raspbian, and I'm using Apache2 with a home made CMS. My site is currently at
http://myraspberrypi.no-ip.biz.
I plan to create two virtual host files in /etc/apaches/sites-available like this:
/etc/apache2/sites-available/mynewdomain.com
Code:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
ServerName mynewdomain.com
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes 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
AddHandler cgi-script .py
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>
/etc/apache2/sites-available/myolddomain.com
Code:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www2
ServerName myolddomain.com
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www2/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin2/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AddHandler cgi-script .py
Order allow,deny
Allow from all
</Directory>
#ErrorLog ${APACHE_LOG_DIR}/error.log
ErrorLog ${APACHE_LOG_DIR}/error2.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
#CustomLog ${APACHE_LOG_DIR}/access.log combined
CustomLog ${APACHE_LOG_DIR}/access2.log combined
</VirtualHost>
Then I'll execute these commands:
sudo a2ensite myolddomain.com
sudo a2ensite mynewdomain.com
In /var/www2, I'm going to duplicate the directory structure and fill it with htaccess files containing 301 redirects.
Before I try this, I want to make sure I know what I'm doing, so I'd appreciate it if someone could let me know if I'm on the right track. Is this approach likely to hurt my search rankings?