LiteSpeed Server

  • nano /etc/selinux/config
    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #     enforcing - SELinux security policy is enforced.
    #     permissive - SELinux prints warnings instead of enforcing.
    #     disabled - No SELinux policy is loaded.
    SELINUX=permissive
    # SELINUXTYPE= can take one of these two values:
    #     targeted - Targeted processes are protected,
    #     mls - Multi Level Security protection.
    SELINUXTYPE=targeted

    reboot
  • lvs -a -o +devices
     LV                  VG      Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices
      cache_Lv_cache_meta centos7 -wi-ao----  20.00m                                                     /dev/vda2(1788)
      cache_lv_cache      centos7 -wi-ao----   4.66g                                                     /dev/vda2(596)
      home                centos7 -wi-ao---- 476.00m                                                     /dev/vda2(0)
      root                centos7 -wi-ao----  16.21g                                                     /dev/vda2(1793)
      swap                centos7 -wi-ao----   1.86g                                                     /dev/vda2(119)


     
  • lvconvert --type cache-pool --cachemode writethrough --poolmetadata centos7/cache_Lv_cache_meta centos7/cache_lv_cache
     WARNING: Converting logical volume centos7/cache_lv_cache and centos7/cache_Lv_cache_meta to cache pool's data and metadata volumes with metadata wiping.
      THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
    Do you really want to convert centos7/cache_lv_cache and centos7/cache_Lv_cache_meta? [y/n]: y
      Logical volume centos7/cache_Lv_cache_meta contains a filesystem in use.
      Aborting. Failed to deactivate centos7/cache_Lv_cache_meta.

     
  • umount /cache/lv_cache
    umount /cache/Lv_cache_meta

     
  • lvconvert --type cache-pool --cachemode writethrough --poolmetadata centos7/cache_Lv_cache_meta centos7/cache_lv_cache
    WARNING: Converting logical volume centos7/cache_lv_cache and centos7/cache_Lv_cache_meta to cache pool's data and metadata volumes with metadata wiping.
      THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
    Do you really want to convert centos7/cache_lv_cache and centos7/cache_Lv_cache_meta? [y/n]: y
      Volume group "centos7" has insufficient free space (2 extents): 5 required.
  • lvreduce -L 4.6G  /dev/centos7/cache_lv_cache
     Rounding size to boundary between physical extents: 4.60 GiB.
      Size of logical volume centos7/cache_lv_cache changed from 4.66 GiB (1192 extents) to 4.60 GiB (1178 extents).
    Logical volume centos7/cache_lv_cache successfully resized.

     
  • lvconvert --type cache-pool --cachemode writethrough --poolmetadata centos7/cache_Lv_cache_meta centos7/cache_lv_cache
     WARNING: Converting logical volume centos7/cache_lv_cache and centos7/cache_Lv_cache_meta to cache pool's data and metadata volumes with metadata wiping.
      THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
    Do you really want to convert centos7/cache_lv_cache and centos7/cache_Lv_cache_meta? [y/n]: y
      Converted centos7/cache_lv_cache to cache pool.
     
  •  lvs -a -o +devices
      LV                     VG      Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices
      cache_lv_cache         centos7 Cwi---C---   4.60g                                                     cache_lv_cache_cdata(0)
      [cache_lv_cache_cdata] centos7 Cwi-------   4.60g                                                     /dev/vda2(596)
      [cache_lv_cache_cmeta] centos7 ewi-------  20.00m                                                     /dev/vda2(1788)
      home                   centos7 -wi-ao---- 476.00m                                                     /dev/vda2(0)
      [lvol0_pmspare]        centos7 ewi-------  20.00m                                                     /dev/vda2(1774)
      root                   centos7 -wi-ao----  16.21g                                                     /dev/vda2(1793)
      swap                   centos7 -wi-ao----   1.86g                                                     /dev/vda2(119)
     
  • lvconvert --type cache --cachepool centos7/cache_lv_cache centos7/root
    Do you want wipe existing metadata of cache pool volume centos7/cache_lv_cache? [y/n]: y
      device-mapper: remove ioctl on (253:3) failed: Device or resource busy
      Logical volume centos7/root is now cached.
  • lsblk
    NAME                             MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    vda                              252:0    0   25G  0 disk
    ├─vda1                           252:1    0  476M  0 part /boot
    └─vda2                           252:2    0 23.2G  0 part
      ├─centos7-swap                 253:1    0  1.9G  0 lvm  [SWAP]
      ├─centos7-home                 253:2    0  476M  0 lvm  /home
      ├─centos7-cache_lv_cache_cdata 253:3    0  4.6G  0 lvm
      │ └─centos7-root               253:0    0 16.2G  0 lvm  /
      ├─centos7-cache_lv_cache_cmeta 253:4    0   20M  0 lvm
      │ └─centos7-root               253:0    0 16.2G  0 lvm  /
      └─centos7-root_corig           253:5    0 16.2G  0 lvm
        └─centos7-root               253:0    0 16.2G  0 lvm  /
     
  • nano /etc/fstab
    #
    # /etc/fstab
    # Created by anaconda on Tue Aug 27 08:19:04 2019
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    /dev/mapper/centos7-root /                       xfs     defaults        0 0
    UUID=777632e3-743b-4de5-a544-90578aa6025a /boot                   xfs     defaults        0 0
    #/dev/mapper/centos7-cache_Lv_cache_meta /cache/Lv_cache_meta    xfs     defaults        0 0
    #/dev/mapper/centos7-cache_lv_cache /cache/lv_cache         xfs     defaults        0 0

    /dev/mapper/centos7-home /home                   xfs     defaults        0 0
    /dev/mapper/centos7-swap swap                    swap    defaults        0 0
     
  • dracut --regenerate-all -f && grub2-mkconfig -o /boot/grub2/grub.cfg
  • yum install httpd -y

     
  • firewall-cmd --permanent --add-service=http
         firewall-cmd --permanent --add-service=https
         firewall-cmd --zone=public --permanent --add-port=53/udp
        firewall-cmd --zone=public --permanent --add-port=53/tcp
       firewall-cmd --zone=public --permanent --add-port=80/tcp
         firewall-cmd --zone=public --permanent --add-port=443/tcp
     firewall-cmd --zone=public --permanent --add-port=8088/tcp
    firewall-cmd --zone=public --permanent --add-port=7080/tcp
          firewall-cmd --reload
        firewall-cmd --list-ports
         iptables -vnL | grep 53
         iptables -vnL | grep 80
         iptables -vnL | grep 443
  • yum install epel-release
  • yum install gcc gcc-c++ make autoconf glibc rcs
  • yum install pcre-devel openssl-devel expat-devel geoip-devel zlib-devel udns-devel
  • cd /root
    yum install wget
  • wget https://openlitespeed.org/packages/openlitespeed-1.5.6.src.tgz
  • tar xzvf openlitespeed-1.5.6.src.tgz
  •  cd openlitespeed-1.5.6/
  • ./configure --with-user=apache --with-group=apache
  •  make && make install
  • rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm
  • yum install lsphp70 lsphp70-common lsphp70-mysqlnd lsphp70-gd lsphp70-process lsphp70-mbstring lsphp70-xml lsphp70-mcrypt lsphp70-pdo lsphp70-imap lsphp70-soap lsphp70-bcmath lsphp70-intl lsphp70-json lsphp70-opcache
  •  ln -sf /usr/local/lsws/lsphp70/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp70
  • /usr/local/lsws/bin/lswsctrl start

 

 

 

  • next