Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed May 23, 2012 6:22 pm 
Offline
Senior Newbie

Joined: Sat Feb 11, 2012 9:30 pm
Posts: 11
Location: Puerto Vallarta
Hello all,

I'm looking for someone who can configure my VirtualHost for several sites that are hosted on my linode.
It's a single file that we need to configure with the correct NameVirtualHost directives.

Anyone intrested? How much would this cost?

Feel free to PM me.


Top
   
 Post subject:
PostPosted: Fri May 25, 2012 2:19 am 
Offline

Joined: Fri May 25, 2012 1:29 am
Posts: 1
Are all the sites being served at the same IP address? If so, you need to add the NameVirtualHost directive to the top of your configuration file. If 173.230.151.109 is your IP address, the directive would look like:

NameVirtualHost 173.230.151.109:80

BTW, I noticed in your first post that the port in the error log is 0. You should change it to 80.

With the NameVirtualHost directive defined, the individual site VirtualHost directives will follow it. So you need blocks resembling these:

<VirtualHost 173.230.151.109:80>
ServerAdmin admin@bzzzd.com
ServerName www.bzzzd.com
ServerAlias bzzzd.com
DocumentRoot /path/to/bzzzd/site
ErrorLog /path/to/bzzzd/site/logs/error.log
CustomLog /path/to/bzzzd/site/logs/access.log combined
</VirtualHost>

<VirtualHost 173.230.151.109:80>
ServerAdmin admin@americaselitevillas.com
ServerName www.americaselitevillas.com
ServerAlias americaselitevillas.com
DocumentRoot /path/to/americaselitevillas/site
ErrorLog /path/to/americaselitevillas/site/logs/error.log
CustomLog /path/to/americaselitevillas/site/logs/access.log combined
</VirtualHost>

Save the file in the /etc/apache2/sites-available directory as something like all-sites. You'd enable the sites by issuing a "sudo a2ensite all-sites" command and reload the web server with "sudo service apache2 reload". I'd review the /etc/apach2/sites-enabled directory and disable anything other than all-sites. Use the a2dissite to disable sites.

I normally don't put multiple sites in one file as it makes enabling and disabling individual sites more difficult. I make an exception to this rule when serving up demo and production versions of a site.

Hope this helps.


Top
   
 Post subject:
PostPosted: Fri May 25, 2012 2:01 pm 
Offline
Senior Newbie

Joined: Sat Feb 11, 2012 9:30 pm
Posts: 11
Location: Puerto Vallarta
Thanks. Would you be interested in doing something for me as a one-time thing? I want to download copies os my sites so I can have a backup with me and to possibly put them on another server down the road. Just enabling FTP access would do.


Top
   
 Post subject:
PostPosted: Fri May 25, 2012 2:30 pm 
Offline
Senior Member
User avatar

Joined: Sat Feb 25, 2012 4:44 pm
Posts: 71
Website: http://inhomeitsupport.com
Bartster wrote:
Thanks. Would you be interested in doing something for me as a one-time thing? I want to download copies os my sites so I can have a backup with me and to possibly put them on another server down the road. Just enabling FTP access would do.



Please don't use ftp very insecure. If you want to copy files from one server to another ssh into them and then use scp to transfer the files.


Top
   
 Post subject:
PostPosted: Fri May 25, 2012 2:38 pm 
Offline
Senior Newbie

Joined: Sat Feb 11, 2012 9:30 pm
Posts: 11
Location: Puerto Vallarta
Thanks for your advice. I want to get a copy of my sites as they are now and I want to have it on my hard drive. If it's not done through FTP and it's done through SSH, even better. I'll provide access and I'll pay anyone who's interested in doing it. Anyone?


Top
   
 Post subject:
PostPosted: Fri May 25, 2012 2:48 pm 
Offline
Senior Member
User avatar

Joined: Sat Feb 25, 2012 4:44 pm
Posts: 71
Website: http://inhomeitsupport.com
Bartster wrote:
Thanks for your advice. I want to get a copy of my sites as they are now and I want to have it on my hard drive. If it's not done through FTP and it's done through SSH, even better. I'll provide access and I'll pay anyone who's interested in doing it. Anyone?



How about I share a script that I use that you can run. It will back up all your websites and MySql data bases and copy them to another server using a cron job


Top
   
PostPosted: Mon May 28, 2012 11:28 am 
Offline
Senior Member
User avatar

Joined: Sat Feb 25, 2012 4:44 pm
Posts: 71
Website: http://inhomeitsupport.com
If anyone is interested here is a nice shell script that I wrote to back up your website and Mysql databases.

#!/bin/bash
# bash script to backup website
BACKUP_LOG=/home/mike/Backup/website.log

date +"%Y-%m-%d %X" > $BACKUP_LOG

# bash script to backup mysql
MYSQL_USER=
MYSQL_PASSWORD=
MYSQL_BACKUP_DIR=/home/mike/Backup


# backup mysql databases
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables mybb | bzip2 -c > $MYSQL_BACKUP_DIR/data-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables inhome | bzip2 -c > $MYSQL_BACKUP_DIR/data-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables blacktop | bzip2 -c > $MYSQL_BACKUP_DIR/data-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables mycloud | bzip2 -c > $MYSQL_BACKUP_DIR/data-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables fog | bzip2 -c > $MYSQL_BACKUP_DIR/fog-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables ps3 | bzip2 -c > $MYSQL_BACKUP_DIR/data-$(date -I).sql.bz2





# remove old MySQL database backups
find $MYSQL_BACKUP_DIR -maxdepth 1 -type f -name *.sql.bz2 -mtime +30 -exec rm -Rf {} \;

