Chinaunix首页 | 论坛 | 博客
  • 博客访问: 597176
  • 博文数量: 70
  • 博客积分: 3219
  • 博客等级: 中校
  • 技术积分: 1197
  • 用 户 组: 普通用户
  • 注册时间: 2006-02-13 12:20
个人简介

谢谢您的对我的博客的关心,同时希望这个站点真的能够对您有所帮助。 如果可以请告诉我你的联系方式(可能的话告诉我两个或更多,我不希望失去任何一个关注本主页人士的联系,不论你是我的老友,或是一位新朋友,对于我来说您十分重要)

文章分类
文章存档

2021年(1)

2020年(13)

2018年(1)

2013年(12)

2012年(2)

2009年(2)

2008年(6)

2007年(20)

2006年(13)

分类: LINUX

2020-06-11 22:15:52

cd  /etc/yum.repos.d/
mkdir bak
mv * bak/
echo 192.168.2.155   >> /etc/hosts
echo '[local]

echo '[aliBase]
name=aliBase
baseurl=
enabled=1
gpgcheck=1
gpgkey=RPM-GPG-KEY-CentOS-$releasever' > /etc/yum.repos.d/aliBase.repo

echo '[aliEpel]
name=aliEpel
baseurl=\Server/$basearch/
enabled=1
gpgcheck=0' > /etc/yum.repos.d/aliEpel.repo
cd

echo HandleLidSwitch=ignore >> /etc/systemd/logind.conf
sed -i '/^SELINUX/s/enforcing/disabled/' /etc/selinux/config
sed -i '/^HISTSIZE/s/=1000.*/=10000/' /etc/profile
sed -i '/^keepcache/s/0/1/' /etc/yum.conf

echo 'PS1="\[\e[37;40m\][\[\e[32;40m\]\u\[\e[37;40m\]@\h \[\e[35;40m\]\W\[\e[0m\]]\\$ \[\e[33;40m\]"' >> /etc/profile
#scp 192.168.2.155:.ssh/au* .ssh/


#systemctl enable rc-local
#chmod 755 /etc/rc.d/rc.local
reboot

yum -y install zip unzip bzip2 bzip2-devel zlib zlib-devel
yum -y install screen wget lsof net-tools tree unix2dos dos2unix sysstat
yum -y install vim-common vim-enhanced
yum -y install deltarpm
alias vi=vim
echo 'alias vi=vim' >> /etc/profile
yum -y install tcp_wrappers psmisc hdparm
source /etc/profile

yum -y install perl numactl*
scp 192.168.2.155:/home/www/download/mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz ./
tar -zxf mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz
rm -f mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.7.27-linux-glibc2.12-x86_64 /usr/local/mysql
mkdir /usr/local/mysql/data
groupadd mysql
useradd -r -s /sbin/nologin -g mysql mysql -d /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql
rm -f /etc/my.cnf
/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/
#log the password
/usr/local/mysql/bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/data/
vi /etc/my.cnf

点击(此处)折叠或打开

  1. [mysqld]
  2. basedir=/usr/local/mysql
  3. datadir=/usr/local/mysql/data
  4. port=3306
  5. server_id=1
  6. socket=/var/lib/mysql/mysql.sock

  7. character_set_server = utf8mb4
  8. collation_server = utf8mb4_unicode_ci
  9. max_heap_table_size = 400M
  10. max_allowed_packet = 64M
  11. join_buffer_size = 64M
  12. tmp_table_size = 64M
  13. innodb_buffer_pool_size = 2000M
  14. innodb_doublewrite = ON
  15. innodb_flush_log_at_timeout = 3
  16. innodb_read_io_threads = 32
  17. innodb_write_io_threads = 16
  18. innodb_log_file_size = 256M
  19. innodb_buffer_pool_instances = 17
  20. innodb_io_capacity = 5000
  21. innodb_io_capacity_max = 10000
  22. transaction_isolation = READ-COMMITTED

  23. [mysqld_safe]
  24. log-error=/var/log/mysqld.log
  25. pid-file=/var/run/mysqld/mysqld.pid

  26. [client]
  27. socket=/var/lib/mysql/mysql.sock
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
sed -i "/^basedir/s/=.*/=\/usr\/local\/mysql/" /etc/init.d/mysql
sed -i "/^datadir=/s/=.*/=\/usr\/local\/mysql\/data/" /etc/init.d/mysql
chkconfig mysql on
echo 'export MYSQL_HOME="/usr/local/mysql"' >> /etc/profile
echo 'export PATH="$PATH:$MYSQL_HOME/bin"' >> /etc/profile
. /etc/profile
mkdir /var/lib/mysql
chown mysql:mysql /var/lib/mysql
service mysql restart
/usr/local/mysql/bin/mysql -u root -p
mysql> set password=password('123456');
mysql> quit
mysql -u root -p

