Booting two linode configuration profiles at the same time?
I'm currently in the process of moving files from one to the other. I'd like to be able to use my SSH client software to log on to both profiles, so I can move files around before making the final switchover. Is there any way to be able to run both profiles at once? Failing that, is there an efficient way to copy files from one profile to the other?
Also, is there a FAQ on the forums explaining the best way to switch web site URLs from one configuration to another?
Thanks,
- Chris
18 Replies
To move files from one to the other (say lenny to squeeze), edit the profile for squeeze and add the root lenny drive as another parition, boot into the squeeze profile and mount the lenny drive, then you can simply copy the files using cp.
Switching websites shouldn't be a problem if they're both the same configuration they will also share the same ip, so as long as your webserver configurations are the same it should work fine.
I finished copying my files to the Squeeze profile. Just as a sanity check, I left the sites-available and sites-enabled directories with their default values, and added
NameVirtualHost 72.14.179.185:80
to end of apache2.conf
I then pointed my browser to the Linode's numerical URL, and got the Apache default page, so I know Apache is working on the new Squeeze profile.
The problem came after I copied over my sites-available and sites-enabled directories from the Lenny profile, and rebooted. When I typed the following to activate my bookgenius.org website:
a2ensite bookgenius.org
I got this error message:
root@li41-185:/etc/apache2# a2ensite bookgenius.org
ERROR: Site bookgenius.org not properly enabled: /etc/apache2/sites-enabled/bookgenius.org is a real file, not touching it
And, not surprisingly, my browser can't connect to the website. Can you tell me what the problem might be? I suspect I left out a step in enabling the website.
Thanks,
- Chris
But when I restarted Apache, I still could not connect to the site. I looked in the sites-enabled directory, but didn't see any files there. Hmmm . . .
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Be polite or you'll be eaten by a grue
ln -s /etc/apache2/sites-available/bookgenius.org /etc/apache2/sites-enabled/bookgenius.org
then restart apache
root@li41-185:/etc/apache2# ln -s /etc/apache2/sites-available/bookgenius.org /etc/apache2/sites-enabled/bookgenius.org
ln: creating symbolic link `/etc/apache2/sites-enabled/bookgenius.org': File exists
It turns out there already was a bookgenius.org ORG file in sites-enabled, but I had neglected to refresh the directory when I was looking earlier (sorry!). I rebooted, but still cannot connect to the site.
What's the output of
netstat -lpnt
and
iptables -L -n -v
root@li41-185:/etc/apache2# netstat -lpnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:8004 0.0.0.0:* LISTEN 1575/pazpar2
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1851/mysqld
tcp 0 0 0.0.0.0:49002 0.0.0.0:* LISTEN 1365/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1353/portmap
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1854/sshd
tcp6 0 0 :::80 :::* LISTEN 1586/apache2
tcp6 0 0 :::22 :::* LISTEN 1854/sshd
root@li41-185:/etc/apache2#
For iptables:
root@li41-185:/etc/apache2# iptables -L -n -v
Chain INPUT (policy ACCEPT 185 packets, 16191 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 158 packets, 27305 bytes)
pkts bytes target prot opt in out source destination
root@li41-185:/etc/apache2#
[Wed Dec 14 13:28:20 2011] [notice] Apache/2.2.16 (Debian) mod_perl/2.0.4 Perl/v5.10.1 configured – resuming normal operations
[Wed Dec 14 13:28:27 2011] [error] [client 71.126.224.235] File does not exist: /etc/apache2/htdocs
[Wed Dec 14 13:28:41 2011] [error] [client 71.126.224.235] File does not exist: /etc/apache2/htdocs
[Wed Dec 14 13:32:36 2011] [error] [client 123.125.71.23] File does not exist: /etc/apache2/htdocs
[Wed Dec 14 13:33:12 2011] [error] [client 220.181.108.81] File does not exist: /etc/apache2/htdocs
[Wed Dec 14 13:36:24 2011] [error] [client 71.126.224.235] File does not exist: /etc/apache2/htdocs
[Wed Dec 14 13:37:30 2011] [error] [client 66.249.71.217] File does not exist: /etc/apache2/htdocs
[Wed Dec 14 13:37:30 2011] [error] [client 66.249.71.217] File does not exist: /etc/apache2/htdocs
[Wed Dec 14 13:38:09 2011] [error] [client 66.249.71.133] File does not exist: /etc/apache2/htdocs
(Thanks so much for all your help, by the way!)
If you just change the port or add more ports here, you will likely also
have to change the VirtualHost statement in
/etc/apache2/sites-enabled/000-default
This is also true if you have upgraded from before 2.2.9-3 (i.e. from
Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
README.Debian.gz
NameVirtualHost *:80
Listen 80
the VirtualHost statement in /etc/apache2/sites-available/default-ssl
to # Server Name Indication for SSL named virtual hosts is currently not
supported by MSIE on Windows XP.
Listen 443
Thanks again!
I do have a question: when I did reload the server, I got these warnings:
root@everything:~# /etc/init.d/apache2 restart
Restarting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Thu Dec 15 15:35:30 2011] [warn] NameVirtualHost *:80 has no VirtualHosts
… waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Thu Dec 15 15:35:32 2011] [warn] NameVirtualHost *:80 has no VirtualHosts
.
I'm not quite sure what the warning means. I do see content from the web site in my browser now, so I know it's working.
- Chris