I need help to change command centos6 TO Centos 7

General support questions
Post Reply
achrafhanny
Posts: 3
Joined: 2021/01/06 17:56:01

I need help to change command centos6 TO Centos 7

Post by achrafhanny » 2021/01/06 18:01:05

Hello guys have any idea how can i change command linux centos 6 to centos 7 , i have own app working on serve centos 6 but now i want t ochange the command to centos 6 thank you first

command Centos 6 i want to change the command to centos 7 :


yum groupinstall 'base'
yum groupinstall 'web server'
yum grouplist
yum groupinstall 'MySQL Database client'
yum groupinstall 'MySQL Database server'
yum -y install nano

echo 'ZONE="Africa/Casablanca"' > /etc/sysconfig/clock
echo 'UTC=true' >> /etc/sysconfig/clock
ln -snf /usr/share/zoneinfo/Africa/Casablanca /etc/localtime
yum -y install ntp.x86_64|tee -a /tmp/install_log
ntpd -g -q
hwclock -wu

yum -y remove mysql mysql-server |tee -a /tmp/install_log
sudo yum install mysql-server
sudo /sbin/chkconfig --levels 235 mysqld on
mv /var/lib/mysql /var/lib/mysql_old_backup
rpm -Uvh http://download.fedoraproject.org/pub/e ... noarch.rpm |tee -a /tmp/install_log
rpm -Uvh http://rpms.famillecollet.com/enterpris ... ease-6.rpm |tee -a /tmp/install_log
rpm -Uvh http://download.fedoraproject.org/pub/e ... noarch.rpm |tee -a /tmp/install_log
rpm -Uvh http://rpms.famillecollet.com/enterpris ... ease-6.rpm |tee -a /tmp/install_log
wget -Uvh http://dev.mysql.com/get/mysql57-commun ... noarch.rpm |tee -a /tmp/install_log
wget -Uvh http://dl.fedoraproject.org/pub/epel/5/ ... noarch.rpm |tee -a /tmp/install_log
wget -Uvh http://rpms.famillecollet.com/enterpris ... ease-5.rpm |tee -a /tmp/install_log
wget -Uvh http://dl.fedoraproject.org/pub/epel/6/ ... noarch.rpm |tee -a /tmp/install_log
wget -Uvh http://rpms.famillecollet.com/enterpris ... ease-6.rpm |tee -a /tmp/install_log

yum install epel-release
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm |tee -a /tmp/install_log
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm |tee -a /tmp/install_log

yum -y localinstall mysql57-community-release-el6-7.noarch.rpm |tee -a /tmp/install_log
yum -y repolist enabled | grep "mysql.*-community.*" |tee -a /tmp/install_log
yum -y install mod_ssl.x86_64|tee -a /tmp/install_log
yum -y install mysql-community-server |tee -a /tmp/install_log
yum -y install ntp.x86_64|tee -a /tmp/install_log
yum -y install gcc.x86_64|tee -a /tmp/install_log
yum -y install dos2unix.x86_64|tee -a /tmp/install_log
yum -y install sudo.x86_64 wget.x86_64|tee -a /tmp/install_log
yum -y install perl-ExtUtils-MakeMaker.x86_64 |tee -a /tmp/install_log
yum -y install cronie.x86_64 cronie-anacron.x86_64 crontabs.noarch|tee -a /tmp/install_log
yum -y install iptraf.x86_64|tee -a /tmp/install_log
yum -y install nano.x86_64 telnet.x86_64 sudo.x86_64 lsof.x86_64 |tee -a /tmp/install_log
sudo yum install postfix
sudo yum install cyrus-sasl
sudo yum install cyrus-imapd
sudo yum install postfix


yum -y install postfix.xse86_64|tee -a /tmp/install_log
yum -y install sendmail.x86_64 sendmail-cf|tee -a /tmp/install_log



yum -y install httpd.x86_64|tee -a /tmp/install_log
yum -y install php php-cli php-gd php-mysql php-mbstring
yum -y install vsftpd ftp|tee -a /tmp/install_log
yum -y install openssh-clients rsync|tee -a /tmp/install_log
yum -y install php php-cli php-gd php-mysql php-mbstring|tee -a /tmp/install_log
yum -y install gcc php-devel php-pear libssh2 libssh2-devel make php-devel php-pearlibssh2-devel|tee -a /tmp/install_log
yum -y install php-imap|tee -a /tmp/install_log




yum install gcc php-devel php-pear libssh2 libssh2-devel make
pecl install -f ssh2


yum -y install libssh2-php|tee -a /tmp/install_log
yum -y install net-tools|tee -a /tmp/install_log
yum -y install mail|tee -a /tmp/install_log
yum -y install incron|tee -a /tmp/install_log
yum -y install squid|tee -a /tmp/install_log
yum -y install phpmyadmin|tee -a /tmp/install_log
yum -y install sendmail|tee -a /tmp/install_log
yum -y install vixie-cron|tee -a /tmp/install_log
yum -y install zip unzip|tee -a /tmp/install_log



iptables -I INPUT -p tcp --dport 25 -j ACCEPT
iptables -I INPUT -p tcp --dport 2500 -j ACCEPT
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
service iptables save
service httpd restart
pecl install -f ssh2
echo extension=ssh2.so > /etc/php.d/ssh2.ini
setsebool httpd_can_network_connect_db=1


rm -rf /var/www/app
rm -rf /var/www/apps
rm -rf /home/epel-release-6-8.noarch.rpm
rm -rf /home/mysql57-community-release-el6-7.noarch.rpm
rm -rf /home/remi-release-5.rpm
rm -rf /home/remi-release-6.rpm