# backup file system
rsync -avh -gopt --progress --delete /etc/httpd/conf /etc/httpd/conf.d /srv/www /home/mike/Backup kyrunner@192.168.3.56:/Users/user/Backup


date +"%Y-%m-%d %X" > $BACKUP_LOG

# send email
mailx -s "Micro: website log" @gmail.com < $BACKUP_LOG


Top
   
 Post subject:
PostPosted: Mon May 28, 2012 4:58 pm 
Offline
Senior Member
User avatar

Joined: Thu Nov 24, 2011 12:46 pm
Posts: 139
Location: Mesa AZ
Are you sure you are using that script?

It would appear you have 5 databases (mybb, inhome, blacktop, mycloud and ps3) being backed up to the same dest file - $MYSQL_BACKUP_DIR/data-$(date -I).sql.bz2. Each one overwriting the other so that only the last of the 5 is actually backed up (ps3).

Your fog database is going into a different dest file.


I do something similar, but I dump all the databases into a single compressed file. That way I don't need to change the backup script when I add a new database.

**He updated the post with this fixed**

_________________
Kevin a.k.a. Dweeber


Last edited by Dweeber on Mon May 28, 2012 5:23 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Mon May 28, 2012 5:15 pm 
Offline
Senior Member
User avatar

Joined: Sat Feb 25, 2012 4:44 pm
Posts: 71
Website: http://inhomeitsupport.com
Dweeber wrote:
Are you sure you are using that script?

It would appear you have 5 databases (mybb, inhome, blacktop, mycloud and ps3) being backed up to the same dest file - $MYSQL_BACKUP_DIR/data-$(date -I).sql.bz2. Each one overwriting the other so that only the last of the 5 is actually backed up (ps3).

Your fog database is going into a different dest file.


I do something similar, but I dump all the databases into a single compressed file. That way I don't need to change the backup script when I add a new database.

Ref:
Code:
# Same dest file
# backup mysql databases
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables mybb | bzip2 -c > $MYSQL_BACKUP_DIR/data-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables inhome | bzip2 -c > $MYSQL_BACKUP_DIR/data-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables blacktop | bzip2 -c > $MYSQL_BACKUP_DIR/data-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables mycloud | bzip2 -c > $MYSQL_BACKUP_DIR/data-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables ps3 | bzip2 -c > $MYSQL_BACKUP_DIR/data-$(date -I).sql.bz2

#Diff dest file
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables fog | bzip2 -c > $MYSQL_BACKUP_DIR/fog-$(date -I).sql.bz2



I added data just for example...

This is a example $MYSQL_BACKUP_DIR/data-$(date -I).sql.bz2.

Where you see data after the directory is really my database names

should look like this $MYSQL_BACKUP_DIR/ps3-$(date -I).sql.bz2.


Top
   
 Post subject:
PostPosted: Mon May 28, 2012 5:21 pm 
Offline
Senior Member
User avatar

Joined: Sat Feb 25, 2012 4:44 pm
Posts: 71
Website: http://inhomeitsupport.com
here is how they really look in the shell script I dont why I added data to the end of them when I was adding them to the forum...
# backup mysql databases
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables mybb | bzip2 -c > $MYSQL_BACKUP_DIR/mybb-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables inhome | bzip2 -c > $MYSQL_BACKUP_DIR/inhome-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables blacktop | bzip2 -c > $MYSQL_BACKUP_DIR/blacktop-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables mycloud | bzip2 -c > $MYSQL_BACKUP_DIR/mycloud-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables fog | bzip2 -c > $MYSQL_BACKUP_DIR/fog-$(date -I).sql.bz2
/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --single-transaction --skip-lock-tables ps3 | bzip2 -c > $MYSQL_BACKUP_DIR/ps3-$(date -I).sql.bz2


Top
   
 Post subject:
PostPosted: Mon May 28, 2012 6:24 pm 
Offline
Senior Member

Joined: Mon Dec 07, 2009 6:46 am
Posts: 331
BTW, --single-transaction and --skip-lock-tables is effective only for InnoDB tables (or any other transactional engine). If you use MyISAM you have to lock them or risk taking partial (corrupt) snapshot.


Top
   
 Post subject:
PostPosted: Mon May 28, 2012 6:49 pm 
Offline
Senior Member
User avatar

Joined: Sat Feb 25, 2012 4:44 pm
Posts: 71
Website: http://inhomeitsupport.com
Azathoth wrote:
BTW, --single-transaction and --skip-lock-tables is effective only for InnoDB tables (or any other transactional engine). If you use MyISAM you have to lock them or risk taking partial (corrupt) snapshot.



Good point if you want to see what database engine you are using run these commands.

1) switch to root = sudo su - root

2) run this command = mysql -u root -p (thin hit enter and put your password in)

3) run this command = show databases;

4) after you see your databases select one

5) use database;

6) this will see what engine created them =


SELECT table_name,engine FROM INFORMATION_SCHEMA.TABLES WHERE table_schema=DATABASE();

should be it. if I missed something please give your 2 cents.


Top
   
 Post subject:
PostPosted: Mon May 28, 2012 7:00 pm 
Offline
Senior Member
User avatar

Joined: Sat Feb 25, 2012 4:44 pm
Posts: 71
Website: http://inhomeitsupport.com
Azathoth wrote:
BTW, --single-transaction and --skip-lock-tables is effective only for InnoDB tables (or any other transactional engine). If you use MyISAM you have to lock them or risk taking partial (corrupt) snapshot.


Here is for MyISAM

# backup mysqll databases

/usr/bin/mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD --all-databases --lock-all-tables --flush-logs --master-data=2 | bzip2 -c > $MYSQL_BACKUP_DIR/all-$(date -I).sql.bz2


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group