firewall-cmd --add-port=3306/tcp --permanent
firewall-cmd --reload

yum -y install mysql-devel
ln -s /usr/local/mysql/lib/libmysqlclient.so.20.3.12 /usr/lib64/libmysqlclient.so.20
ln -s /usr/lib64/libmysqlclient.so.20 /usr/lib64/libmysqlclient.so
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot mysql -p

yum -y install httpd
yum -y install gd mod_ssl mod_auth_kerb ImageMagick
systemctl enable httpd

yum -y install epel-release
rpm -ivh
yum install -y php72w php72w-cli php72w-mysqli php72w-mbstring
yum install -y php72w-snmp php72w-ldap php72w-pdo_dblib php72w-devel php72w-pear.noarch php72w-gd php72w-xml php72w-process
yum install -y rrdtool
sed -i '/^;date.timezone/s/.*/date.timezone = \"Asia\/Shanghai\"/' /etc/php.ini
sed -i '/^upload_max_filesize/s/.*/upload_max_filesize = 800M/' /etc/php.ini
sed -i '/^post_max_size/s/.*/post_max_size = 800M/' /etc/php.ini
sed -i '/^short_open_tag/s/.*/short_open_tag = On/' /etc/php.ini
sed -i '/^max_execution_time/s/= .*/= 300/' /etc/php.ini
sed -i '/^max_input_time/s/= .*/= 300/' /etc/php.ini
sed -i '/^memory_limit/s/= .*/= 400M/' /etc/php.ini
#yum install -y php php-mysql php-gd php-mbstring php-devel memcached php-pecl-memcache
firewall-cmd --add-port=80/tcp --permanent
firewall-cmd --add-port=443/tcp --permanent

yum -y install samba
mkdir /home/share
chmod 777 /home/share/
echo "[global]
        log file = /var/log/samba/log.%m
        max log size = 50
        security = user
        map to guest = Bad User
[share]
        path=/home/share
        readonly=yes
        browseable=yes
        writable = yes
        guest ok=yes" > /etc/samba/smb.conf
systemctl start smb
systemctl enable smb
firewall-cmd --add-port=137/udp --permanent
firewall-cmd --add-port=138/udp --permanent
firewall-cmd --add-port=139/tcp --permanent
firewall-cmd --add-port=445/tcp --permanent
firewall-cmd --add-port=389/tcp --permanent

yum groups install GNOME

yum -y install tigervnc-server

yum -y install ntp
sed -i 's/^server.*/server 10.1.97.20 iburst/' /etc/ntp.conf
systemctl enable ntpd
systemctl start ntpd

sed -i '/^find/d;/^which/d;/^yum list/d;/^ssh/d;/^clear/d;/^screen/d;/^ls/d;/^ll/d;/^cat/d;/^more/d;/history/d;/^ps/d;/^top/d;/^netstat/d;/^exit/d;/^rsync/d;/^pwd/d;/^du/d;/^df/d' /root/.bash_history
阅读(1381) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~