tar xzfv /home/app_master.tar.gz -C /var/www/
tar xzfv /home/app_client.tar.gz -C /var/www/

rm -f /var/www/app/manager/server/gsources.txt
touch /var/www/app/manager/server/gsources.txt
touch /var/www/app/manager/server/rdomains.txt
touch /var/www/app/manager/server/rips.txt
touch /var/www/app/manager/server/vmtas.txt
touch /var/www/apps/mailer/server/vmta/config.d/vmtas1.txt


yes | cp -rf /home/files/httpd.conf /etc/httpd/conf/
yes | cp -rf /home/files/default_website.conf /etc/httpd/conf.d/
yes | cp -rf /home/files/phpMyAdmin.conf /etc/httpd/conf.d/
yes | cp -rf /home/files/bd.php /var/www/apps/scripts/
yes | cp -rf /home/files/bd.php /var/www/app/scripts/
yes | cp -rf /home/files/bdd.php /var/www/apps/scripts/
yes | cp -rf /home/files/bdd.php /var/www/app/scripts/
yes | cp -rf /home/files/php.ini /etc/
yes | cp -rf /home/files/sudoers /etc/

chmod 755 /etc/sudoers
chmod 777 /var/www/apps/mailer
chmod 777 /var/www/apps/mailer/server
chmod 777 /var/www/apps/mailer/server/vmta
chmod 777 /var/www/apps/mailer/server/vmta/config.d
chmod 777 /home/suppression/*
chmod 777 /home/latest/*

#Mettre en place le cron du clean du log pmta :
echo "/var/www/app/manager/ipprox.txt IN_MODIFY,IN_CREATE,IN_DELETE /etc/init.d/httpd reload" | tee -a /var/spool/incron/root 2>&1
echo "/var/www/app/manager/server/ipprox_client.txt IN_MODIFY,IN_CREATE,IN_DELETE /etc/init.d/httpd reload" | tee -a /var/spool/incron/root 2>&1
echo "/etc/httpd/conf.d/default_website.conf IN_MODIFY,IN_CREATE,IN_DELETE /etc/init.d/httpd reload" | tee -a /var/spool/incron/root 2>&1
echo "/etc/httpd/conf/httpd.conf IN_MODIFY,IN_CREATE,IN_DELETE /etc/init.d/httpd reload" | tee -a /var/spool/incron/root 2>&1

echo "Allow from All `last -1 | grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b'`" > /var/www/app/manager/ipprox.txt
echo "Allow from all `last -1 | grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b'`" > /var/www/app/manager/server/ipprox_client.txt

service incrond start
service crond start
chkconfig incrond on && chkconfig sendmail on && chkconfig crond on
service httpd restart
service mysqld start
service mysqld status


_____________________________________________________________________________________________
_____________________________________________________________________________________________
_____________________________________________________________________________________________
_________________## Installing Mysql ***



yum install yum-utils
wget http://dl.fedoraproject.org/pub/epel/6/ ... noarch.rpm
wget http://rpms.famillecollet.com/enterpris ... ease-6.rpm
rpm -Uvh epel-release-6-8.noarch.rpm remi-release-6.rpm
yum-config-manager --enable remi-php54
yum-config-manager --enable remi-php55
yum-config-manager --enable remi-php56
php -v
ssh-keygen




yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo


yum -y install libssh2.x86_64 php-pecl-ssh2.x86_64

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: I need help to change command centos6 TO Centos 7

Post by TrevorH » 2021/01/07 09:39:24

There is no upgrade path from CentOS 6 to a newer version. Backup your data and reinstall.

Do not attempt to do an upgrade in place, it is unsupported and usually results in an inoperable system that will not boot. Do not do it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

achrafhanny
Posts: 3
Joined: 2021/01/06 17:56:01

Re: I need help to change command centos6 TO Centos 7

Post by achrafhanny » 2021/01/07 14:43:18

i need to change the command centos6 to centos 7 that what i need
i want to use centos 7 but i want t ochange command centos 6 to centos 7

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: I need help to change command centos6 TO Centos 7

Post by TrevorH » 2021/01/07 15:14:10

Then you reinstall your system with CentOS 7 and reinstall all your apps and migrate your data.

There is NO upgrade process from one CentOS version to the next.

It does not work. It is not supported. Do not attempt it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

achrafhanny
Posts: 3
Joined: 2021/01/06 17:56:01

Re: I need help to change command centos6 TO Centos 7

Post by achrafhanny » 2021/01/07 15:21:58

the problem my command not working in centos 7 working in centos 6

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: I need help to change command centos6 TO Centos 7

Post by avij » 2021/01/07 19:29:22

Do you mean that you have already installed CentOS 7, and the commands you used (listed above) on CentOS 6 to configure your system no longer work on CentOS 7?

Many of the packages you refer to are for EL6 (CentOS 6). You will need to find the equivalent EL7 (CentOS 7) packages and use those instead. Some packages may need some other changes when using CentOS 7. Try this yourself first, and if you have specific problems which you can't solve after searching the web, please write more details about your specific problem. Then maybe someone can help.

tunk
Posts: 1204
Joined: 2017/02/22 15:08:17

Re: I need help to change command centos6 TO Centos 7

Post by tunk » 2021/01/07 19:33:17

The default firewall in C7 is firewalld, not iptables.
And what's the command (and TLDR).

Post Reply