Hướng dẫn cài đặt OpenLiteSpeed server trên centos 6.x
Mục lục:
Hướng dẫn cài đặt OpenLiteSpeed server trên centos 6.x
Software:
- Openlitespeed
- Mysqld mariadb
- PHP 5.x
- PhpmyAdmin
Hướng dẫn cài đặt:
Bước 1: Chuẩn bị
# Tắt firewall
1 |
/sbin/service iptables stop |
# Update phần mềm
1 |
yum update -y |
# Cài đặt repo
1 2 3 4 5 6 7 |
x86_64: rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm i386: rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm |
# Cài đặt Development tool
1 2 |
yum groupinstall 'Development tools' -y yum install bzip2-devel curl-devel pcre-devel expat-devel libc-client-devel libxml2-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel mhash-devel gd-devel openssl-devel zlib-devel GeoIP-devel -y |
Bước 2: Cài đặt mysql-mariadb
# cài repo
1 |
vi /etc/yum.repos.d/MariaDB.repo |
Copy nội dung sau vào file vừa tạo:
1 2 3 4 5 |
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos6-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 |
# Cài đặt mysql-mariadb
1 |
yum install MariaDB-server MariaDB-client -y && service mysql restart |
# Cấu hình cài đặt secure cho mysql
1 |
/usr/bin/mysql_secure_installation |
Chọn Yes từ đầu đến cuối.
# Restart lại dịch vụ
1 |
service mysql restart |
Bước 3: Cài đặt Openlitespeed
# Cài các gói hỗ trợ
1 |
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ius-release-1.0-11.ius.el6.noarch.rpm |
# Cài repo Openlistespeed
1 |
rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el6.noarch.rpm |
# Cài đặt Openlitespeed
1 |
yum install openlitespeed -y && /usr/local/lsws/bin/lswsctrl start |
Bước 4: Cấu hình để web server hoạt động
# Login vào trang quản trị
https://[IP_server]:7080
User và password mặc định : admin / 123456
# Thay đổi password admin mặc định
Home -> webadmin console -> security -> mục “web admin users” -> chọn “admin” -> thay đổi password -> save
# Thay đổi port 8088 -> 80
Configuration > Listeners > Default > Edit -> 8088 -> 80
# Kiểm tra webserrver đã hoạt động hay chưa.
Bước 5: Cài đặt PHP trên Openlitespeed
# Build PHP
# Chọn version php -> Next
copy vào “Configure Parameters
1 |
'--with-mysql' '--with-mysqli' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-mbstring' '--with-iconv' '--with-libdir=lib64' '--with-litespeed' '--with-curl' '--enable-zip' '--with-bz2' '--with-jpeg-dir=lib64' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-exif' '--with-openssl' '--with-xmlrpc' '--with-freetype-dir=lib64' '--with-png-dir=lib64' '--enable-inline-optimization' '--enable-xml' |
Kích chọn “Build PHP 5.x”
# Sau khi đợi cho Openlitespeed download các gói packages -> chọn Next
# Để đảm bảo việc cài đặt bạn login ssh và server và đánh lệnh sau :
1 |
/usr/local/lsws/phpbuild/buildphp_manual_run.sh |
# Sau đó quay lại trình duyệt chờ đợi việc cài đặt từ 10 đến 15 phút -> Báo completed -> Lên trình duyệt kiểm tra
http://[IP_server]/phpinfo.php
# Copy file php.ini vào đúng vị trí chạy openlitespeed
1 |
cp /usr/local/lsws/phpbuild/php-5.4.38/php.ini-development /usr/local/lsws/lsphp5/lib/php.ini |
Note: Còn tuỳ thuộc vào mình build php version mấy mà đường dẫn cho đúng.
Bước 6: Cài đặt PhpMyadmin
# Cài đặt phpmyadmin
1 2 3 4 5 6 7 8 9 |
cd /usr/local/lsws/DEFAULT/html/protected wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.1.1/phpMyAdmin-4.1.1-all-languages.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fphpmyadmin%2F&ts=1387905632&use_mirror=kent unzip phpMyAdmin-4.1.1-all-languages* mv phpMyAdmin-4.1.1-all-languages/* /usr/local/lsws/DEFAULT/html/protected mv config.sample.inc.php config.inc.php |
# Kiểm tra xem phpmyadmin đã hoạt động hay chưa
https://[IP_server]/protected/index.php
Nhập password bảo vệ mặc định là :
User: test
Pass: test123
-> Sau khi nhập vào thì bạn sẽ hiện lên trang đăng nhập PHPmyadmin -> login thành công.
Bài viết khá hay ! Thanks
Khá hay, khá bổ ích! 1 option mới để chiến!