edwardsmarkf/server-migration
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
############################################################
# #
# n e w s e r v e r i n i t i a l i z a t i o n #
# #
############################################################
echo "export KVM_NAME=kvm502;" > /etc/profile.d/kvmName.sh; ## 2026-02-20
## (this step takes about 3.5 hours or 210 minutes!)
dnf --assumeyes install time ;
cat <<END_OF_INITIALIZATION |
cd ;
dnf --assumeyes update ;
dnf --assumeyes upgrade ;
dnf clean all ;
dnf --assumeyes install time ;
dnf --assumeyes install git && git clone https://github.com/edwardsmarkf/server-migration ;
cd ~/server-migration/ ;
time bash -vx ~/server-migration/Master_Installer.bsh > ~/server-migration/Master_Installer.bsh.log 2>&1 ;
END_OF_INITIALIZATION
nohup time bash -vx - > ~/do-all-the-work.bsh.log 2>&1 &
#####################################################################
# #
# c u r r e n t s e r v e r d a t a e x t r a c t i o n #
# #
#####################################################################
## on CURRENT server: (NOTE LENGTH OF TIME!!)
rm -Rf /tmp/old_server_data ; mkdir /tmp/old_server_data && cd $_ ;
git clone https://github.com/edwardsmarkf/server-migration ;
tar --gzip --create --file=/kvm301/backup/github-server-migration-$(date +%Y-%m-%d;).tar.gz ./server-migration/ ; ## optional save
ls -l /kvm301/backup/github-server-migration-$(date +%Y-%m-%d;).tar.gz ;
sed --in-place --expression='1,/CHANGE-THIS/s/CHANGE-THIS/NewPassWordGoesHere/;' ./server-migration/mariadb/migration/mariadbDumpAllDatabases.bsh ;
grep '^MARIADB_PASSWORD=' ./server-migration/mariadb/migration/mariadbDumpAllDatabases.bsh ;
cat <<END_OF_CURRENT_SERVER |
bash -vx ./server-migration/mariadb/migration/mariadbDumpAllDatabases.bsh ; ## on OLD server!
ls -lh /home/mark ; ## confirm 63 megabyte size for mariadb-database-tar.gz
crontab -l > /home/mark/crontab.txt ; gzip /home/mark/crontab.txt ;
tar --create --gunzip --file=/home/mark/usr_local_bash.tar.gz /usr/local/bash/ ;
tar --create --gunzip --file=/home/mark/usr_local_lib_php.tar.gz /usr/local/lib/php/ ;
tar --create --gunzip --file=/home/mark/letsencrypt.tar.gz /etc/letsencrypt ;
tar --create --gunzip \
--preserve-permissions \
--same-owner \
--exclude='*.opus' \
--file=/home/mark/home.tar.gz /home/ ; ## 34 gig!
cp --verbose ~/.bash_history /home/mark/bash_history ;
chmod --verbose 755 /home/mark/bash_history ;
gzip /home/mark/bash_history ;
ls -lh /home/mark/*.gz ;
END_OF_CURRENT_SERVER
nohup time nice bash -vx - > ./current-server-tar-gz-creates.log 2>&1 & ## detach
########################################################
# #
# f e t c h d a t a t o n e w s e r v e r #
# #
########################################################
## on new server: (30 minutes)
dnf --assumeyes install sshpass ; ## this might not yet be done if this procedure is started too early.
################## export TMP_LOCATION=/tmp/ ; ## 2026-04-02 /tmp/ directory on new server is NOT very big....\
################## cd ${TMP_LOCATION} ; ## 2026-04-02
rm -Rf /tmp/old_server_data ; mkdir /tmp/old_server_data && cd $_ ;
## get IP number from NEW server and temporarily add it to old server csf firewall port 22 ##
### https://stackoverflow.com/questions/28461713/how-to-ignore-or-pass-yes-when-the-authenticity-of-host-cant-be-established-i
sshpass -p 'MYpASSWORDfORaCCTmARK' sftp -o StrictHostKeyChecking=no mark@162.220.165.228 ; ## grab stuff from OLD server!
sftp> ls -lh ## human readable file size /home/ one is 34.x gigs
sftp> mget *.gz ## fetch the gzips
sftp> !ls -lh ## file sizes on NEW server (notice bang character)
sftp> rm *.gz ## can be done in the sftp session!
.................or.....
rm -Rf /home/mark/crontab.txt.gz /home/mark/*.tar.gz /home/mark/*.sql.gz ; ## on OLD server!
############################################################################
# #
# p r e l i m i n a r y t e s t i n g #
# #
############################################################################
######################################
# p r e l i m i n i a r y #
######################################
more ~/ffmpeg-install-logs/99-test.bsh.log ; ### look for results
## define/create domain (if it does not yet exist) using new IP into local etc.hosts file
export DOMAIN='zzyzxzzyzx.com' ;
virtualmin create-domain --domain ${DOMAIN} --pass abcdefg --dir --unix --dns --web ; ## 2025-08-13 ## --dns and --web are the ONLY two options requested
virtualmin modify-web --domain ${DOMAIN} --enable-fcgiwrap ; ## can this ever be the default?
##############################
# p h p t e s t i n g #
##############################
bash -vx ~/server-migration/php/02_php_testing.bsh ;
su fakephpuser --command "/bin/composer --version ; " && echo $? ;
################################
# p e r l t e s t i n g #
################################
###more ~/server-migration/perl/README ## look for tests
su fakeperluser --command 'perl -W -e '\''use File::Basename ; '\'' ; ' && echo $? ; ## test the perl 'use' command.
su - fakeperluser --command 'perl -W -MXML::Writer -e 1 ; ' && echo $? ; ## not sure what the first dash does...?
bash -vx ~/server-migration/perl/perl-cgi-testing.bsh ;
######################################
# m a r i a d b t e s t i n g #
######################################
echo 'SELECT VERSION() "Version:" ;' | mariadb && echo $? ;
bash ~/server-migration/mariadb/05_test_perl_mariadb_connection.bsh && echo $? ;
bash ~/server-migration/mariadb/05_test_php_mariadb_connection.bsh && echo $? ;
#######################
# c l e a n u p #
#######################
virtualmin delete-domain --domain ${DOMAIN} ;
userdel --remove fakeperluser ;
userdel --remove fakephpuser ;
ls -l /home/ ;
######################################################################
# #
# u n p a c k a l l t h e c u r r e n t d a t a #
# #
######################################################################
# also on the new server:
export TMP_LOCATION=/tmp/old_server_data/ ; ##
cd ${TMP_LOCATION} ;
cat <<END_OF_UNPACK |
cd \${TMP_LOCATION} ;
gzip --decompress \${TMP_LOCATION}/*.gz ; ### you MAY run into space issues on the new server!
tar --extract --file \${TMP_LOCATION}/home.tar ;
tar --extract --file \${TMP_LOCATION}/letsencrypt.tar ;
tar --extract --file \${TMP_LOCATION}/mariadb-databases.tar ;
tar --extract --file \${TMP_LOCATION}/usr_local_bash.tar ;
tar --extract --file \${TMP_LOCATION}/usr_local_lib_php.tar ;
END_OF_UNPACK
nohup time bash -vx - > ~/current-server-tar-gz-unpack.log 2>&1 & ## detach
ls -lh /tmp/old_server_data ;
ls -lR /tmp/old_server_data/ | wc --lines ; ## 507000+
### rm --verbose --force ${TMP_LOCATION}/home.tar ; # we MAY need this for space!
######################################################################
# #
# c r e a t e a l l v i r t u a l s e r v e r s #
# #
######################################################################
cat <<CREATE_ALL_VIRTUAL_SERVERS |
bash -vx ~/server-migration/webmin/virtualmin-create-vm.bsh > ~/server-migration/webmin/virtualmin-create-vm.bsh.log 2>&1 ;
bash -vx ~/server-migration/httpd.conf/apache.bsh > ~/server-migration/httpd.conf/apache.bsh.log 2>&1 ;
systemctl restart httpd.service ; ##
apachectl status ;
CREATE_ALL_VIRTUAL_SERVERS
nohup time bash -vx - > ~/create-all-virtual-servers.log 2>&1 & ## detach
###################################################
# #
# m a r i a d b d a t a i n s t a l l #
# #
###################################################
## be SURE unpacking is done first.....!
export TMP_LOCATION=/tmp/old_server_data/ ; ##
cd ${TMP_LOCATION} ;
## the childs last name (lowercase) and the childs first name (camelCase) and the special one from 1974-1991 (camelCamelCase) no spaces
sed --in-place --expression="s/^password=''/password='CHANGE-THIS'/" ~/server-migration/mariadb/migration/create_db_and_users.bsh ; ## edit and add password!
grep '^password=' ~/server-migration/mariadb/migration/create_db_and_users.bsh ; ## inspect it
bash ~/server-migration/mariadb/migration/create_db_and_users.bsh > ${TMP_LOCATION}/create_db_and_users.sql ;
cat ${TMP_LOCATION}/create_db_and_users.sql ;
mariadb --verbose < ${TMP_LOCATION}/create_db_and_users.sql ;
bash ~/server-migration/mariadb/migration/create_db_and_users.bsh \
| grep TEMP_SQL_LOCATION \
| sed -e 's/.* ### //; s/ ## //;1i TEMP_SQL_LOCATION=${TMP_LOCATION}/tmp/mariadb-tmp/;' \
> ${TMP_LOCATION}/load_sql_tables.bsh \
; ## generate our 'load' script!
cat ${TMP_LOCATION}/load_sql_tables.bsh ; ## inspect it
nohup time bash -vx ${TMP_LOCATION}/load_sql_tables.bsh > ~/load_sql_tables.bsh.log 2>&1 & ## run the newly created bash script approx 30 minutes run time
du --summarize --human-readable /var/lib/mysql/ ; ## check for total size 1.4 gigs
mariadb-secure-installation; ## IMPORTANT!
mariadb-show --count ; ## spot-check the number of rows!
######################################################################
# #
# m o v e d a t a t o p r o p e r l o c a t i o n s #
# #
######################################################################
##### put tar files into their proper places
cat <<END_OF_MOVE |
export TMP_LOCATION=/tmp/old_server_data/ ; ##
cd \${TMP_LOCATION} ;
mv --verbose \${TMP_LOCATION}/bash_history ~ ;
for DIR_NAME in \$(ls \${TMP_LOCATION}/home/ ) ;
do
echo " processing: \${DIR_NAME}" ;
if [[ -d /home/\${DIR_NAME}/ ]]; then
tar --gzip --create --file=/home/\${DIR_NAME}.gz /home/\${DIR_NAME}/ ;
rm --verbose --force --recursive /home/\${DIR_NAME}/ ;
mv --verbose \${TMP_LOCATION}/home/\${DIR_NAME}/ /home/\${DIR_NAME}/ ;
fi
done
rsync --verbose --archive \${TMP_LOCATION}/etc/letsencrypt/ /etc/letsencrypt/ ;
mv --verbose \${TMP_LOCATION}/usr/local/bash/ /usr/local/ ;
mv --verbose \${TMP_LOCATION}/usr/local/lib/php/ /usr/local/lib/ ;
cat \${TMP_LOCATION}/crontab.txt | crontab - ;
# quick way to load crontab from old server!
apachectl restart && apachectl status ; # have to restart apache since the ssl stuff was moved around.
bash -vx ~/server-migration/bash-misc/chown-them-all.bsh > ~/server-migration/bash-misc/chown-them-all.bsh.log 2>&1 ;
END_OF_MOVE
nohup time bash -vx - > ~/current-server-tar-gz-move.log 2>&1 & ## detach
#######################################################
# #
# p m 2 . i n i t i a l i z e . b s h #
# #
#######################################################
### ? ? ? ? npm install uuid@latest ; ### ? ? ? ? ? https://stackoverflow.com/questions/68170853/npm-warn-deprecated-uuid3-4-0-please-upgrade-to-version-7-or-higher
bash -vx ~/server-migration/httpd.conf/pm2-httpd-conf-initialize.bsh > ~/server-migration/httpd.conf/pm2-httpd-conf-initialize.bsh.log 2>&1 ;
tail -100 ~/server-migration/httpd.conf/pm2-httpd-conf-initialize.bsh.log ;
apachectl configtest && apachectl status ;
nohup bash -vx ~/server-migration/node/pm2-initialize.bsh > ~/server-migration/node/pm2-initialize.bsh.log 2>&1 &
pm2 status ; ## look for all of them "status online"
bash -vx ~/server-migration/node/visudo.bsh > ~/server-migration/node/visudo.bsh.log 2>&1 ;
apachectl status ; ### or restart - not sure why this was required on 2026-04-02
#######################################################
# #
# s - n a i l - p o s t f i x . b s h #
# #
#######################################################
## first get password from Google: https://myaccount.google.com/apppasswords
## or just use the one already in the php-mailer!
bash ~/server-migration/s-nail/s-nail-postfix.bsh ;
php /usr/local/lib/php/SMTPMailer-tester.php ; ## test the php mail sender
##########################
# #
# r s y n c #
# #
##########################
## TEST rsync FIRST !!
sshpass -p 'PASSWORD' sftp -o StrictHostKeyChecking=no mark@162.220.165.228 ; ## test to make sure this works!
# format: rsync S-O-U-R-C-E D-E-S-T-I-N-A-T-I-O-N
sshpass -p 'PASSWoRd' \
sudo --user=comptonpeslonline.com rsync --verbose --archive --rsh='ssh -o StrictHostKeyChecking=no' \
/home/comptonpeslonline.com/public_html/comptonPractice/user-recorded-audio-files/ \
comptonpeslonline.com@162.220.165.228:/home/comptonpeslonline.com/public_html/comptonPractice/user-recorded-audio-files/ ;
nohup \
sshpass -p 'PASSWoRd' \
sudo --user=comptonpeslonline.com rsync --stats --archive --rsh='ssh -o StrictHostKeyChecking=no' \
comptonpeslonline.com@162.220.165.228:/home/comptonpeslonline.com/public_html/comptonPractice/user-recorded-audio-files/ \
/home/comptonpeslonline.com/public_html/comptonPractice/user-recorded-audio-files/ \
& ## run in background the first time...
nohup \
sshpass -p 'PASSWoRd' \
sudo --user=comptonpeslonline.com rsync --stats --archive --rsh='ssh -o StrictHostKeyChecking=no' \
comptonpeslonline.com@162.220.165.228:/home/comptonpeslonline.com/public_html/voicefiles/ \
/home/comptonpeslonline.com/public_html/voicefiles/ \
& ## run in background the first time...
##################################
# #
# f i n a l t e s t i n g #
# #
##################################
find /home/ -type f -name '*.php' -exec php -l {} \; > php-lint-test.txt 2> php-lint-test-errors.txt ; ## php lint test
ls -lR /home/comptonpeslonline.com/ | grep -u "comptonpeslonline.com:comptonpeslonline.com" ; ## double-check correct ownership!
#### this need to be tested have "Content-type: text/html" removed and replaced with -M "text/html":
/home/comptonpeslonline.com/cgi-bin/email_link.pl
##############################################################################################################################################################################################
##############################################################################################################################################################################################
##############################################################################################################################################################################################
##############################################################################################################################################################################################
##############################################################################################################################################################################################
##############################################################################################################################################################################################
##############################################################################################################################################################################################
##############################################################################################################################################################################################
##############################################################################################################################################################################################
chown ${DOMAIN}:${DOMAIN} /home/${DOMAIN}/public_html/* ;
chmod 755 /home/${DOMAIN}/public_html/* ;
ls -l /home/${DOMAIN}/public_html ;
cat <<END_OF_LINKS;
Try the following:
http://${DOMAIN}/
http://${DOMAIN}/index.php
http://${DOMAIN}/phpinfo.php
http://${DOMAIN}/imageMagickTest.php
END_OF_LINKS
################ mv --verbose /home/\${DIR_NAME}/ /home/\${DIR_NAME}-RENAMED/ ;
## misc php archive files:
## already done! rsync --verbose --archive --rsh=ssh /usr/local/lib/php/ root@199.231.184.26:/usr/local/lib/php/
###########################################cp --verbose /root/server-migration/php/imageMagickTest.php /home/${DOMAIN}/public_html/imageMagickTest2.php ;
####################################### bash ~/server-migration/bash-misc/chmod-them-all.bsh ; ## tar keeps losing ownership
########################################## mv --verbose /home-RENAMED/fakeperluser/ /home/ ;
########################################## mv --verbose /home-RENAMED/fakephpuser/ /home/ ;
### Alter /usr/local/bash/serverUtilitzation because serverUtilization.bsh uses 'Content-type: type/html' --replace with -M "text/html"
## [ -d "/usr/local/share/perl5/5.40" ] || mkdir --parent /usr/local/share/perl5/5.40 ; ## 2026-04-02
# mv --verbose /home/ /home-RENAMED/ ;
# mv --verbose /tmp/old_server_data/home/ /home/ ;
# rsync --verbose --archive /home-RENAMED/ /home/ ; ## check file owners
3) virtualmin
#######################3) webmin/virtualmin/csf
####################### now need to download and ftp the install file from the website login-area rather than trying to curl it from inside the script
### ??????? use "--disableplugin subscription-manager" instead
## sed --in-place --expression='s/enabled=1/enabled=0/;' /etc/yum/pluginconf.d/product-id.conf ; ## 2025-07-29
4) bash -vx ./bash-misc/dnf-yum.bsh > ./bash-misc/dnf-yum.bsh.log 2>&1 ;
5) bash -vx ./bash-misc/root-init.bsh > ./bash-misc/root-init.bsh.log 2>&1 ;
6) ### ???? sed --in-place --expression='s/enabled=1/enabled=0/;' /etc/yum/pluginconf.d/product-id.conf ; ## 2025-07-29 for RL-10
7) ffmpeg (can probably be done anytime but TEST first before starting!)
#) SKIP SKIP Mariadb UPGRADE (LET VIRTUALMIN INSTALL PHP, let github install PERL ## do before perl and php)
8) php and /php/phpImageMagick.bsh
9) perl/CPAN
09) clamav
20) ./bash-misc/mailx-postfix.bsh
40) bash -vx ./node/bash-js.bsh ;
41) httpd.conf/apache.bsh -- not quite ready to run manually do it
42) contact STRIPE.COM and let them know the new IP ## on the callback hook for ajcomptonpesl.com
https://www.edwardsmark.com/textpattern/articles/265/associate-stripe-api-key-with-specific-ip-number
42) /usr/bin/bash - tar over
50) crontab-reboot-commands
60) fail2ban-client --version ; # make sure faile2ban-client is installed! Fail2Ban v0.11.2 at of 2012-07-22
70) install ./bash-misc/certbot
80) visudo for node processes
90) copy over all crontab jobs
95) bash -vx /node/pm2.bsh ;
100) edit /etc/hostname and include 'edwardsmark.info'
## new 2016-02-28 -- THIS IS COPIED IN WHEN DIRECTORY IS MOVED!
mkdir --verbose /home/comptonpeslonline.com/tmpVoiceSpiceFile/ ;
chmod 755 --verbose /home/comptonpeslonline.com/tmpVoiceSpiceFile/ ;
chown comptonpeslonline.com:comptonpeslonline.com /home/comptonpeslonline.com/tmpVoiceSpiceFile/ ;
# rsync SOURCE DESTINATION
sudo -u comptonpeslonline.com rsync --verbose --archive --rsh=ssh \
comptonpeslonline.com@162.220.165.228:/home/comptonpeslonline.com/public_html/comptonPractice/user-recorded-audio-files/ \
/home/comptonpeslonline.com/public_html/comptonPractice/user-recorded-audio-files/ ;
sudo -u comptonpeslonline.com rsync --verbose --archive --rsh=ssh \
comptonpeslonline.com@162.220.165.228:/home/comptonpeslonline.com/public_html/voicefiles/ \
/home/comptonpeslonline.com/public_html/comptonPractice/voicefiles/ ;
## one line no passord prompting:
sshpass -p 'PASSWORD' \
sudo --user=comptonpeslonline.com rsync --verbose --archive --rsh=ssh \
comptonpeslonline.com@162.220.165.228:/home/comptonpeslonline.com/public_html/voicefiles/ \
/home/comptonpeslonline.com/public_html/voicefiles/ ;
## important misc php archive files:
rsync --verbose --archive --rsh=ssh /usr/local/lib/php/ root@199.231.184.26:/usr/local/lib/php/
######### ftp - START OUT WITH A WORKING DOMAIN NAME (2013-07-03)
#####################https://www.digitalocean.com/community/articles/how-to-set-up-proftpd-on-centos-6
moved to sftp.bsh February 2019
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm ;
yum install ftp ;
yum install proftpd ;
hostname edwardsmark.com ;
echo <<END >> /etc/hosts ;
199.231.184.26 server
END
sed -i -e "s/ServerName whatever/ServerName myNewDomainName.com" /etc/proftpd ;
service proftpd restart ;
##mkdir /home/mark ;
useradd mark ;
passwd mark ;
ftp myNewDomainName.com ; ## test login
sftp mark@127.0.0.1 ; ## 2016-02-09- notice sftp since regular ftp may not be an option anymore.
## 2019-11-13 - ran on centos-7/8 successfully.
chkconfig dovecot off ; ### disable dovecot from starting
2013-03-01 -- to supress messages from emailing:
echo "/usr/bin/php-cgi" >> /etc/csf/csf.pignore ;
## written from http://configserver.com/free/csf/install.txt
/etc/resolv.conf :
nameserver 66.45.228.250
nameserver 8.8.8.8
nameserver 127.0.0.1
#### https://www.interserver.net/forum/threads/strange-error-message-sending-email-on-kvm275.20548/
# I use
# nameserver 69.10.54.252
# nameserver 66.45.251.218
# nameserver 64.20.34.50
# nameserver 66.45.228.250
# nameserver 1.1.1.1
# nameserver 8.8.8.8
(php pear??? do we need it ???)
==== bcc mail
to always bcc mail: (2014-10-17)
/etc/postfix/main.cf -- add this line:
always_bcc = edwardsmarkf@gmail.com
==== httpd.conf
add this:
AddType audio/ogg .ogg .ogv
AddType audio/speex .spx
systemctl start mariadb; ## replacement for mysql 2015-12-18
below stuff may be obsolete:
## 2014-01-05 added by mark - test to make sure that mysql started, if not, remove
## the sock file and try again
if [ $(/etc/init.d/mysqld status | grep 'mysqld (pid .*) is running' | wc --lines) -gt 0 ];
then
echo 'mysql successfully started -- no action taken';
else
echo $0 'mysql did *NOT* start successfully -- removing the sock and restarting.....';
[ -e /var/lib/mysql/mysql.sock ] && rm /var/lib/mysql/mysql.sock;
/etc/init.d/mysqld start;
/bin/mail -v -r info@edwardsmarkf.info -s 'mysql start failure notice' mark@edwardsmark.com <<END
$(/bin/date)
$0 mysql did not start on reboot -- removing sock and trying again
please see /var/log/boot.log file for more details
END
fi;
=================================
==== (OBSOLETE
ftp auto-login: (2013-05-10)
echo 'machine ftp.adrive.com login mark@edwardsmark.com password JABBERWOLKY' >> ~/.netrc ;
chmod 600 ~/.netrc ;
===
=== two ways to manage dns records ===============
A: using interserver name server
1) log into the my.interserver.net control panel
2) Domains---->DNS-Manager (domains is next to "home" second from left)
3) "Add New DNS Entry" - enter clients domain name and interserver.net ip address 69.10.48.25
4) click on the little wrench on the far right
5) create 5 new mx records
B: using our own customized name server and virtualmin:
1) create ns1/2.XXXX.com subdomains and point "A" records to 69.10.48.25
2) use nameserver from step one for given domain
3) log into virtualmin and select(or create) new virtual-server (new website)
4) ServerConfiguration--->DNS_Records
5) enter 5 new mx records using "Create Record of Type" button at bottom (be sure to select MX)
======== authorized dns ===================
Primary DNS - cdns1.interserver.net 209.159.155.28
Secondary DNS - cdns2.interserver.net 66.45.228.248
OBSOLETE
## flvar admin files - THIS MIGHT NOT WORK PROPERLY......
rsync --verbose --archive --rsh=ssh /usr/share/red5/webapps/ root@199.231.184.26:/usr/share/red5/webapps/
==== /etc/init.d/rc.local: (2014-11-02)
mount -a ; ## 2013-05-14 mounts up the stuff in the fstab file
/etc/init.d/red5 start >/usr/share/red5/red5.log 2>&1
#### ## ddos-deflate installation 2016-04-20
#### wget http://www.inetbase.com/scripts/ddos/install.sh
#### chmod 0700 install.sh
#### ./install.sh
#### ## dont forget jQuery ! (?)
#### rsync --verbose --archive --rsh=ssh /usr/local/jquery/ root@edwardsmarkf.info:/usr/local/jquery/
## mkdir --verbose /usr/local/bash/ ;
## mkdir --verbose /usr/local/lib/php/ ;
manually add/edit these to /etc/httpd/conf/httpd.conf: (carouselhouse.com still shows in the OLD httpd.conf, so we ignore it)
SSLCertificateFile /home/accentreduction.online/ssl.cert
SSLCertificateKeyFile /home/accentreduction.online/ssl.key
SSLCertificateChainFile /home/accentreduction.online/ssl.ca
SSLCertificateFile /home/ajcomptonpesl.com/ssl.cert
SSLCertificateKeyFile /home/ajcomptonpesl.com/ssl.key
SSLCertificateChainFile /home/ajcomptonpesl.com/ssl.ca
SSLCertificateFile /home/comptonpeslonline.com/ssl.cert
SSLCertificateKeyFile /home/comptonpeslonline.com/ssl.key
SSLCertificateChainFile /home/comptonpeslonline.com/ssl.ca
SSLCertificateFile /home/comptonpeslonline.info/ssl.cert
SSLCertificateKeyFile /home/comptonpeslonline.info/ssl.key
SSLCertificateChainFile /home/comptonpeslonline.info/ssl.ca
SSLCertificateFile /home/edwardsmark.com/ssl.cert
SSLCertificateKeyFile /home/edwardsmark.com/ssl.key
SSLCertificateChainFile /home/edwardsmark.com/ssl.ca
SSLCertificateFile /home/englishwithoutaccent.com/ssl.cert
SSLCertificateKeyFile /home/englishwithoutaccent.com/ssl.key
SSLCertificateChainFile /home/englishwithoutaccent.com/ssl.ca
SSLCertificateFile /home/gordonredwards.com/ssl.cert
SSLCertificateKeyFile /home/gordonredwards.com/ssl.key
SSLCertificateChainFile /home/gordonredwards.com/ssl.ca
SSLCertificateFile /home/slrh.org/ssl.cert
SSLCertificateKeyFile /home/slrh.org/ssl.key
apachectl configtest ;
apachectl restart ;
cp --verbose /etc/httpd/conf/httpd.conf ./httpd.conf ;
sed --in-place --file=- ./httpd.conf <<END_OF_GENERIC_SED ;
s?^ SSLCertificateFile /? #### &?;
s?^ SSLCertificateKeyFile /? #### &?;
END_OF_GENERIC_SED
sed --file=- ./httpd.conf <<END_OF_ACCENTREDUCTION_ONLINE_SED > x.x ;
/RewriteRule .*well-known).* https:\/\/accentreduction.online:10000\//,/VirtualHost/{/#SSLCertificateKeyFile/a \
####\n\
SSLCertificateFile /home/accentreduction.online/ssl.cert\n\
SSLCertificateKeyFile /home/accentreduction.online/ssl.key
}
END_OF_ACCENTREDUCTION_ONLINE_SED
sed --file=- ./httpd.conf <<END_OF_AJCOMPTONPESL_COM_SED > x.x ;
/RewriteRule .*well-known).* https:\/\/ajcomptonpesl.com:10000\//,/VirtualHost/{/#SSLCertificateKeyFile/a \
####\n\
SSLCertificateFile /home/ajcomptonpesl.com/ssl.cert\n\
SSLCertificateKeyFile /home/ajcomptonpesl.com/ssl.key
}
END_OF_AJCOMPTONPESL_COM_SED
sed --file=- ./httpd.conf <<END_OF_COMPTONPESLONLINE_COM_SED > x.x ;
/RewriteRule .*well-known).* https:\/\/comptonpeslonline.com:10000\//,/VirtualHost/{/#SSLCertificateKeyFile/a \
####\n\
SSLCertificateFile /home/comptonpeslonline.com/ssl.cert\n\
SSLCertificateKeyFile /home/comptonpeslonline.com/ssl.key
}
END_OF_COMPTONPESLONLINE_COM_SED
sed --file=- ./httpd.conf <<END_OF_COMPTONPESLONLINE_INFO_SED > x.x ;
/RewriteRule .*well-known).* https:\/\/comptonpeslonline.info:10000\//,/VirtualHost/{/#SSLCertificateKeyFile/a \
####\n\
SSLCertificateFile /home/comptonpeslonline.info/ssl.cert\n\
SSLCertificateKeyFile /home/comptonpeslonline.info/ssl.key
}
END_OF_COMPTONPESLONLINE_INFO_SED
sed --file=- ./httpd.conf <<END_OF_EDWARDSMARK_COM_SED > x.x ;
/RewriteRule .*well-known).* https:\/\/edwardsmark.com:10000\//,/VirtualHost/{/#SSLCertificateKeyFile/a \
####\n\
SSLCertificateFile /home/edwardsmark.com/ssl.cert\n\
SSLCertificateKeyFile /home/edwardsmark.com/ssl.key
}
END_OF_EDWARDSMARK_COM_SED
sed --file=- ./httpd.conf <<END_OF_ENGLISHWITHOUTACCENT_COM_SED > x.x ;
/RewriteRule .*well-known).* https:\/\/englishwithoutaccent.com:10000\//,/VirtualHost/{/#SSLCertificateKeyFile/a \
####\n\
SSLCertificateFile /home/englishwithoutaccent.com/ssl.cert\n\
SSLCertificateKeyFile /home/englishwithoutaccent.com/ssl.key
}
END_OF_ENGLISHWITHOUTACCENT_COM_SED
sed --file=- ./httpd.conf <<END_OF_GORDONREDWARDS_COM_SED > x.x ;
/RewriteRule .*well-known).* https:\/\/gordonredwards.com:10000\//,/VirtualHost/{/#SSLCertificateKeyFile/a \
####\n\
SSLCertificateFile /home/gordonredwards.com/ssl.cert\n\
SSLCertificateKeyFile /home/gordonredwards.com/ssl.key
}
END_OF_GORDONREDWARDS_COM_SED
sed --file=- ./httpd.conf <<END_OF_SLRH_ORG_SED > x.x ;
/RewriteRule .*well-known).* https:\/\/slrh.org:10000\//,/VirtualHost/{
/SSLCertificateKeyFile \/etc\/ssl\/virtualmin\//a \
####\n\
SSLCertificateFile /home/slrh.org/ssl.cert\n\
SSLCertificateKeyFile /home/slrh.org/ssl.key
}
END_OF_SLRH_ORG_SED
######## find . -name mariadbDumpAllDatabases.bsh ; ## optional
######## vi ./server-migration/mariadb/migration/mariadbDumpAllDatabases.bsh ; ## change password (or use sed)
######## ## --OR-- ## CHANGE THE HARDCODED PASSWORD !
echo '<?php echo $_SERVER["USER"] ; echo " Current script owner: " . get_current_user(); phpinfo(); ?> ' > /home/${DOMAIN}/public_html/phpinfo.php ;